#ifndef __DEFINES_H_ #define __DEFINES_H_ #define STARDAYSECONDS 86164.0 #define HOURSECONDS 3600.0 #define HOUR24SECONDS 86400.0 #ifndef PI #define PI 3.141592653589793 #endif #ifndef M_PI /* # define M_PI 3.14159265358979323846 */ # define M_PI 3.1415926535897932384626433832795029L #endif #ifndef P_ #if defined(__STDC__) || defined(__cplusplus) || NeedFunctionPrototypes #define P_(s) s #else #define P_(s) () #endif #endif /* P_ */ #define rad(x) ((x)*PI/180.0) #define deg(x) ((x)*180.0/PI ) #define hdeg(x) ((x)*15.0) #define degh(x) ((x)/15.0) #define hrad(x) rad(hdeg(x)) #define arctohs(a,s) ((a)/(s)) #define hstoarc(a,s) ((a)*(s)) #define hourstosecs(x) ((x)*3600.0) #define hourstomillis(x) ((x)*3600.0*1000.0) #define secstohours(x) ((x)/3600.0) #define millistohours(x) ((x)/3600.0/1000.0) #define circle_radius(x,y) (sqrt(((x)*(x))+((y)*(y)))); #define circle_circumf(r) ((r)*2.0*PI) #define circle_angle(b,u) (((b)/(u))*360.0) #define ARC0 0.0 #define ARC45 162000.0 #define ARC90 324000.0 #define ARC135 486000.0 #define ARC180 648000.0 #define ARC225 810000.0 #define ARC270 972000.0 #define ARC315 1134000.0 #define ARC360 1296000.0 #define SPEED_GUIDE 2 #define SPEED_FAST 1 #define SPEED_SLOW 0 #define MNORUN 0 #define MCORRECTION 1 #define MGOTO 2 #define MGUIDE 3 #define MFR 4 #define KEYPADTYPE_JOYSTICK 1 #define KEYPADTYPE_PARALLEL 2 #define KEYPAD_NOKEY 15 #define KEYPAD_LEFT 5 #define KEYPAD_RIGHT 3 #define KEYPAD_DOWN 9 #define KEYPAD_UP 7 #define KEYPAD_HIGHLEFT 4 #define KEYPAD_HIGHRIGHT 2 #define KEYPAD_HIGHDOWN 8 #define KEYPAD_HIGHUP 6 #define KEYPAD_FOLLOW 13 #define KEYPAD_STOP 11 #define KEYPAD_HIGHALONE 14 #define KEYPAD_HIGHFOLLOW 12 #define KEYPAD_HIGHSTOP 10 #define KEYPAD_HIGHFOLLOWRIGHT 0 #define KEYPAD_HIGHFOLLOWSTOPUP 0 #define KEYPAD_HIGHSTOPLEFT 0 /* the generally events for the server eltel */ /* the joystickkeypad is implemented directly into server, so the keypadvalues are a part of the ( steering ) IF-Events. Have a look, that a complete no-event is 0x0f, and not 0, or 0xff. /*--------------------------------------------*/ #define EVT_NOTHING KEYPAD_NOKEY #define IFEVT_STARTVALUES 0 #define IFEVT_NOTHING KEYPAD_NOKEY #define IFEVT_ENDALL KEYPAD_HIGHFOLLOWRIGHT #define IFEVT_SLOWLEFT KEYPAD_LEFT #define IFEVT_SLOWRIGHT KEYPAD_RIGHT #define IFEVT_SLOWDOWN KEYPAD_DOWN #define IFEVT_SLOWUP KEYPAD_UP #define IFEVT_FASTLEFT KEYPAD_HIGHLEFT #define IFEVT_FASTRIGHT KEYPAD_HIGHRIGHT #define IFEVT_FASTDOWN KEYPAD_HIGHDOWN #define IFEVT_FASTUP KEYPAD_HIGHUP #define IFEVT_GOTORADECKOORS KEYPAD_HIGHFOLLOW #define IFEVT_ORIGINRADECKOORS KEYPAD_HIGHSTOP #define IFEVT_STARTGUIDE KEYPAD_FOLLOW #define IFEVT_STOPMOTORS KEYPAD_STOP #define IFEVT_GETKOORS KEYPAD_HIGHALONE #define IFEVT_ENDVALUES 15 #define PREVT_STARTVALUES 16 #define PREVT_NOTHING EVT_NOTHING #define PREVT_GOTOAZALTKOORS 17 #define PREVT_FRTURNLEFT 18 #define PREVT_ORIGINAZALTKOORS 19 #define PREVT_FRTURNRIGHT 20 #define PREVT_SENDAZALTKOORSTOXEPHEM 21 #define PREVT_SENDRADECKOORSTOXEPHEM 22 #define PREVT_MARKRADECKOORS 23 /*specials for using xephem fifos if PREVT_NEXTGOTOKOORORIGIN is used, all calls of PREVT_GOTOAZALTKOORS, and PREVT_GOTORADECKOORS will have the effect of PREVT_ORIGINAZALTKOORS, PREVT_ORIGINRADECKOORS instead, - till PREVT_NEXTGOTOKOORGOTO is called. This is usefull, for example is xephem's fifoout is used, but the telescope should not go to this koordinates, instead resets its position to this. */ #define PREVT_SWITCHOFFVALIDCALCREFRACTION 200 #define PREVT_SWITCHONVALIDCALCREFRACTION 201 #define PREVT_JOYSTICKKEYPADASPECIALON 202 #define PREVT_JOYSTICKKEYPADASPECIALOFF 203 #define PREVT_XEPHEMOUTLOOPON 204 #define PREVT_XEPHEMOUTLOOPOFF 205 #define PREVT_INITFIELDROTATOR 206 #define PREVT_STOPFIELDROTATOR 207 #define PREVT_GETFRKOOR 208 #define PREVT_TOGGLEEXFIFOFOLLOW 209 #define PREVT_TOGGLEENCODERS 210 #define PREVT_ENDVALUES 255 /*--------------------------------------------*/ /*key.c */ /*These are the DOS-SCANCODES for usefull keys. ReadKey for Unix will translate this*/ #define TAB ((int) 0x0F09) #define BACKSPACE ((int) 0x0E08) #define ENTER ((int) 0x1C0D) #define LEFT ((int) 0x4B00) #define RIGHT ((int) 0x4D00) #define UP ((int) 0x4800) #define DOWN ((int) 0x5000) #define HOME ((int) 0x4700) #define END ((int) 0x4F00) #define PGUP ((int) 0x4900) #define PGDN ((int) 0x5100) #define INS ((int) 0x5200) #define DEL ((int) 0x5300) #define FN1 ((int) 0x3B00) #define FN2 ((int) 0x3C00) #define FN3 ((int) 0x3D00) #define FN4 ((int) 0x3E00) #define FN5 ((int) 0x3F00) #define FN6 ((int) 0x4000) #define FN7 ((int) 0x4100) #define FN8 ((int) 0x4200) #define FN9 ((int) 0x4300) #define FN10 ((int) 0x4400) #define FN11 ((int) 0x8500) #define FN12 ((int) 0x8600) /* vid.c */ #define SetDefCol ScrCol(0,7) #define SetEndCol SetDefCol /*following definitons also showable as greycols for lcdscreens*/ /*textcol yellow*/ #define SetCol0 ScrCol(0,11) /*textcol lightcyan*/ #define SetCol1 ScrCol(0,14) /*textcol lightred*/ #define SetCol2 ScrCol(0,9) /*textcol lightgreen*/ #define SetCol3 ScrCol(0,10) /*textcol lightblue*/ #define SetCol4 ScrCol(0,12) /*textcol yellow background blue*/ #define SetCol5 ScrCol(4,11) /*textcol black background cyan*/ #define SetCol6 ScrCol(6,0) /* encoders.c*/ #define NOENCODER 0 #define SERIALENCODER 1 #define PARALLELENCODER 2 #define JOYSTICKENCODER 3 #endif