-
Notifications
You must be signed in to change notification settings - Fork 1
/
showmask.c
652 lines (558 loc) · 21.1 KB
/
showmask.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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
/*************************************************************************\
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 Deutches Elektronen-Synchrotron in der Helmholtz-
* Gemelnschaft (DESY).
* Copyright (c) 2002 Berliner Speicherring-Gesellschaft fuer Synchrotron-
* Strahlung mbH (BESSY).
* Copyright (c) 2002 Southeastern Universities Research Association, as
* Operator of Thomas Jefferson National Accelerator Facility.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* This file is distributed subject to a Software License Agreement found
* in the file LICENSE that is included with this distribution.
\*************************************************************************/
/* showmask.c */
/************************DESCRIPTION***********************************
showmask.c: a popup dialog window
This file contains routines for creating force mask dialog.
**********************************************************************/
#include <stdlib.h>
#include <stdio.h>
/* If not MS Visual C++ or MS Visual C++ is 2010 or later */
#if !defined(_MSC_VER) || _MSC_VER >= 1600
#include <stdint.h>
#endif
#include <Xm/Xm.h>
#include <Xm/Form.h>
#include <Xm/Frame.h>
#include <Xm/LabelG.h>
#include <Xm/ToggleB.h>
#include <Xm/PanedW.h>
#include <Xm/Protocols.h>
#include <Xm/RowColumn.h>
#include <Xm/ToggleBG.h>
#include "axArea.h"
#include "alLib.h"
#include "alh.h"
#include "ax.h"
extern int _passive_flag;
struct forceMaskWindow {
void *area;
Widget menuButton;
Widget maskDialog;
Widget nameLabelW;
Widget nameTextW;
Widget currentMaskLabel;
Widget currentMaskStringLabelW;
Widget resetMaskStringLabelW;
Widget alarmMaskStringLabelW;
Widget alarmMaskToggleButtonW[ALARM_NMASK];
Widget maskFrameW;
};
/* forward declarations */
static void forceMaskApplyCallback(Widget widget,XtPointer calldata,XtPointer cbs);
static void forceMaskResetCallback(Widget widget,XtPointer calldata,XtPointer cbs);
static void forceMaskDismissCallback(Widget widget,XtPointer calldata,XtPointer cbs);
static void forceMaskHelpCallback(Widget widget,XtPointer calldata,XtPointer cbs);
static void forceMaskCreateDialog(ALINK*area);
static void forceMaskUpdateDialogWidgets(struct forceMaskWindow *forceMaskWindow);
static void forceMaskChangeCallback( Widget widget,XtPointer calldata,XtPointer cbs);
/******************************************************
forceMaskUpdateDialog
******************************************************/
void forceMaskUpdateDialog(area)
ALINK *area;
{
struct forceMaskWindow *forceMaskWindow;
if (!area->forceMaskWindow) return;
forceMaskWindow = (struct forceMaskWindow *)area->forceMaskWindow;
if (!forceMaskWindow->maskDialog || !XtIsManaged(forceMaskWindow->maskDialog)) return;
forceMaskUpdateDialogWidgets(forceMaskWindow);
}
/******************************************************
forceMaskShowDialog
******************************************************/
void forceMaskShowDialog(area, menuButton)
ALINK *area;
Widget menuButton;
{
struct forceMaskWindow *forceMaskWindow;
forceMaskWindow = (struct forceMaskWindow *)area->forceMaskWindow;
/* dismiss Dialog */
if (forceMaskWindow && forceMaskWindow->maskDialog &&
XtIsManaged(forceMaskWindow->maskDialog)) {
forceMaskDismissCallback(NULL, (XtPointer)forceMaskWindow, NULL);
return;
}
/* create forceMaskWindow and Dialog Widgets if necessary */
if (!forceMaskWindow) forceMaskCreateDialog(area);
/* update forceMaskWindow */
forceMaskWindow = (struct forceMaskWindow *)area->forceMaskWindow;
forceMaskWindow->menuButton = menuButton;
/* update Dialog Widgets */
forceMaskUpdateDialogWidgets(forceMaskWindow);
/* show Dialog */
if (!forceMaskWindow->maskDialog) return;
if (!XtIsManaged(forceMaskWindow->maskDialog)) {
XtManageChild(forceMaskWindow->maskDialog);
}
XMapWindow(XtDisplay(forceMaskWindow->maskDialog),
XtWindow(XtParent(forceMaskWindow->maskDialog)));
if (menuButton) XtVaSetValues(menuButton, XmNset, TRUE, NULL);
}
/******************************************************
forceMaskUpdateDialogWidgets
******************************************************/
static void forceMaskUpdateDialogWidgets(forceMaskWindow)
struct forceMaskWindow *forceMaskWindow;
{
struct gcData *pgcData;
GCLINK *link;
int linkType;
XmString string;
char buff[6];
if (! forceMaskWindow || !forceMaskWindow->maskDialog ) return;
link = (GCLINK *)getSelectionLinkArea(forceMaskWindow->area);
if (!link) {
string = XmStringCreateSimple("");
XtVaSetValues(forceMaskWindow->nameTextW,XmNlabelString, string, NULL);
XmStringFree(string);
string = XmStringCreateSimple("-----");
XtVaSetValues(forceMaskWindow->currentMaskStringLabelW, XmNlabelString, string, NULL);
XtVaSetValues(forceMaskWindow->resetMaskStringLabelW, XmNlabelString, string, NULL);
XtVaSetValues(forceMaskWindow->alarmMaskStringLabelW, XmNlabelString, string, NULL);
XmStringFree(string);
XmToggleButtonSetState(forceMaskWindow->alarmMaskToggleButtonW[0],FALSE,TRUE);
XmToggleButtonSetState(forceMaskWindow->alarmMaskToggleButtonW[1],FALSE,TRUE);
XmToggleButtonSetState(forceMaskWindow->alarmMaskToggleButtonW[2],FALSE,TRUE);
XmToggleButtonSetState(forceMaskWindow->alarmMaskToggleButtonW[3],FALSE,TRUE);
XmToggleButtonSetState(forceMaskWindow->alarmMaskToggleButtonW[4],FALSE,TRUE);
return;
}
linkType = getSelectionLinkTypeArea(forceMaskWindow->area);
pgcData = link->pgcData;
/* ---------------------------------
Group/Channel Name
--------------------------------- */
if (linkType == GROUP) string = XmStringCreateSimple("Group Name:");
else string = XmStringCreateSimple("Channel Name:");
XtVaSetValues(forceMaskWindow->nameLabelW, XmNlabelString, string, NULL);
XmStringFree(string);
if (pgcData->alias){
string = XmStringCreateSimple(pgcData->alias);
} else {
string = XmStringCreateSimple(pgcData->name);
}
XtVaSetValues(forceMaskWindow->nameTextW, XmNlabelString, string, NULL);
XmStringFree(string);
/* ---------------------------------
Current Mask
--------------------------------- */
if (linkType == GROUP) string = XmStringCreateSimple("Current Mask Summary:");
else string = XmStringCreateSimple("Current Mask:");
XtVaSetValues(forceMaskWindow->currentMaskLabel, XmNlabelString, string, NULL);
XmStringFree(string);
if (linkType == GROUP) awGetMaskString(((struct groupData *)pgcData)->mask,buff);
else alGetMaskString(((struct chanData *)pgcData)->curMask,buff);
string = XmStringCreateSimple(buff);
XtVaSetValues(forceMaskWindow->currentMaskStringLabelW, XmNlabelString, string, NULL);
/*
XtVaSetValues(forceMaskWindow->alarmMaskStringLabelW, XmNlabelString, string, NULL);
alSetMask(buff,&mask);
if (mask.Cancel == 1 )
XmToggleButtonSetState(forceMaskWindow->alarmMaskToggleButtonW[0],TRUE,TRUE);
else XmToggleButtonSetState(forceMaskWindow->alarmMaskToggleButtonW[0],FALSE,TRUE);
if (mask.Disable == 1 )
XmToggleButtonSetState(forceMaskWindow->alarmMaskToggleButtonW[1],TRUE,TRUE);
else XmToggleButtonSetState(forceMaskWindow->alarmMaskToggleButtonW[1],FALSE,TRUE);
if (mask.Ack == 1 )
XmToggleButtonSetState(forceMaskWindow->alarmMaskToggleButtonW[2],TRUE,TRUE);
else XmToggleButtonSetState(forceMaskWindow->alarmMaskToggleButtonW[2],FALSE,TRUE);
if (mask.AckT == 1 )
XmToggleButtonSetState(forceMaskWindow->alarmMaskToggleButtonW[3],TRUE,TRUE);
else XmToggleButtonSetState(forceMaskWindow->alarmMaskToggleButtonW[3],FALSE,TRUE);
if (mask.Log == 1 )
XmToggleButtonSetState(forceMaskWindow->alarmMaskToggleButtonW[4],TRUE,TRUE);
else XmToggleButtonSetState(forceMaskWindow->alarmMaskToggleButtonW[4],FALSE,TRUE);
*/
XmStringFree(string);
/* ---------------------------------
Reset Mask
--------------------------------- */
if (linkType == GROUP) string = XmStringCreateSimple(" ");
else {
alGetMaskString(((struct chanData *)pgcData)->defaultMask,buff);
string = XmStringCreateSimple(buff);
}
XtVaSetValues(forceMaskWindow->resetMaskStringLabelW, XmNlabelString, string, NULL);
XmStringFree(string);
}
/******************************************************
forceMaskCreateDialog
******************************************************/
static void forceMaskCreateDialog(area)
ALINK *area;
{
struct forceMaskWindow *forceMaskWindow;
Widget maskDialogShell, maskDialog;
Widget rowcol, form, maskFrameW;
Widget nameLabelW, nameTextW;
Widget alarmMaskToggleButtonW[ALARM_NMASK];
Widget alarmMaskLabel, alarmMaskStringLabelW;
Widget currentMaskLabel, currentMaskStringLabelW;
Widget resetMaskLabel, resetMaskStringLabelW;
int i;
intptr_t iptr;
XmString string;
static ActionAreaItem mask_items[] = {
{ "Apply", forceMaskApplyCallback, NULL },
{ "Reset", forceMaskResetCallback, NULL },
{ "Dismiss", forceMaskDismissCallback, NULL },
{ "Help", forceMaskHelpCallback, NULL },
};
static String maskFields[] = {
"Cancel Alarm",
"Disable Alarm",
"NoAck Alarm",
"NoAck Transient Alarm",
"NoLog Alarm"
};
if (!area) return;
forceMaskWindow = (struct forceMaskWindow *)area->forceMaskWindow;
if (forceMaskWindow && forceMaskWindow->maskDialog){
if (XtIsManaged(forceMaskWindow->maskDialog)) return;
else XtManageChild(forceMaskWindow->maskDialog);
}
forceMaskWindow = (struct forceMaskWindow *)calloc(1,sizeof(struct forceMaskWindow));
area->forceMaskWindow = (void *)forceMaskWindow;
forceMaskWindow->area = (void *)area;
maskDialogShell = XtVaCreatePopupShell("Force Mask",
transientShellWidgetClass, area->toplevel,
XmNallowShellResize, TRUE,
NULL);
/* Modify the window manager menu "close" callback */
{
Atom WM_DELETE_WINDOW;
XtVaSetValues(maskDialogShell,
XmNdeleteResponse, XmDO_NOTHING, NULL);
WM_DELETE_WINDOW = XmInternAtom(XtDisplay(maskDialogShell),
"WM_DELETE_WINDOW", False);
XmAddWMProtocolCallback(maskDialogShell,WM_DELETE_WINDOW,
(XtCallbackProc)forceMaskDismissCallback, (XtPointer)forceMaskWindow);
}
maskDialog = XtVaCreateWidget("maskDialog",
xmPanedWindowWidgetClass, maskDialogShell,
XmNallowResize, TRUE,
XmNsashWidth, 1,
XmNsashHeight, 1,
XmNuserData, area,
NULL);
form = XtVaCreateWidget("control_area",
xmFormWidgetClass, maskDialog,
XmNallowResize, TRUE,
NULL);
/* ---------------------------------
Group/Channel Name
--------------------------------- */
nameLabelW = XtVaCreateManagedWidget("nameLabelW",
xmLabelGadgetClass, form,
XmNalignment, XmALIGNMENT_END,
XmNtopAttachment, XmATTACH_FORM,
XmNrightAttachment, XmATTACH_POSITION,
XmNrightPosition, 50,
XmNrecomputeSize, True,
(XtPointer)NULL);
nameTextW = XtVaCreateManagedWidget("nameTextW",
xmLabelGadgetClass, form,
XmNalignment, XmALIGNMENT_BEGINNING,
XmNleftAttachment, XmATTACH_WIDGET,
XmNleftWidget, nameLabelW,
XmNrightAttachment, XmATTACH_NONE,
XmNrecomputeSize, True,
NULL);
/* ---------------------------------
Alarm Mask
--------------------------------- */
string = XmStringCreateSimple("Current Mask:");
currentMaskLabel = XtVaCreateManagedWidget("currentMaskLabel",
xmLabelGadgetClass, form,
XmNlabelString, string,
XmNalignment, XmALIGNMENT_END,
XmNtopAttachment, XmATTACH_WIDGET,
XmNtopWidget, nameTextW,
XmNtopOffset, 5,
XmNrightAttachment, XmATTACH_POSITION,
XmNrightPosition, 50,
NULL);
XmStringFree(string);
string = XmStringCreateSimple("-----");
currentMaskStringLabelW = XtVaCreateManagedWidget("currentMaskStringLabelW",
xmLabelGadgetClass, form,
XmNlabelString, string,
/*XmNbackground, 0,*/
XmNtopAttachment, XmATTACH_WIDGET,
XmNtopWidget, nameTextW,
XmNtopOffset, 5,
XmNleftAttachment, XmATTACH_WIDGET,
XmNleftWidget, currentMaskLabel,
NULL);
XmStringFree(string);
string = XmStringCreateSimple("Reset Mask:");
resetMaskLabel = XtVaCreateManagedWidget("resetMaskLabel",
xmLabelGadgetClass, form,
XmNlabelString, string,
XmNalignment, XmALIGNMENT_END,
XmNtopAttachment, XmATTACH_WIDGET,
XmNtopWidget, currentMaskLabel,
XmNtopOffset, 5,
XmNrightAttachment, XmATTACH_POSITION,
XmNrightPosition, 50,
NULL);
XmStringFree(string);
string = XmStringCreateSimple("-----");
resetMaskStringLabelW = XtVaCreateManagedWidget("resetMaskStringLabelW",
xmLabelGadgetClass, form,
XmNlabelString, string,
XmNtopAttachment, XmATTACH_WIDGET,
XmNtopWidget, currentMaskStringLabelW,
XmNtopOffset, 5,
XmNleftAttachment, XmATTACH_WIDGET,
XmNleftWidget, resetMaskLabel,
NULL);
XmStringFree(string);
string = XmStringCreateSimple("Mask:");
alarmMaskLabel = XtVaCreateManagedWidget("alarmMaskLabel",
xmLabelGadgetClass, form,
XmNlabelString, string,
XmNalignment, XmALIGNMENT_END,
XmNtopAttachment, XmATTACH_WIDGET,
XmNtopWidget, resetMaskLabel,
XmNtopOffset, 5,
XmNrightAttachment, XmATTACH_POSITION,
XmNrightPosition, 50,
NULL);
XmStringFree(string);
string = XmStringCreateSimple("-----");
alarmMaskStringLabelW = XtVaCreateManagedWidget("alarmMaskStringLabelW",
xmLabelGadgetClass, form,
XmNlabelString, string,
XmNtopAttachment, XmATTACH_WIDGET,
XmNtopWidget, resetMaskStringLabelW,
XmNtopOffset, 5,
XmNleftAttachment, XmATTACH_WIDGET,
XmNleftWidget, alarmMaskLabel,
NULL);
XmStringFree(string);
maskFrameW = XtVaCreateManagedWidget("maskFrameW",
xmFrameWidgetClass, form,
XmNtopAttachment, XmATTACH_WIDGET,
XmNtopWidget, alarmMaskStringLabelW,
XmNtopOffset, 5,
XmNleftAttachment, XmATTACH_POSITION,
XmNleftPosition, 25,
NULL);
rowcol = XtVaCreateWidget("rowcol",
xmRowColumnWidgetClass, maskFrameW,
XmNspacing, 0,
XmNmarginHeight, 0,
NULL);
for (i = 0; i < ALARM_NMASK; i++){
alarmMaskToggleButtonW[i] = XtVaCreateManagedWidget(maskFields[i],
xmToggleButtonGadgetClass, rowcol,
XmNmarginHeight, 0,
XmNuserData, (XtPointer)alarmMaskStringLabelW,
NULL);
if (_passive_flag && i == ALARMACKT ) {
XtVaSetValues(alarmMaskToggleButtonW[i], XmNsensitive, FALSE, NULL);
}
iptr=i;
XtAddCallback(alarmMaskToggleButtonW[i], XmNvalueChangedCallback,
(XtCallbackProc)forceMaskChangeCallback, (XtPointer)iptr);
}
XtManageChild(rowcol);
XtManageChild(form);
/* Set the client data "Apply", "Reset", "Dismiss", and "Help" button's callbacks. */
mask_items[0].data = (XtPointer)forceMaskWindow;
mask_items[1].data = (XtPointer)forceMaskWindow;
mask_items[2].data = (XtPointer)forceMaskWindow;
mask_items[3].data = (XtPointer)forceMaskWindow;
(void)createActionButtons(maskDialog, mask_items, XtNumber(mask_items));
XtManageChild(maskDialog);
forceMaskWindow->maskDialog = maskDialog;
forceMaskWindow->nameLabelW = nameLabelW;
forceMaskWindow->nameTextW = nameTextW;
forceMaskWindow->currentMaskLabel = currentMaskLabel;
forceMaskWindow->currentMaskStringLabelW = currentMaskStringLabelW;
forceMaskWindow->resetMaskStringLabelW = resetMaskStringLabelW;
forceMaskWindow->alarmMaskStringLabelW = alarmMaskStringLabelW;
forceMaskWindow->maskFrameW = maskFrameW;
for (i = 0; i < ALARM_NMASK; i++){
forceMaskWindow->alarmMaskToggleButtonW[i] = alarmMaskToggleButtonW[i];
}
XtRealizeWidget(maskDialogShell);
}
/******************************************************
forceMaskChangeCallback
******************************************************/
static void forceMaskChangeCallback(Widget widget,XtPointer calldata,XtPointer cbs)
{
long index=(long)calldata;
char *mask;
Widget maskWidget;
XmString string;
XtVaGetValues(widget, XmNuserData, &maskWidget, NULL);
XtVaGetValues(maskWidget, XmNlabelString, &string, NULL);
XmStringGetLtoR(string, XmFONTLIST_DEFAULT_TAG, &mask);
XmStringFree(string);
if (!XmToggleButtonGadgetGetState(widget)) {
mask[index] = '-';
}
else {
switch (index) {
case ALARMCANCEL:
mask[index] = 'C';
break;
case ALARMDISABLE:
mask[index] = 'D';
break;
case ALARMACK:
mask[index] = 'A';
break;
case ALARMACKT:
mask[index] = 'T';
break;
case ALARMLOG:
mask[index] = 'L';
break;
}
}
string = XmStringCreateSimple(mask);
XtVaSetValues(maskWidget, XmNlabelString, string, NULL);
XmStringFree(string);
XtFree(mask);
}
/******************************************************
forceMaskHelpCallback
******************************************************/
static void forceMaskHelpCallback(Widget widget,XtPointer calldata,XtPointer cbs)
{
char *message1 =
"Set the current mask for a group or channel.\n"
"Setting the mask for a group means setting the mask for all channels in the group.\n\n"
"Changing NoAck Transient Alarm is not allowed when executing in passive state.\n \n"
"Press the Apply button to force the mask on the selected channel or on\n"
" all channels in the selected group.\n"
;
char *message2 =
"Press the Reset button to reset channel mask(s) to their initial values.\n"
"Press the Dismiss button to close the Force Mask dialog window.\n"
"Press the Help button to get this help description window.\n";
;
createDialog(widget,XmDIALOG_INFORMATION, message1,message2);
}
/******************************************************
forceMaskApplyCallback
******************************************************/
static void forceMaskApplyCallback(Widget widget,XtPointer calldata,XtPointer cbs)
{
struct forceMaskWindow *forceMaskWindow=(struct forceMaskWindow *)calldata;
struct chanData *cdata;
XmString string;
char *buff;
struct gcData *pgcData;
GCLINK *link;
int linkType;
MASK mask;
link =getSelectionLinkArea(forceMaskWindow->area);
if (!link) return;
pgcData = link->pgcData;
linkType =getSelectionLinkTypeArea(forceMaskWindow->area);
/* ---------------------------------
Update alarm Mask
--------------------------------- */
XtVaGetValues(forceMaskWindow->alarmMaskStringLabelW, XmNlabelString, &string, NULL);
XmStringGetLtoR(string,XmFONTLIST_DEFAULT_TAG,&buff);
XmStringFree(string);
alSetMask(buff,&mask);
if (linkType == CHANNEL) {
alRemoveNoAck1HrTimerChan((CLINK *)link);
alChangeChanMask((CLINK *)link,mask);
alCaFlushIo();
alLogOpModMessage(CHANGE_MASK,(GCLINK*)link,
"OPER Channel Set Mask <%s> [%s]",
link->pgcData->name,
buff);
cdata = (struct chanData *)pgcData;
if (programId != ALH) cdata->defaultMask = cdata->curMask;
}
if (linkType == GROUP) {
alRemoveNoAck1HrTimerGroup((GLINK *)link);
alChangeGroupMask((GLINK *)link,mask);
alCaFlushIo();
alLogOpModMessage(CHANGE_MASK_GROUP,link,
"OPER Group Set Mask <%s> [%s]",
link->pgcData->name,
buff);
}
XtFree(buff);
silenceCurrentReset(forceMaskWindow->area);
link->pmainGroup->modified = 1;
/* ---------------------------------
Update all dialog Windows
--------------------------------- */
axUpdateDialogs(forceMaskWindow->area);
}
/******************************************************
forceMaskResetCallback
******************************************************/
static void forceMaskResetCallback(Widget widget,XtPointer calldata,XtPointer cbs)
{
struct forceMaskWindow *forceMaskWindow=(struct forceMaskWindow *)calldata;
struct chanData *cdata;
GCLINK *link;
int linkType;
char buff1[6];
link =getSelectionLinkArea(forceMaskWindow->area);
if (!link) return;
linkType =getSelectionLinkTypeArea(forceMaskWindow->area);
if (linkType == CHANNEL) {
cdata = (struct chanData *)link->pgcData;
alRemoveNoAck1HrTimerChan((CLINK *)link);
alChangeChanMask((CLINK *)link,cdata->defaultMask);
alCaFlushIo();
alGetMaskString(cdata->curMask,buff1);
alLogOpModMessage(CHANGE_MASK,(GCLINK*)link,
"OPER Channel Reset Mask <%s> [%s]",
cdata->name,
buff1);
if (programId != ALH) cdata->defaultMask = cdata->curMask;
}
if (linkType == GROUP) {
alRemoveNoAck1HrTimerGroup((GLINK *)link);
alResetGroupMask((GLINK *)link);
alCaFlushIo();
alLogOpModMessage(CHANGE_MASK_GROUP,link,
"OPER Group Reset Masks <%s>",
link->pgcData->name);
}
silenceCurrentReset(forceMaskWindow->area);
link->pmainGroup->modified = 1;
/* ---------------------------------
Update all dialog Windows
--------------------------------- */
axUpdateDialogs(forceMaskWindow->area);
}
/******************************************************
forceMaskDismissCallback
******************************************************/
static void forceMaskDismissCallback(Widget widget,XtPointer calldata,XtPointer cbs)
{
struct forceMaskWindow *forceMaskWindow=(struct forceMaskWindow *)calldata;
Widget maskDialog;
maskDialog = forceMaskWindow->maskDialog;
XtUnmanageChild(maskDialog);
XUnmapWindow(XtDisplay(maskDialog), XtWindow(XtParent(maskDialog)));
if (forceMaskWindow->menuButton)
XtVaSetValues(forceMaskWindow->menuButton, XmNset, FALSE, NULL);
}