-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpage.c
96 lines (70 loc) · 1.96 KB
/
page.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
/*
-------------------------------------------------------------------------
OBJECT NAME: page.c
FULL NAME: Command CallBacks
ENTRY POINTS: PageForward()
PageBackward()
STATIC FNS: none
DESCRIPTION:
COPYRIGHT: University Corporation for Atmospheric Research, 1996-2022
-------------------------------------------------------------------------
*/
#include "define.h"
void UTStoHHMMSS(int time[]);
static int EOFreached = False, SavedNumberSeconds;
/* -------------------------------------------------------------------- */
void PageForward(Widget w, XtPointer client, XtPointer call)
{
if (UserEndTime[3] >= MaxEndTime[3])
return;
UserStartTime[3] = UserEndTime[3];
UserEndTime[3] += NumberSeconds;
if (UserEndTime[3] > MaxEndTime[3])
{
EOFreached = True;
SavedNumberSeconds = NumberSeconds;
UserEndTime[3] = MaxEndTime[3];
}
else
EOFreached = False;
UTStoHHMMSS(UserStartTime);
UTStoHHMMSS(UserEndTime);
SetTimeText();
ReadData();
DrawMainWindow();
} /* END PAGEFORWARD */
/* -------------------------------------------------------------------- */
void PageBackward(Widget w, XtPointer client, XtPointer call)
{
if (UserStartTime[3] <= MinStartTime[3])
return;
if (EOFreached)
{
EOFreached = False;
NumberSeconds = SavedNumberSeconds;
}
UserEndTime[3] = UserStartTime[3];
UserStartTime[3] -= NumberSeconds;
if (UserStartTime[3] < MinStartTime[3])
{
UserStartTime[3] = MinStartTime[3];
UserEndTime[3] = UserStartTime[3] + NumberSeconds;
}
UTStoHHMMSS(UserStartTime);
UTStoHHMMSS(UserEndTime);
SetTimeText();
ReadData();
DrawMainWindow();
} /* END PAGEBACKWARD */
/* -------------------------------------------------------------------- */
void UTStoHHMMSS(int time[])
{
int t = time[3];
time[0] = t / 3600; t -= time[0] * 3600;
time[1] = t / 60; t -= time[1] * 60;
time[2] = t;
/* if (time[0] >= 24)
time[0] -= 24;
*/
} /* END HHMMSSTOUTS */
/* END PAGE.C */