Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
07d9763a
Commit
07d9763a
authored
Feb 17, 2005
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Alarm blocking implemented
parent
ce6ab3f9
Changes
6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
712 additions
and
74 deletions
+712
-74
xtt/exe/rt_xtt/src/rt_xtt.cpp
xtt/exe/rt_xtt/src/rt_xtt.cpp
+4
-3
xtt/lib/xtt/src/xtt_block.cpp
xtt/lib/xtt/src/xtt_block.cpp
+260
-0
xtt/lib/xtt/src/xtt_block.h
xtt/lib/xtt/src/xtt_block.h
+74
-0
xtt/lib/xtt/src/xtt_c_object.cpp
xtt/lib/xtt/src/xtt_c_object.cpp
+98
-28
xtt/lib/xtt/src/xtt_evlist.cpp
xtt/lib/xtt/src/xtt_evlist.cpp
+265
-41
xtt/lib/xtt/src/xtt_evlist.h
xtt/lib/xtt/src/xtt_evlist.h
+11
-2
No files found.
xtt/exe/rt_xtt/src/rt_xtt.cpp
View file @
07d9763a
...
...
@@ -74,9 +74,10 @@ static XtActionsRec HotkeyActions[] = {
};
static
xnav_sStartMenu
alarm_menu
[]
=
{
{
"Alarm list"
,
xnav_eItemType_Command
,
menu_ePixmap_List
,
(
void
*
)
"show alarm"
},
{
"Event list"
,
xnav_eItemType_Command
,
menu_ePixmap_List
,
(
void
*
)
"show event"
},
{
"Historical list"
,
xnav_eItemType_Command
,
menu_ePixmap_List
,
(
void
*
)
"show hist"
},
{
"Alarm List"
,
xnav_eItemType_Command
,
menu_ePixmap_List
,
(
void
*
)
"show alarm"
},
{
"Event List"
,
xnav_eItemType_Command
,
menu_ePixmap_List
,
(
void
*
)
"show event"
},
{
"Blocked Alarms"
,
xnav_eItemType_Command
,
menu_ePixmap_List
,
(
void
*
)
"show block"
},
{
"Historical List"
,
xnav_eItemType_Command
,
menu_ePixmap_List
,
(
void
*
)
"show hist"
},
{
""
,
0
,
0
,
NULL
}};
static
xnav_sStartMenu
nethandler_menu
[]
=
{
{
"Link"
,
xnav_eItemType_Command
,
menu_ePixmap_Map
,
(
void
*
)
"show link"
},
...
...
xtt/lib/xtt/src/xtt_block.cpp
0 → 100644
View file @
07d9763a
/* xtt_bloc.cpp -- Alarm blocking window in xtt.
PROVIEW/R
Copyright (C) 1996 by Comator Process AB.
*/
#include "pwr_class.h"
#include "pwr_privilege.h"
#include "rt_gdh.h"
#include "rt_mh_outunit.h"
#include "co_cdh.h"
#include <Xm/Xm.h>
#include <Xm/XmP.h>
#include <Xm/Text.h>
#include <Mrm/MrmPublic.h>
#include <X11/Intrinsic.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <Xm/ToggleB.h>
#include "flow_x.h"
#include "xtt_block.h"
#include "co_lng.h"
#include "co_wow.h"
#include "co_msg.h"
int
Block
::
execute
()
{
mh_eEventPrio
prio
;
pwr_tStatus
sts
;
if
(
XmToggleButtonGetState
(
toggleA
))
prio
=
mh_eEventPrio_A
;
else
if
(
XmToggleButtonGetState
(
toggleB
))
prio
=
mh_eEventPrio_B
;
else
if
(
XmToggleButtonGetState
(
toggleC
))
prio
=
mh_eEventPrio_C
;
else
if
(
XmToggleButtonGetState
(
toggleD
))
prio
=
mh_eEventPrio_D
;
else
prio
=
(
mh_eEventPrio
)
0
;
sts
=
mh_OutunitBlock
(
oar
.
Objid
,
prio
);
if
(
EVEN
(
sts
))
{
char
msg
[
80
];
msg_GetMsg
(
sts
,
msg
,
sizeof
(
msg
));
wow_DisplayError
(
toplevel
,
"Block Error"
,
msg
);
}
return
sts
;
}
void
Block
::
update
()
{
pwr_tStatus
sts
;
mh_uEventInfo
block_level
;
sts
=
gdh_GetAlarmInfo
(
oar
.
Objid
,
NULL
,
NULL
,
(
pwr_tUInt32
*
)
&
block_level
,
NULL
,
NULL
);
switch
(
block_level
.
Event
.
Prio
)
{
case
mh_eEventPrio_A
:
XmToggleButtonSetState
(
toggleA
,
1
,
1
);
break
;
case
mh_eEventPrio_B
:
XmToggleButtonSetState
(
toggleB
,
1
,
1
);
break
;
case
mh_eEventPrio_C
:
XmToggleButtonSetState
(
toggleC
,
1
,
1
);
break
;
case
mh_eEventPrio_D
:
XmToggleButtonSetState
(
toggleD
,
1
,
1
);
break
;
case
0
:
XmToggleButtonSetState
(
toggleNo
,
1
,
1
);
break
;
default:
break
;
}
}
void
Block
::
create_ok
(
Widget
w
,
Block
*
blk
,
XmAnyCallbackStruct
*
data
)
{
blk
->
buttonOk
=
w
;
}
void
Block
::
create_apply
(
Widget
w
,
Block
*
blk
,
XmAnyCallbackStruct
*
data
)
{
blk
->
buttonApply
=
w
;
}
void
Block
::
create_toggleA
(
Widget
w
,
Block
*
blk
,
XmAnyCallbackStruct
*
data
)
{
blk
->
toggleA
=
w
;
}
void
Block
::
create_toggleB
(
Widget
w
,
Block
*
blk
,
XmAnyCallbackStruct
*
data
)
{
blk
->
toggleB
=
w
;
}
void
Block
::
create_toggleC
(
Widget
w
,
Block
*
blk
,
XmAnyCallbackStruct
*
data
)
{
blk
->
toggleC
=
w
;
}
void
Block
::
create_toggleD
(
Widget
w
,
Block
*
blk
,
XmAnyCallbackStruct
*
data
)
{
blk
->
toggleD
=
w
;
}
void
Block
::
create_toggleNo
(
Widget
w
,
Block
*
blk
,
XmAnyCallbackStruct
*
data
)
{
blk
->
toggleNo
=
w
;
}
void
Block
::
activate_apply
(
Widget
w
,
Block
*
blk
,
XmAnyCallbackStruct
*
data
)
{
blk
->
execute
();
}
void
Block
::
activate_ok
(
Widget
w
,
Block
*
blk
,
XmAnyCallbackStruct
*
data
)
{
pwr_tStatus
sts
;
sts
=
blk
->
execute
();
if
(
ODD
(
sts
))
delete
blk
;
}
void
Block
::
activate_cancel
(
Widget
w
,
Block
*
blk
,
XmAnyCallbackStruct
*
data
)
{
delete
blk
;
}
Block
::~
Block
()
{
XtDestroyWidget
(
parent_wid
);
}
Block
::
Block
(
void
*
b_parent_ctx
,
Widget
b_parent_wid
,
pwr_sAttrRef
*
b_oar
,
char
*
name
,
unsigned
int
priv
,
pwr_tStatus
*
sts
)
:
parent_ctx
(
b_parent_ctx
),
parent_wid
(
b_parent_wid
),
oar
(
*
b_oar
)
{
char
uid_filename
[
120
]
=
{
"xtt_block.uid"
};
char
*
uid_filename_p
=
uid_filename
;
Arg
args
[
20
];
int
msts
;
int
i
;
MrmHierarchy
s_DRMh
;
MrmType
dclass
;
char
title
[
200
];
pwr_tOName
aname
;
static
MrmRegisterArg
reglist
[]
=
{
{
"blk_ctx"
,
0
},
{
"blk_activate_cancel"
,(
caddr_t
)
activate_cancel
},
{
"blk_activate_ok"
,(
caddr_t
)
activate_ok
},
{
"blk_activate_apply"
,(
caddr_t
)
activate_apply
},
{
"blk_create_ok"
,(
caddr_t
)
create_ok
},
{
"blk_create_apply"
,(
caddr_t
)
create_apply
},
{
"blk_create_toggleA"
,(
caddr_t
)
create_toggleA
},
{
"blk_create_toggleB"
,(
caddr_t
)
create_toggleB
},
{
"blk_create_toggleC"
,(
caddr_t
)
create_toggleC
},
{
"blk_create_toggleD"
,(
caddr_t
)
create_toggleD
},
{
"blk_create_toggleNo"
,(
caddr_t
)
create_toggleNo
}
};
static
int
reglist_num
=
(
sizeof
reglist
/
sizeof
reglist
[
0
]);
*
sts
=
1
;
Lng
::
get_uid
(
uid_filename
,
uid_filename
);
*
sts
=
gdh_AttrrefToName
(
&
oar
,
aname
,
sizeof
(
aname
),
cdh_mNName
);
if
(
EVEN
(
*
sts
))
return
;
strcpy
(
title
,
name
);
strcat
(
title
,
" "
);
strcat
(
title
,
aname
);
reglist
[
0
].
value
=
(
caddr_t
)
this
;
// Motif
MrmInitialize
();
// Save the context structure in the widget
i
=
0
;
XtSetArg
(
args
[
i
],
XmNuserData
,
(
unsigned
int
)
this
);
i
++
;
XtSetArg
(
args
[
i
],
XmNdeleteResponse
,
XmDO_NOTHING
);
i
++
;
msts
=
MrmOpenHierarchy
(
1
,
&
uid_filename_p
,
NULL
,
&
s_DRMh
);
if
(
msts
!=
MrmSUCCESS
)
printf
(
"can't open %s
\n
"
,
uid_filename
);
MrmRegisterNames
(
reglist
,
reglist_num
);
parent_wid
=
XtCreatePopupShell
(
title
,
topLevelShellWidgetClass
,
parent_wid
,
args
,
i
);
msts
=
MrmFetchWidgetOverride
(
s_DRMh
,
"blk_window"
,
parent_wid
,
name
,
args
,
1
,
&
toplevel
,
&
dclass
);
if
(
msts
!=
MrmSUCCESS
)
printf
(
"can't fetch %s
\n
"
,
name
);
MrmCloseHierarchy
(
s_DRMh
);
i
=
0
;
XtSetArg
(
args
[
i
],
XmNwidth
,
500
);
i
++
;
XtSetArg
(
args
[
i
],
XmNheight
,
200
);
i
++
;
XtSetValues
(
toplevel
,
args
,
i
);
XtManageChild
(
toplevel
);
XtPopup
(
parent_wid
,
XtGrabNone
);
if
(
!
(
priv
&
pwr_mPrv_RtEvents
||
priv
&
pwr_mPrv_System
))
{
Arg
sensitive
[
1
];
// No access to block
// XtUnmanageChild( ok);
// XtUnmanageChild( apply);
XtSetArg
(
sensitive
[
0
],
XmNsensitive
,
0
);
XtSetValues
(
buttonOk
,
sensitive
,
1
);
XtSetValues
(
buttonApply
,
sensitive
,
1
);
XtSetValues
(
toggleA
,
sensitive
,
1
);
XtSetValues
(
toggleB
,
sensitive
,
1
);
XtSetValues
(
toggleC
,
sensitive
,
1
);
XtSetValues
(
toggleD
,
sensitive
,
1
);
XtSetValues
(
toggleNo
,
sensitive
,
1
);
}
update
();
// Connect the window manager close-button to exit
flow_AddCloseVMProtocolCb
(
parent_wid
,
(
XtCallbackProc
)
activate_cancel
,
this
);
}
xtt/lib/xtt/src/xtt_block.h
0 → 100644
View file @
07d9763a
#ifndef xtt_block_h
#define xtt_block_h
/* xtt_block.h -- Alarm blocking window
PROVIEW/R
Copyright (C) 1996 by Comator Process AB.
<Description>. */
#if defined __cplusplus
extern
"C"
{
#endif
#ifndef pwr_h
# include "pwr.h"
#endif
#if defined __cplusplus
}
#endif
class
Block
{
public:
Block
(
void
*
b_parent_ctx
,
Widget
b_parent_wid
,
pwr_sAttrRef
*
b_oar
,
char
*
name
,
unsigned
int
priv
,
pwr_tStatus
*
status
);
~
Block
();
int
execute
();
void
update
();
void
*
parent_ctx
;
Widget
parent_wid
;
Widget
toplevel
;
Widget
form
;
Widget
toggleA
;
Widget
toggleB
;
Widget
toggleC
;
Widget
toggleD
;
Widget
toggleNo
;
Widget
buttonOk
;
Widget
buttonApply
;
pwr_sAttrRef
oar
;
static
void
create_ok
(
Widget
w
,
Block
*
blk
,
XmAnyCallbackStruct
*
data
);
static
void
create_apply
(
Widget
w
,
Block
*
blk
,
XmAnyCallbackStruct
*
data
);
static
void
create_toggleA
(
Widget
w
,
Block
*
blk
,
XmAnyCallbackStruct
*
data
);
static
void
create_toggleB
(
Widget
w
,
Block
*
blk
,
XmAnyCallbackStruct
*
data
);
static
void
create_toggleC
(
Widget
w
,
Block
*
blk
,
XmAnyCallbackStruct
*
data
);
static
void
create_toggleD
(
Widget
w
,
Block
*
blk
,
XmAnyCallbackStruct
*
data
);
static
void
create_toggleNo
(
Widget
w
,
Block
*
blk
,
XmAnyCallbackStruct
*
data
);
static
void
activate_ok
(
Widget
w
,
Block
*
blk
,
XmAnyCallbackStruct
*
data
);
static
void
activate_cancel
(
Widget
w
,
Block
*
blk
,
XmAnyCallbackStruct
*
data
);
static
void
activate_apply
(
Widget
w
,
Block
*
blk
,
XmAnyCallbackStruct
*
data
);
};
#endif
xtt/lib/xtt/src/xtt_c_object.cpp
View file @
07d9763a
This diff is collapsed.
Click to expand it.
xtt/lib/xtt/src/xtt_evlist.cpp
View file @
07d9763a
This diff is collapsed.
Click to expand it.
xtt/lib/xtt/src/xtt_evlist.h
View file @
07d9763a
...
...
@@ -72,14 +72,17 @@ typedef struct {
typedef
enum
{
ev_eType_AlarmList
,
ev_eType_EventList
,
ev_eType_HistList
ev_eType_HistList
,
ev_eType_BlockList
}
ev_eType
;
typedef
enum
{
evlist_eEventType_Info
,
evlist_eEventType_Return
,
evlist_eEventType_Ack
,
evlist_eEventType_Alarm
evlist_eEventType_Alarm
,
evlist_eEventType_Block
,
evlist_eEventType_Cancel
}
evlist_eEventType
;
typedef
enum
{
...
...
@@ -107,6 +110,8 @@ class EvListBrow {
flow_sAnnotPixmap
*
pixmap_eventalarm
;
flow_sAnnotPixmap
*
pixmap_eventacked
;
flow_sAnnotPixmap
*
pixmap_eventreturn
;
flow_sAnnotPixmap
*
pixmap_blockr
;
flow_sAnnotPixmap
*
pixmap_blockl
;
void
free_pixmaps
();
void
allocate_pixmaps
();
...
...
@@ -145,12 +150,15 @@ class EvList {
void
event_info
(
mh_sMessage
*
msg
);
void
event_alarm
(
mh_sMessage
*
msg
);
void
event_block
(
mh_sBlock
*
msg
);
void
event_cancel
(
mh_sReturn
*
msg
);
void
event_ack
(
mh_sAck
*
msg
);
void
event_return
(
mh_sReturn
*
msg
);
void
event_clear_alarmlist
(
pwr_tNodeIndex
nix
);
int
get_last_not_acked
(
mh_sEventId
**
id
);
int
get_last_not_acked_beep
(
mh_sEventId
**
id
);
int
id_to_item
(
mh_sEventId
*
id
,
void
**
item
);
int
oid_to_item
(
pwr_tOid
oid
,
void
**
item
);
void
ack
(
mh_sEventId
*
id
);
void
set_input_focus
();
void
zoom
(
double
zoom_factor
);
...
...
@@ -168,6 +176,7 @@ class EvList {
int
get_last_not_acked_prio
(
mh_sEventId
**
id
,
unsigned
long
type
,
unsigned
long
prio
);
int
get_selected_event
(
char
*
eventname
);
int
get_destination
(
pwr_tTime
time
,
void
**
dest
);
void
block_remove
();
};
class
ItemAlarm
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment