Linuxpops  3.01.04
Spectral Anaysis Package for Single Dish Data
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
status.c
Go to the documentation of this file.
1 #include "ds_extern.h"
2 
3 #define ROW0 0.96
4 #define ROW1 0.92
5 #define ROW2 0.88
6 #define ROW3 0.84
7 #define ROW4 0.80
8 #define ROW5 0.76
9 #define ROW6 0.72
10 #define ROW7 0.68
11 #define ROW8 0.64
12 
13 static int font0 = FONT_SIZE_SMALL;
14 
15 int doStatus()
16 {
17  int ret;
18  char tbuf[256];
19 
20  log_msg("Status Update Entered");
21 
22  xgr_mapUnmapWindow("Status Window", 1);
23 
25 
26  sprintf(tbuf, "Map Cols: %4d; Map Rows: %4d", otf.cols, otf.rows);
27  xgr_drawTextClear(0.05, ROW0, tbuf, ORANGE, font0);
28 
29  sprintf(tbuf, "Map Coordinates: RA: 20:31:36; Dec: 39:40:27");
30  xgr_drawTextClear(0.05, ROW1, tbuf, ORANGE, font0);
31 
32  sprintf(tbuf, "Map Cell Size: RA: 12.50 Sec; Dec: 10.00 Sec");
33  xgr_drawTextClear(0.05, ROW2, tbuf, ORANGE, font0);
34 
35  sprintf(tbuf, "Map Cols: 1168; Rows: 1285");
36  xgr_drawTextClear(0.05, ROW3, tbuf, ORANGE, font0);
37 
38  sprintf(tbuf, "OTF: Map Rest Freq: 230.537906");
39  xgr_drawTextClear(0.05, ROW4, tbuf, ORANGE, font0);
40 
41  sprintf(tbuf, "Backend Resolution: 1.000 MHz; noint: 512");
42  xgr_drawTextClear(0.05, ROW5, tbuf, ORANGE, font0);
43 
44  sprintf(tbuf, "Number of Occupied Cells: 20777 out of 1500880");
45  xgr_drawTextClear(0.05, ROW6, tbuf, ORANGE, font0);
46 
47  sprintf(tbuf, "Total Number of OTF Map Scans: 321");
48  xgr_drawTextClear(0.05, ROW7, tbuf, ORANGE, font0);
49 
50  ret = xgr_pixmapToWindow("Status Window");
51 
52  if(ret)
53  {
54  log_msg("xgr_pixmapToWindow(): returned bad window");
55  }
56 
57  xgr_setCurWindow(XGR_MAIN_WIN, XGR_SET_WIN); /* Set back to main */
58 
59  return(0);
60 }
61 
62 
64 {
65  log_msg("doStatWinRepaint()");
66 
69  xgr_pixmapToWindow("Status Window");
70 
71  xgr_setCurWindow(XGR_MAIN_WIN, XGR_SET_WIN); /* Set back to main */
72 
73  doStatus();
74 
75  return(0);
76 }
77 
78 
80 {
81 
82  log_msg("doStatWinReSize()");
83 
84  return(0);
85 }
86 
87 
88 int doStatWinEvent(event, mask)
89 XEvent *event;
90 unsigned int mask;
91 {
92  struct WINDOW *w;
93 
94  log_msg("doStatWinEvent()");
95 
96  switch(event->type)
97  {
98  case MotionNotify:
99  case ButtonPressMask:
100  log_msg("doStatWinEvent(): Button Motion or Button Press");
101  break;
102 
103  case KeyPress:
104  log_msg("doStatWinEvent(): Key Press");
105  return(1);
106  break;
107 
108  default:
109  return(1);
110  break;
111  }
112 
113  if( xgr_findWindow(event->xbutton.display, event->xbutton.window, &w))
114  {
115  log_msg("doStatWinEvent(): xgr_findWindow() returned Non Zero");
116 
117  return(1);
118  }
119 
120  doStatus();
121 
122  return(0);
123 }
#define FONT_SIZE_SMALL
Definition: dataFonts.h:6
#define XGR_STAT_WIN
Definition: xgr.h:22
#define ROW1
Definition: status.c:4
int doStatWinRepaint()
Definition: status.c:63
int doStatWinEvent(XEvent *event, unsigned int mask)
Definition: status.c:88
#define XGR_MAIN_WIN
Definition: xgr.h:19
#define ROW6
Definition: status.c:9
#define XGR_SET_PIXMAP
Definition: xgr.h:24
#define ROW2
Definition: status.c:5
int log_msg(const char *fmt,...)
#define ROW4
Definition: status.c:7
#define ROW7
Definition: status.c:10
#define ROW5
Definition: status.c:8
Definition: xgr.h:48
int xgr_findWindow(Display *dpy, Window win, struct WINDOW **w)
Definition: xgr.c:602
#define ROW0
Definition: status.c:3
int xgr_drawTextClear(double x, double y, char *msg, int clr, int f)
int rows
Definition: otf.h:170
int cols
Definition: otf.h:169
int xgr_pixmapToWindow(char *name)
Definition: xgr.c:530
#define ROW3
Definition: status.c:6
struct OTF_STRUCT otf
Definition: specdata.c:100
int doStatWinReSize()
Definition: status.c:79
#define XGR_SET_WIN
Definition: xgr.h:25
#define ORANGE
Definition: colors.h:15
int xgr_mapUnmapWindow(char *name, int map)
Definition: xgr.c:568
int doStatus()
Definition: status.c:15
int xgr_clearScreen(void)
Definition: xgr.c:921
int xgr_setCurWindow(int win, int which)
Definition: xgr.c:483