Commit a302eef9 authored by Claes Sjofors's avatar Claes Sjofors

Xtt, commands and menu methods to set signal invert, conversion test and testvalue

parent f45d78f7
......@@ -75,3 +75,4 @@ noclassgraph <No classgraph found> /error
notauthorized <Not authorized for this operation> /error
novalidcurve <No valid curve found> /error
nosuchvolume <No such volume> /error
invalidobject <Invalid object for this operation> /error
......@@ -331,6 +331,49 @@ SObject pwrb:Class
EndObject
EndObject
Object RtXtt $RtMenu
Object Set $MenuCascade
Body SysBody
Attr ButtonName = "Set"
EndBody
Object Invert $MenuCascade
Body SysBody
Attr ButtonName = "Invert"
EndBody
Object On $MenuButton
Body SysBody
Attr ButtonName = "On"
Attr MethodName = "Di-InvertOn"
Attr FilterName = "Di-SetFilter"
EndBody
EndObject
Object Off $MenuButton
Body SysBody
Attr ButtonName = "Off"
Attr MethodName = "Di-InvertOff"
Attr FilterName = "Di-SetFilter"
EndBody
EndObject
EndObject
Object Conversion $MenuCascade
Body SysBody
Attr ButtonName = "Conversion"
EndBody
Object On $MenuButton
Body SysBody
Attr ButtonName = "On"
Attr MethodName = "Di-ConversionOn"
Attr FilterName = "Di-SetFilter"
EndBody
EndObject
Object Off $MenuButton
Body SysBody
Attr ButtonName = "Off"
Attr MethodName = "Di-ConversionOff"
Attr FilterName = "Di-SetFilter"
EndBody
EndObject
EndObject
EndObject
Object Channel $MenuRef
Body SysBody
Attr ButtonName = "Channel"
......
......@@ -287,6 +287,68 @@ SObject pwrb:Class
EndObject
EndObject
Object RtXtt $RtMenu
Object Set $MenuCascade
Body SysBody
Attr ButtonName = "Set"
EndBody
Object Invert $MenuCascade
Body SysBody
Attr ButtonName = "Invert"
EndBody
Object On $MenuButton
Body SysBody
Attr ButtonName = "On"
Attr MethodName = "Do-InvertOn"
Attr FilterName = "Do-SetFilter"
EndBody
EndObject
Object Off $MenuButton
Body SysBody
Attr ButtonName = "Off"
Attr MethodName = "Do-InvertOff"
Attr FilterName = "Do-SetFilter"
EndBody
EndObject
EndObject
Object Test $MenuCascade
Body SysBody
Attr ButtonName = "Test"
EndBody
Object On $MenuButton
Body SysBody
Attr ButtonName = "On"
Attr MethodName = "Do-TestOn"
Attr FilterName = "Do-SetFilter"
EndBody
EndObject
Object Off $MenuButton
Body SysBody
Attr ButtonName = "Off"
Attr MethodName = "Do-TestOff"
Attr FilterName = "Do-SetFilter"
EndBody
EndObject
EndObject
Object TestValue $MenuCascade
Body SysBody
Attr ButtonName = "TestValue"
EndBody
Object True $MenuButton
Body SysBody
Attr ButtonName = "True"
Attr MethodName = "Do-TestValueTrue"
Attr FilterName = "Do-SetFilter"
EndBody
EndObject
Object False $MenuButton
Body SysBody
Attr ButtonName = "False"
Attr MethodName = "Do-TestValueFalse"
Attr FilterName = "Do-SetFilter"
EndBody
EndObject
EndObject
EndObject
Object Channel $MenuRef
Body SysBody
Attr ButtonName = "Channel"
......
......@@ -325,6 +325,7 @@ static int graph_object_dx( Graph *graph, pwr_sAttrRef *arp)
switch ( card_cid) {
case pwr_cClass_Ssab_DI32D: {
pwr_tAName card_name;
unsigned int chan_idx = (chanaref.Offset - pwr_AlignLW(sizeof(pwr_sClass_Ssab_BaseDiCard))) / pwr_AlignLW(sizeof(pwr_sClass_ChanDi));
sts = gdh_ObjidToName( chanaref.Objid, card_name, sizeof(card_name), cdh_mNName);
......@@ -1046,4 +1047,4 @@ static int graph_object_PlcThread( Graph *graph, pwr_sAttrRef *arp)
graph->graph_object_scan = graph_object_PlcThread_scan;
return 1;
}
\ No newline at end of file
}
......@@ -458,43 +458,76 @@ GtkWidget *XNavGtk::build_menu( GtkWidget *Parent,
Level = Items[*idx].Level;
for (; Items[*idx].Level != 0 && Items[*idx].Level >= Level; (*idx)++) {
if (Items[*idx].Item == xmenu_eMenuItem_Cascade ||
Items[*idx].Item == xmenu_eMenuItem_Ref) {
switch ( Items[*idx].Item) {
case xmenu_eMenuItem_Ref: {
if (MenuType == MENU_OPTION) {
printf("You can't have submenus from option menu items.");
return NULL;
}
else {
i = *idx;
i = *idx;
GtkWidget *sub = gtk_menu_item_new_with_label( CoWowGtk::translate_utf8(Items[*idx].Name));
(*idx)++;
W = build_menu(Menu, MENU_PULLDOWN,
Lng::translate( Items[i].Name), MenuUserData,
Callback, CallbackData, Items, idx);
(*idx)--;
gtk_menu_item_set_submenu(GTK_MENU_ITEM(sub), GTK_WIDGET(W));
gtk_menu_shell_append(GTK_MENU_SHELL(Menu), sub);
gtk_widget_show(sub);
break;
}
case xmenu_eMenuItem_Cascade: {
if (MenuType == MENU_OPTION) {
printf("You can't have submenus from option menu items.");
return NULL;
}
// Check that the Cascade contains any pushbuttons
int found = 0;
unsigned int cascade_level = Items[*idx].Level;
int cidx;
for ( cidx = *idx + 1; Items[cidx].Level != 0 && Items[cidx].Level > cascade_level; cidx++) {
if ( Items[cidx].Item == xmenu_eMenuItem_Ref || Items[cidx].Item == xmenu_eMenuItem_Button) {
found = 1;
break;
}
}
if ( found) {
i = *idx;
GtkWidget *sub = gtk_menu_item_new_with_label( CoWowGtk::translate_utf8(Items[*idx].Name));
(*idx)++;
W = build_menu(Menu, MENU_PULLDOWN,
(*idx)++;
W = build_menu(Menu, MENU_PULLDOWN,
Lng::translate( Items[i].Name), MenuUserData,
Callback, CallbackData, Items, idx);
(*idx)--;
(*idx)--;
gtk_menu_item_set_submenu(GTK_MENU_ITEM(sub), GTK_WIDGET(W));
gtk_menu_shell_append(GTK_MENU_SHELL(Menu), sub);
gtk_widget_show(sub);
}
}
else {
if (Items[*idx].Item == xmenu_eMenuItem_Separator) {
// Separator
W = gtk_separator_menu_item_new();
gtk_menu_shell_append(GTK_MENU_SHELL(Menu), W);
gtk_widget_show(W);
}
else {
// Pushbutton
W = gtk_menu_item_new_with_label( CoWowGtk::translate_utf8(Items[*idx].Name));
gtk_widget_set_sensitive( W, Items[*idx].Flags.f.Sensitive ? TRUE : FALSE);
g_object_set_data( (GObject *)W, "userdata", (gpointer)((long int)*idx));
if ( Callback)
g_signal_connect( W, "activate",
G_CALLBACK(Callback), CallbackData);
gtk_menu_shell_append(GTK_MENU_SHELL(Menu), W);
gtk_widget_show(W);
}
*idx = cidx - 1;
}
break;
}
case xmenu_eMenuItem_Separator:
// Separator
W = gtk_separator_menu_item_new();
gtk_menu_shell_append(GTK_MENU_SHELL(Menu), W);
gtk_widget_show(W);
break;
case xmenu_eMenuItem_Button:
// Pushbutton
W = gtk_menu_item_new_with_label( CoWowGtk::translate_utf8(Items[*idx].Name));
gtk_widget_set_sensitive( W, Items[*idx].Flags.f.Sensitive ? TRUE : FALSE);
g_object_set_data( (GObject *)W, "userdata", (gpointer)((long int)*idx));
if ( Callback)
g_signal_connect( W, "activate",
G_CALLBACK(Callback), CallbackData);
gtk_menu_shell_append(GTK_MENU_SHELL(Menu), W);
gtk_widget_show(W);
break;
default: ;
}
}
......@@ -545,4 +578,4 @@ int XNavGtk::confirm_dialog( char *title, char *text)
return 0;
}
return 0;
}
\ No newline at end of file
}
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2017 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
/* wb_c_di.cpp -- xtt methods of the Di class. */
#include "pwr_baseclasses.h"
#include "co_cdh.h"
#include "flow_std.h"
#include "xtt_menu.h"
#include "xtt_xnav.h"
#include "rt_xnav_msg.h"
#include "pwr_privilege.h"
static pwr_tStatus SetFilter( xmenu_sMenuCall *ip)
{
if ( !((XNav *)ip->EditorContext)->is_authorized( pwr_mAccess_System, 0))
return XNAV__INVISIBLE;
return XNAV__SUCCESS;
}
// Conversion
static pwr_tStatus ConversionOn( xmenu_sMenuCall *ip)
{
pwr_tAName name;
pwr_tStatus sts;
pwr_tCmd cmd;
sts = gdh_AttrrefToName( &ip->Pointed, name, sizeof(name), cdh_mNName);
if ( EVEN(sts)) return sts;
snprintf( cmd, sizeof(cmd), "set sig conv/on/name=%s", name);
((XNav *)ip->EditorContext)->command( cmd);
((XNav *)ip->EditorContext)->refresh();
return 1;
}
static pwr_tStatus ConversionOff( xmenu_sMenuCall *ip)
{
pwr_tAName name;
pwr_tStatus sts;
pwr_tCmd cmd;
sts = gdh_AttrrefToName( &ip->Pointed, name, sizeof(name), cdh_mNName);
if ( EVEN(sts)) return sts;
snprintf( cmd, sizeof(cmd), "set sig conv/off/name=%s", name);
((XNav *)ip->EditorContext)->command( cmd);
((XNav *)ip->EditorContext)->refresh();
return 1;
}
static pwr_tStatus InvertOn( xmenu_sMenuCall *ip)
{
pwr_tAName name;
pwr_tStatus sts;
pwr_tCmd cmd;
sts = gdh_AttrrefToName( &ip->Pointed, name, sizeof(name), cdh_mNName);
if ( EVEN(sts)) return sts;
snprintf( cmd, sizeof(cmd), "set sig inv/on/name=%s", name);
((XNav *)ip->EditorContext)->command( cmd);
((XNav *)ip->EditorContext)->refresh();
return 1;
}
static pwr_tStatus InvertOff( xmenu_sMenuCall *ip)
{
pwr_tAName name;
pwr_tStatus sts;
pwr_tCmd cmd;
sts = gdh_AttrrefToName( &ip->Pointed, name, sizeof(name), cdh_mNName);
if ( EVEN(sts)) return sts;
snprintf( cmd, sizeof(cmd), "set sig inv/off/name=%s", name);
((XNav *)ip->EditorContext)->command( cmd);
((XNav *)ip->EditorContext)->refresh();
return 1;
}
/*----------------------------------------------------------------------------*\
Every method to be exported to xtt should be registred here.
\*----------------------------------------------------------------------------*/
pwr_dExport pwr_BindXttMethods(Di) = {
pwr_BindXttMethod(InvertOn),
pwr_BindXttMethod(InvertOff),
pwr_BindXttMethod(ConversionOn),
pwr_BindXttMethod(ConversionOff),
pwr_BindXttMethod(SetFilter),
pwr_NullMethod
};
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2017 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
/* wb_c_do.cpp -- xtt methods of the Do class. */
#include "pwr_baseclasses.h"
#include "co_cdh.h"
#include "flow_std.h"
#include "xtt_menu.h"
#include "xtt_xnav.h"
#include "rt_xnav_msg.h"
#include "pwr_privilege.h"
static pwr_tStatus SetFilter( xmenu_sMenuCall *ip)
{
if ( !((XNav *)ip->EditorContext)->is_authorized( pwr_mAccess_System, 0))
return XNAV__INVISIBLE;
return XNAV__SUCCESS;
}
static pwr_tStatus InvertOn( xmenu_sMenuCall *ip)
{
pwr_tAName name;
pwr_tStatus sts;
pwr_tCmd cmd;
sts = gdh_AttrrefToName( &ip->Pointed, name, sizeof(name), cdh_mNName);
if ( EVEN(sts)) return sts;
snprintf( cmd, sizeof(cmd), "set sig inv/on/name=%s", name);
((XNav *)ip->EditorContext)->command( cmd);
((XNav *)ip->EditorContext)->refresh();
return 1;
}
static pwr_tStatus InvertOff( xmenu_sMenuCall *ip)
{
pwr_tAName name;
pwr_tStatus sts;
pwr_tCmd cmd;
sts = gdh_AttrrefToName( &ip->Pointed, name, sizeof(name), cdh_mNName);
if ( EVEN(sts)) return sts;
snprintf( cmd, sizeof(cmd), "set sig inv/off/name=%s", name);
((XNav *)ip->EditorContext)->command( cmd);
((XNav *)ip->EditorContext)->refresh();
return 1;
}
// Test
static pwr_tStatus TestOn( xmenu_sMenuCall *ip)
{
pwr_tAName name;
pwr_tStatus sts;
pwr_tCmd cmd;
sts = gdh_AttrrefToName( &ip->Pointed, name, sizeof(name), cdh_mNName);
if ( EVEN(sts)) return sts;
snprintf( cmd, sizeof(cmd), "set sig test/on/name=%s", name);
((XNav *)ip->EditorContext)->command( cmd);
((XNav *)ip->EditorContext)->refresh();
return 1;
}
static pwr_tStatus TestOff( xmenu_sMenuCall *ip)
{
pwr_tAName name;
pwr_tStatus sts;
pwr_tCmd cmd;
sts = gdh_AttrrefToName( &ip->Pointed, name, sizeof(name), cdh_mNName);
if ( EVEN(sts)) return sts;
snprintf( cmd, sizeof(cmd), "set sig test/off/name=%s", name);
((XNav *)ip->EditorContext)->command( cmd);
((XNav *)ip->EditorContext)->refresh();
return 1;
}
// Testvalue
static pwr_tStatus TestValueTrue( xmenu_sMenuCall *ip)
{
pwr_tAName name;
pwr_tStatus sts;
pwr_tCmd cmd;
sts = gdh_AttrrefToName( &ip->Pointed, name, sizeof(name), cdh_mNName);
if ( EVEN(sts)) return sts;
snprintf( cmd, sizeof(cmd), "set sig testvalue/on/name=%s", name);
((XNav *)ip->EditorContext)->command( cmd);
((XNav *)ip->EditorContext)->refresh();
return 1;
}
static pwr_tStatus TestValueFalse( xmenu_sMenuCall *ip)
{
pwr_tAName name;
pwr_tStatus sts;
pwr_tCmd cmd;
sts = gdh_AttrrefToName( &ip->Pointed, name, sizeof(name), cdh_mNName);
if ( EVEN(sts)) return sts;
snprintf( cmd, sizeof(cmd), "set sig testvalue/off/name=%s", name);
((XNav *)ip->EditorContext)->command( cmd);
((XNav *)ip->EditorContext)->refresh();
return 1;
}
/*----------------------------------------------------------------------------*\
Every method to be exported to xtt should be registred here.
\*----------------------------------------------------------------------------*/
pwr_dExport pwr_BindXttMethods(Do) = {
pwr_BindXttMethod(InvertOn),
pwr_BindXttMethod(InvertOff),
pwr_BindXttMethod(TestOn),
pwr_BindXttMethod(TestOff),
pwr_BindXttMethod(TestValueTrue),
pwr_BindXttMethod(TestValueFalse),
pwr_BindXttMethod(SetFilter),
pwr_NullMethod
};
......@@ -22,13 +22,12 @@
typedef struct {
pwr_tString80 Description pwr_dAlignLW;
pwr_tString40 DevName pwr_dAlignW;
pwr_tUInt32 ErrorCount pwr_dAlignW;
pwr_tUInt32 ErrorSoftLimit pwr_dAlignW;
pwr_tUInt32 ErrorHardLimit pwr_dAlignW;
pwr_tUInt16 MaxNoOfChannels pwr_dAlignW;
pwr_tUInt32 RegAddress pwr_dAlignW;
pwr_tUInt32 VectAddress pwr_dAlignW;
pwr_tUInt32 SwitchSettings pwr_dAlignW;
pwr_tIoProcessMask Process pwr_dAlignW;
pwr_tObjid ThreadObject pwr_dAlignW;
pwr_tURL DataSheet pwr_dAlignW;
......@@ -46,13 +45,12 @@ typedef struct {
typedef struct {
pwr_tString80 Description pwr_dAlignLW;
pwr_tString40 DevName pwr_dAlignW;
pwr_tUInt32 ErrorCount pwr_dAlignW;
pwr_tUInt32 ErrorSoftLimit pwr_dAlignW;
pwr_tUInt32 ErrorHardLimit pwr_dAlignW;
pwr_tUInt16 MaxNoOfChannels pwr_dAlignW;
pwr_tUInt32 RegAddress pwr_dAlignW;
pwr_tUInt32 VectAddress pwr_dAlignW;
pwr_tUInt32 SwitchSettings pwr_dAlignW;
pwr_tIoProcessMask Process pwr_dAlignW;
pwr_tObjid ThreadObject pwr_dAlignW;
pwr_tURL DataSheet pwr_dAlignW;
......@@ -73,7 +71,6 @@ typedef struct {
typedef struct {
pwr_tString80 Description pwr_dAlignLW;
pwr_tString40 DevName pwr_dAlignW;
pwr_tUInt32 ErrorCount pwr_dAlignW;
pwr_tUInt32 ErrorSoftLimit pwr_dAlignW;
pwr_tUInt32 ErrorHardLimit pwr_dAlignW;
......@@ -91,7 +88,7 @@ typedef struct {
pwr_tBoolean SpeedMeasurement[4] pwr_dAlignW;
pwr_tUInt32 SyncRawValue[4] pwr_dAlignW;
pwr_tUInt32 RegAddress pwr_dAlignW;
pwr_tUInt32 VectAddress pwr_dAlignW;
pwr_tUInt32 SwitchSettings pwr_dAlignW;
pwr_tIoProcessMask Process pwr_dAlignW;
pwr_tObjid ThreadObject pwr_dAlignW;
pwr_tURL DataSheet pwr_dAlignW;
......@@ -103,4 +100,4 @@ typedef struct {
#endif
#endif
\ No newline at end of file
#endif
......@@ -4402,4 +4402,184 @@ void XNav::autoack_scan( void *data)
xnav->ev->ack_all();
xnav->autoack_timerid->add( time, autoack_scan, xnav);
}
\ No newline at end of file
}
void XNav::refresh()
{
pwr_tObjid open_objid[100];
int open_cnt;
brow_tObject *object_list;
int object_cnt;
Item *object_item;
int i, j;
int open_type[100];
char open_attr[100][80];
int open;
int found;
brow_tNode *node_list;
int sel_node_count;
Item *item_sel;
pwr_tObjid *sel_objid;
int *sel_type;
char *sel_attr;
// Store all open objects
open_cnt = 0;
brow_GetObjectList( brow->ctx, &object_list, &object_cnt);
for ( i = 0; i < object_cnt; i++) {
if ( (open = brow_IsOpen( object_list[i]))) {
brow_GetUserData( object_list[i], (void **)&object_item);
open_objid[open_cnt] = object_item->objid;
open_type[open_cnt] = open;
switch( object_item->type) {
case xnav_eItemType_AttrArray:
strcpy( open_attr[open_cnt], object_item->name);
break;
case xnav_eItemType_Attr:
strcpy( open_attr[open_cnt], object_item->name);
break;
case xnav_eItemType_AttrArrayElem:
strcpy( open_attr[open_cnt], object_item->name);
break;
case xnav_eItemType_AttrObject:
strcpy( open_attr[open_cnt], object_item->name);
break;
default:
;
}
open_type[open_cnt] = open;
open_cnt++;
if ( open_cnt == 100)
break;
}
}
// Store selected object
brow_GetSelectedNodes( brow->ctx, &node_list, &sel_node_count);
if ( sel_node_count > 0) {
sel_objid = (pwr_tObjid *)calloc( sel_node_count, sizeof( pwr_tObjid));
sel_type = (int *)calloc( sel_node_count, sizeof( int));
sel_attr = (char *)calloc( sel_node_count, 80);
for ( i = 0; i < sel_node_count; i++) {
brow_GetUserData( node_list[i], (void **)&item_sel);
sel_objid[i] = item_sel->objid;
sel_type[i] = item_sel->type;
switch( item_sel->type) {
case xnav_eItemType_Attr:
case xnav_eItemType_AttrArray:
case xnav_eItemType_AttrObject:
case xnav_eItemType_AttrArrayElem:
case xnav_eItemType_Enum:
case xnav_eItemType_Mask:
strcpy( &sel_attr[i * 80], item_sel->name);
break;
default:
;
}
}
free( node_list);
}
brow_SetNodraw( brow->ctx);
brow_DeleteAll( brow->ctx);
show_database( 1);
// Open all previously open objects
for ( i = 0; i < open_cnt; i++) {
brow_GetObjectList( brow->ctx, &object_list, &object_cnt);
found = 0;
for ( j = object_cnt - 1; j >= 0; j--) {
brow_GetUserData( object_list[j], (void **)&object_item);
switch( object_item->type) {
case xnav_eItemType_Object:
if ( cdh_ObjidIsEqual( open_objid[i], object_item->objid)) {
if ( open_type[i] & xnav_mOpen_Children)
((ItemObject *)object_item)->open_children( brow, 0, 0);
else if ( open_type[i] & xnav_mOpen_Attributes)
((ItemObject *)object_item)->open_attributes( brow, 0, 0);
found = 1;
}
break;
case xnav_eItemType_AttrArray:
if ( cdh_ObjidIsEqual( open_objid[i], object_item->objid) &&
strcmp( object_item->name, open_attr[i]) == 0) {
if ( open_type[i] & xnav_mOpen_Attributes)
((ItemAttrArray *)object_item)->open_attributes( brow, 0, 0);
found = 1;
}
break;
case xnav_eItemType_Attr:
if ( cdh_ObjidIsEqual( open_objid[i], object_item->objid) &&
strcmp( object_item->name, open_attr[i]) == 0) {
if ( open_type[i] & xnav_mOpen_Children)
((ItemAttr *)object_item)->open_children( brow, 0, 0);
found = 1;
}
break;
case xnav_eItemType_AttrArrayElem:
if ( cdh_ObjidIsEqual( open_objid[i], object_item->objid) &&
strcmp( object_item->name, open_attr[i]) == 0) {
if ( open_type[i] & xnav_mOpen_Children)
((ItemAttrArrayElem *)object_item)->open_children( brow, 0, 0);
found = 1;
}
break;
case xnav_eItemType_AttrObject:
if ( cdh_ObjidIsEqual( open_objid[i], object_item->objid) &&
strcmp( object_item->name, open_attr[i]) == 0) {
if ( open_type[i] & xnav_mOpen_Attributes)
((ItemAttrObject *)object_item)->open_attributes( brow, 0, 0);
found = 1;
}
break;
default:
;
}
if ( found)
break;
}
}
// Select previously selected
if ( sel_node_count > 0) {
brow_GetObjectList( brow->ctx, &object_list, &object_cnt);
for ( i = 0; i < sel_node_count; i++) {
for ( j = object_cnt - 1; j >= 0; j--) {
brow_GetUserData( object_list[j], (void **)&object_item);
found = 0;
if ( cdh_ObjidIsEqual( sel_objid[i], object_item->objid) &&
sel_type[i] == object_item->type) {
switch( object_item->type) {
case xnav_eItemType_Attr:
case xnav_eItemType_AttrArray:
case xnav_eItemType_AttrObject:
case xnav_eItemType_AttrArrayElem:
case xnav_eItemType_Enum:
case xnav_eItemType_Mask:
if ( strcmp( &sel_attr[i*80], object_item->name) == 0)
found = 1;
break;
default:
found = 1;
}
}
if ( found) {
brow_SetInverse( object_item->node, 1);
brow_SelectInsert( brow->ctx, object_item->node);
break;
}
}
}
free( (char *)sel_objid);
free( (char *)sel_type);
free( (char *)sel_attr);
}
brow_ResetNodraw( brow->ctx);
brow_Redraw( brow->ctx, 0);
}
......@@ -232,6 +232,13 @@ typedef enum {
ge_mOptions_Dialog = 1 << 9
} ge_mOptions;
typedef enum {
xnav_eSetSignal_Conversion,
xnav_eSetSignal_Invert,
xnav_eSetSignal_Test,
xnav_eSetSignal_TestValue
} xnav_eSetSignal;
class XNav;
class XNavGbl {
......@@ -491,7 +498,7 @@ class XNav {
int sound_attached();
int eventlog_enabled();
void appl_startup();
void refresh();
static int init_brow_base_cb( FlowCtx *fctx, void *client_data);
static int get_trace_attr( pwr_sAttrRef *arp, char *attr);
......@@ -522,7 +529,7 @@ class XNav {
int script( char* buffer);
pwr_tStatus get_command_sts();
int readcmdfile( char *incommand, char *buffer);
int show_database();
int show_database( int nopop = 0);
int get_current_object(
pwr_tObjid *objid,
char *objectname,
......@@ -573,6 +580,7 @@ class XNav {
int delete_object( char *name);
void open_keyboard( void *owner, keyboard_eKeymap keymap, int type);
void close_keyboard( int action);
int set_signal( pwr_tAttrRef *arp, xnav_eSetSignal type, int on);
static void print_methods();
static pwr_tStatus get_instance_classgraph( char *instance_str, pwr_tFileName filename);
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment