Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

phSideWinderPrecisionProData.cpp

Go to the documentation of this file.
00001 #include <phSideWinderPrecisionProData.h>
00002 #include <phbase.h>
00003 
00004 /* ------------------------------------------------------------------------- */
00005 phSideWinderPrecisionProData::phSideWinderPrecisionProData()
00006 {
00007     phFUNCTION("phSideWinderPrecisionProData::~phSideWinderPrecisionProData")
00008     int locked      = 0;
00009     int rwlocked    = 0;
00010     ph_joystick_key keys[] = 
00011                       { { phJOYSTICK_KEY_BUTTON,"trigger",      0 },
00012                         { phJOYSTICK_KEY_BUTTON,"select",       1 },
00013                         { phJOYSTICK_KEY_BUTTON,"up",           2 },
00014                         { phJOYSTICK_KEY_BUTTON,"down",         3 },
00015                         { phJOYSTICK_KEY_BUTTON,"A",            4 },
00016                         { phJOYSTICK_KEY_BUTTON,"B",            5 },
00017                         { phJOYSTICK_KEY_BUTTON,"C",            6 },
00018                         { phJOYSTICK_KEY_BUTTON,"D",            7 },
00019                         { phJOYSTICK_KEY_BUTTON,"arrow",        8 },
00020                         { phJOYSTICK_KEY_AXIS,  "x",            0 },
00021                         { phJOYSTICK_KEY_AXIS,  "roll",         0 },
00022                         { phJOYSTICK_KEY_AXIS,  "y",            1 },
00023                         { phJOYSTICK_KEY_AXIS,  "pitch",        1 },
00024                         { phJOYSTICK_KEY_AXIS,  "z",            2 },
00025                         { phJOYSTICK_KEY_AXIS,  "yaw",          2 },
00026                         { phJOYSTICK_KEY_AXIS,  "rudder",       2 },
00027                         { phJOYSTICK_KEY_AXIS,  "throttle",     3 },
00028                         { phJOYSTICK_KEY_AXIS,  "hat_x",        4 },
00029                         { phJOYSTICK_KEY_AXIS,  "hat_roll",     4 },
00030                         { phJOYSTICK_KEY_AXIS,  "hat_y",        5 },
00031                         { phJOYSTICK_KEY_AXIS,  "hat_pitch",    5 }
00032                      };
00033     uint32_t count = sizeof(keys) / sizeof(ph_joystick_key);
00034 
00035     phTHIS_LOOSE_LOCK(locked);
00036     phTHIS_READLOCK_LOOSE(rwlocked);
00037 
00038     rc = this->setKeys(keys,count);
00039     phPRINT_RC(rc,NULL,"setKeys()");
00040 
00041     phTHIS_RWUNLOCK_LOOSE(rwlocked);
00042     phTHIS_LOOSE_UNLOCK(locked);
00043 }
00044 
00045 
00046 /* ------------------------------------------------------------------------- */
00047 int32_t phSideWinderPrecisionProData::trigger()
00048 {
00049     return this->get("trigger");
00050 }
00051 
00052 /* ------------------------------------------------------------------------- */
00053 int32_t phSideWinderPrecisionProData::select()
00054 {
00055     return this->get("select");
00056 }
00057 
00058 /* ------------------------------------------------------------------------- */
00059 int32_t phSideWinderPrecisionProData::up()
00060 {
00061     return this->get("up");
00062 }
00063 
00064 /* ------------------------------------------------------------------------- */
00065 int32_t phSideWinderPrecisionProData::down()
00066 {
00067     return this->get("down");
00068 }
00069 
00070 /* ------------------------------------------------------------------------- */
00071 int32_t phSideWinderPrecisionProData::A()
00072 {
00073     return this->get("A");
00074 }
00075 
00076 /* ------------------------------------------------------------------------- */
00077 int32_t phSideWinderPrecisionProData::B()
00078 {
00079     return this->get("B");
00080 }
00081 
00082 /* ------------------------------------------------------------------------- */
00083 int32_t phSideWinderPrecisionProData::C()
00084 {
00085     return this->get("C");
00086 }
00087 
00088 /* ------------------------------------------------------------------------- */
00089 int32_t phSideWinderPrecisionProData::D()
00090 {
00091     return this->get("D");
00092 }
00093 
00094 /* ------------------------------------------------------------------------- */
00095 int32_t phSideWinderPrecisionProData::arrow()
00096 {
00097     return this->get("arrow");
00098 }
00099 
00100 /* ------------------------------------------------------------------------- */
00101 int32_t phSideWinderPrecisionProData::rudder()
00102 {
00103     return this->get("rudder");
00104 }
00105 
00106 /* ------------------------------------------------------------------------- */
00107 int32_t phSideWinderPrecisionProData::throttle()
00108 {
00109     return this->get("throttle");
00110 }
00111 
00112 /* ------------------------------------------------------------------------- */
00113 int32_t phSideWinderPrecisionProData::hat_x()
00114 {
00115     return this->get("hat_x");
00116 }
00117 
00118 /* ------------------------------------------------------------------------- */
00119 int32_t phSideWinderPrecisionProData::hat_pitch()
00120 {
00121     return this->get("hat_pitch");
00122 }
00123 
00124 /* ------------------------------------------------------------------------- */
00125 int32_t phSideWinderPrecisionProData::hat_y()
00126 {
00127     return this->get("hat_y");
00128 }
00129 
00130 /* ------------------------------------------------------------------------- */
00131 int32_t phSideWinderPrecisionProData::hat_roll()
00132 {
00133     return this->get("hat_roll");
00134 }
00135 




Copyright (C) 2002 - 2007 Philip D.S. Thoren ( pthoren@users.sourceforge.net )
University Of Massachusetts at Lowell
Robotics Lab
SourceForge.net Logo

Generated on Sat Jun 16 02:44:07 2007 for phission by  doxygen 1.4.4