-
Notifications
You must be signed in to change notification settings - Fork 1
/
ncplot.c
115 lines (77 loc) · 2.84 KB
/
ncplot.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
/*
-------------------------------------------------------------------------
OBJECT NAME: ncplot.c
FULL NAME: NetCDF plot.
TYPE: X11/R5 Motif 1.2 application
DESCRIPTION: http://www.eol.ucar.edu/raf/Software/ncplot.html
INPUT: Command line options
AUTHOR: cjw@ucar.edu
COPYRIGHT: University Corporation for Atmospheric Research, 1992-2005
-------------------------------------------------------------------------
*/
#include "define.h"
#include "fbr.h"
#define APP_CLASS "XmNCplot"
Widget AppShell;
Widget MainShell, MainWindow = NULL;
Widget ControlShell, ControlWindow = NULL;
Widget SpecShell, SpectrumWindow = NULL;
Widget ExpShell, ExpWindow = NULL;
Widget DiffShell, DifferenceWindow = NULL;
Widget CreateMainWindow(Widget parent);
void CreateControlWindow(Widget parent);
static XtResource resources[] = {
{XtNfont24, XtCFont24, XtRString, sizeof(char *),
XtOffsetOf(instanceRec, font24), XtRString, NULL},
{XtNfont18, XtCFont18, XtRString, sizeof(char *),
XtOffsetOf(instanceRec, font18), XtRString, NULL},
{XtNfont14, XtCFont14, XtRString, sizeof(char *),
XtOffsetOf(instanceRec, font14), XtRString, NULL},
{XtNfont12, XtCFont12, XtRString, sizeof(char *),
XtOffsetOf(instanceRec, font12), XtRString, NULL},
{XtNfont10, XtCFont10, XtRString, sizeof(char *),
XtOffsetOf(instanceRec, font10), XtRString, NULL},
};
XtAppContext appContext;
void UpdateDataRT(XtPointer client, XtIntervalId *id);
/* --------------------------------------------------------------------- */
int main(int argc, char *argv[])
{
int n;
Arg args[6];
Initialize();
ProcessArgs(argv);
ReadConfigFile();
AutoScale();
if (!Interactive)
PrintPS((Widget)NULL, (XtPointer)NULL, (XtPointer)NULL);
else
{
AppShell = XtAppInitialize(&appContext, APP_CLASS, NULL, 0, &argc, argv,
fallback_resources, NULL, 0);
XtGetApplicationResources(AppShell, (caddr_t) &iv, resources,
XtNumber(resources), NULL, 0);
n = 0;
MainShell = XtCreatePopupShell("topLevelShell",
topLevelShellWidgetClass, AppShell, args, n);
MainWindow = CreateMainWindow(MainShell);
n = 0;
ControlShell = XtCreatePopupShell("controlShell",
topLevelShellWidgetClass, AppShell, args, n);
CreateControlWindow(ControlShell);
CreateErrorBox(AppShell);
CreateQueryBox(AppShell);
CreateWarningBox(AppShell);
CreateFileSelectionBox(AppShell);
if (NumberDataFiles > 0)
NewDataFile((Widget)NULL, (XtPointer)NULL, (XtPointer)NULL);
OpenControlWindow(NULL, NULL, NULL);
XtManageChild(MainWindow);
XtPopup(XtParent(MainWindow), XtGrabNone);
if (RealTime)
XtAppAddTimeOut(appContext, 1000, UpdateDataRT, NULL);
XtAppMainLoop(appContext);
}
return(0);
} /* END MAIN */
/* END NCPLOT.C */