Commit eb1d18e6 authored by Claes Sjofors's avatar Claes Sjofors

Wb configurator, bitmap added for objects with config method

parent f0e769ea
......@@ -215,6 +215,14 @@
#include "xnav_bitmap_uncastattr18.h"
#include "xnav_bitmap_uncastattr20.h"
#include "xnav_bitmap_uncastattr24.h"
#include "xnav_bitmap_confcomp8.h"
#include "xnav_bitmap_confcomp10.h"
#include "xnav_bitmap_confcomp12.h"
#include "xnav_bitmap_confcomp14.h"
#include "xnav_bitmap_confcomp16.h"
#include "xnav_bitmap_confcomp18.h"
#include "xnav_bitmap_confcomp20.h"
#include "xnav_bitmap_confcomp24.h"
void WNavBrow::brow_setup()
{
......@@ -966,6 +974,37 @@ void WNavBrow::allocate_pixmaps()
brow_AllocAnnotPixmap( ctx, &pixmap_data, &pixmap_uncastattr);
i = 0;
pixmap_data[i].width =xnav_bitmap_confcomp8_width;
pixmap_data[i].height =xnav_bitmap_confcomp8_height;
pixmap_data[i++].bits = xnav_bitmap_confcomp8_bits;
pixmap_data[i].width =xnav_bitmap_confcomp10_width;
pixmap_data[i].height =xnav_bitmap_confcomp10_height;
pixmap_data[i++].bits = xnav_bitmap_confcomp10_bits;
pixmap_data[i].width =xnav_bitmap_confcomp12_width;
pixmap_data[i].height =xnav_bitmap_confcomp12_height;
pixmap_data[i++].bits = xnav_bitmap_confcomp12_bits;
pixmap_data[i].width =xnav_bitmap_confcomp14_width;
pixmap_data[i].height =xnav_bitmap_confcomp14_height;
pixmap_data[i++].bits = xnav_bitmap_confcomp14_bits;
pixmap_data[i].width =xnav_bitmap_confcomp16_width;
pixmap_data[i].height =xnav_bitmap_confcomp16_height;
pixmap_data[i++].bits = xnav_bitmap_confcomp16_bits;
pixmap_data[i].width =xnav_bitmap_confcomp18_width;
pixmap_data[i].height =xnav_bitmap_confcomp18_height;
pixmap_data[i++].bits = xnav_bitmap_confcomp18_bits;
pixmap_data[i].width =xnav_bitmap_confcomp20_width;
pixmap_data[i].height =xnav_bitmap_confcomp20_height;
pixmap_data[i++].bits = xnav_bitmap_confcomp20_bits;
pixmap_data[i].width =xnav_bitmap_confcomp20_width;
pixmap_data[i].height =xnav_bitmap_confcomp20_height;
pixmap_data[i++].bits = xnav_bitmap_confcomp20_bits;
pixmap_data[i].width =xnav_bitmap_confcomp24_width;
pixmap_data[i].height =xnav_bitmap_confcomp24_height;
pixmap_data[i++].bits = xnav_bitmap_confcomp24_bits;
brow_AllocAnnotPixmap( ctx, &pixmap_data, &pixmap_confcomp);
}
//
......@@ -1338,4 +1377,4 @@ void WNavBrow::create_nodeclasses()
flow_eDrawType_TextHelveticaBold, 2, flow_eAnnotType_OneLine,
0);
brow_AddFrame( nc_table_header, 0, 0, 20, 0.83, flow_eDrawType_LineGray, 2, 1);
}
\ No newline at end of file
}
......@@ -141,6 +141,7 @@ class WNavBrow {
flow_sAnnotPixmap *pixmap_castattr;
flow_sAnnotPixmap *pixmap_uncastattr;
flow_sAnnotPixmap *pixmap_docblock;
flow_sAnnotPixmap *pixmap_confcomp;
void free_pixmaps();
void allocate_pixmaps();
......@@ -148,4 +149,4 @@ class WNavBrow {
void brow_setup();
};
#endif
\ No newline at end of file
#endif
......@@ -105,6 +105,42 @@ static int item_get_reflist_object( wb_session *sp, pwr_tCid cid, char *attr, pw
return WNAV__SUCCESS;
}
static bool item_check_configure_method( ldh_tSession ldhses, pwr_tOid oid)
{
pwr_tOName name, method;
pwr_tCid cid;
pwr_tStatus sts;
int size;
ldh_GetObjectClass( ldhses, oid, &cid);
for ( sts = 1; ODD(sts); sts = ldh_GetSuperClass( ldhses, cid, &cid)) {
sts = ldh_ObjidToName( ldhses, cdh_ClassIdToObjid(cid), ldh_eName_VolPath,
name, sizeof(name), &size);
if( EVEN(sts)) return false;
for ( int i = 0; i < 3; i++) {
strcpy( method, name);
switch ( i) {
case 0:
strcat( method, "-ConfiguratorPosos-Pointed-ConfigureComponent");
break;
case 1:
strcat( method, "-ConfiguratorPosos-Pointed-ConfigureDevice");
break;
case 2:
strcat( method, "-ConfiguratorPosos-Pointed-ConfigureSlave");
break;
}
sts = ldh_NameToObjid( ldhses, &oid, method);
if ( ODD(sts))
return true;
}
}
return false;
}
//
// Member functions for WItem classes
//
......@@ -428,6 +464,8 @@ WItemObject::WItemObject( WNav *wnav, pwr_tObjid item_objid,
}
}
}
if ( item_check_configure_method( wnav->ldhses, objid))
brow_SetAnnotPixmap( node, 1, wnav->brow->pixmap_confcomp);
}
int WItemBaseObject::open_children( WNav *wnav, double x, double y)
......@@ -454,6 +492,8 @@ int WItemBaseObject::open_children( WNav *wnav, double x, double y)
brow_RemoveAnnotPixmap( node, 1);
if ( brow_IsOpen( node) & wnav_mOpen_Children)
brow_SetAnnotPixmap( node, 0, wnav->brow->pixmap_map);
if ( item_check_configure_method( wnav->ldhses, objid))
brow_SetAnnotPixmap( node, 1, wnav->brow->pixmap_confcomp);
brow_ResetOpen( node, wnav_mOpen_All);
brow_ResetNodraw( wnav->brow->ctx);
brow_Redraw( wnav->brow->ctx, node_y);
......@@ -502,6 +542,8 @@ int WItemBaseObject::open_attributes( WNav *wnav, double x, double y)
brow_CloseNode( wnav->brow->ctx, node);
brow_ResetOpen( node, wnav_mOpen_Attributes);
brow_RemoveAnnotPixmap( node, 1);
if ( item_check_configure_method( wnav->ldhses, objid))
brow_SetAnnotPixmap( node, 1, wnav->brow->pixmap_confcomp);
brow_ResetNodraw( wnav->brow->ctx);
brow_Redraw( wnav->brow->ctx, node_y);
}
......@@ -785,10 +827,16 @@ int WItemBaseObject::open_crossref( WNav *wnav, double x, double y)
// Close
brow_SetNodraw( wnav->brow->ctx);
brow_CloseNode( wnav->brow->ctx, node);
if ( brow_IsOpen( node) & wnav_mOpen_Attributes)
if ( brow_IsOpen( node) & wnav_mOpen_Attributes) {
brow_RemoveAnnotPixmap( node, 1);
if ( brow_IsOpen( node) & wnav_mOpen_Children)
if ( item_check_configure_method( wnav->ldhses, objid))
brow_SetAnnotPixmap( node, 1, wnav->brow->pixmap_confcomp);
}
if ( brow_IsOpen( node) & wnav_mOpen_Children) {
brow_SetAnnotPixmap( node, 0, wnav->brow->pixmap_map);
if ( item_check_configure_method( wnav->ldhses, objid))
brow_SetAnnotPixmap( node, 1, wnav->brow->pixmap_confcomp);
}
brow_ResetOpen( node, wnav_mOpen_All);
brow_ResetNodraw( wnav->brow->ctx);
brow_Redraw( wnav->brow->ctx, node_y);
......@@ -856,6 +904,8 @@ int WItemBaseObject::close( WNav *wnav, double x, double y)
brow_RemoveAnnotPixmap( node, 1);
if ( brow_IsOpen( node) & wnav_mOpen_Children)
brow_SetAnnotPixmap( node, 0, wnav->brow->pixmap_map);
if ( item_check_configure_method( wnav->ldhses, objid))
brow_SetAnnotPixmap( node, 1, wnav->brow->pixmap_confcomp);
brow_ResetOpen( node, wnav_mOpen_All);
brow_ResetNodraw( wnav->brow->ctx);
brow_Redraw( wnav->brow->ctx, node_y);
......@@ -4243,4 +4293,4 @@ int WItemDocBlock::get_value( char **value)
int size;
return ldh_GetDocBlock( ldhses, objid, value, &size);
}
\ No newline at end of file
}
#define xnav_bitmap_confcomp10_width 12
#define xnav_bitmap_confcomp10_height 10
static unsigned char xnav_bitmap_confcomp10_bits[] = {
0x20, 0x00, 0x74, 0x01, 0x88, 0x00, 0x04, 0x01, 0x06, 0x03, 0x04, 0x01,
0x88, 0x00, 0x74, 0x01, 0x20, 0x00, 0x00, 0x00};
#define xnav_bitmap_confcomp12_width 12
#define xnav_bitmap_confcomp12_height 12
static unsigned char xnav_bitmap_confcomp12_bits[] = {
0x00, 0x00, 0x20, 0x00, 0x74, 0x01, 0x88, 0x00, 0x04, 0x01, 0x06, 0x03,
0x04, 0x01, 0x88, 0x00, 0x74, 0x01, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00};
#define xnav_bitmap_confcomp14_width 16
#define xnav_bitmap_confcomp14_height 14
static unsigned char xnav_bitmap_confcomp14_bits[] = {
0x00, 0x00, 0xa0, 0x02, 0xe8, 0x01, 0x10, 0x0a, 0x0a, 0x04, 0x04, 0x18,
0x06, 0x08, 0x04, 0x18, 0x06, 0x08, 0x08, 0x14, 0x14, 0x02, 0xe0, 0x05,
0x50, 0x01, 0x00, 0x00};
#define xnav_bitmap_confcomp16_width 19
#define xnav_bitmap_confcomp16_height 16
static unsigned char xnav_bitmap_confcomp16_bits[] = {
0x00, 0x09, 0x00, 0xa0, 0x2f, 0x00, 0x40, 0x10, 0x00, 0x28, 0xa0, 0x00,
0x10, 0x40, 0x00, 0x08, 0x80, 0x00, 0x0c, 0x80, 0x01, 0x08, 0x80, 0x00,
0x0c, 0x80, 0x01, 0x08, 0x80, 0x00, 0x10, 0x40, 0x00, 0x28, 0xa0, 0x00,
0x40, 0x10, 0x00, 0xa0, 0x2f, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00};
#define xnav_bitmap_confcomp18_width 22
#define xnav_bitmap_confcomp18_height 18
static unsigned char xnav_bitmap_confcomp18_bits[] = {
0x00, 0x04, 0x00, 0x40, 0x4e, 0x00, 0x80, 0x31, 0x00, 0x60, 0xc0, 0x00,
0x28, 0x80, 0x02, 0x10, 0x00, 0x01, 0x10, 0x00, 0x01, 0x08, 0x00, 0x02,
0x0c, 0x00, 0x06, 0x08, 0x00, 0x02, 0x10, 0x00, 0x01, 0x10, 0x00, 0x01,
0x28, 0x80, 0x02, 0x60, 0xc0, 0x00, 0x80, 0x31, 0x00, 0x40, 0x4e, 0x00,
0x00, 0x04, 0x00, 0x00, 0x00, 0x00};
#define xnav_bitmap_confcomp20_width 24
#define xnav_bitmap_confcomp20_height 20
static unsigned char xnav_bitmap_confcomp20_bits[] = {
0x00, 0x12, 0x00, 0x00, 0x12, 0x00, 0x20, 0x1c, 0x02, 0x40, 0x63, 0x01,
0x88, 0x80, 0x08, 0x50, 0x00, 0x05, 0x20, 0x00, 0x02, 0x20, 0x00, 0x02,
0x1c, 0x00, 0x1c, 0x10, 0x00, 0x04, 0x10, 0x00, 0x04, 0x2c, 0x00, 0x1a,
0x20, 0x00, 0x02, 0x50, 0x00, 0x01, 0x88, 0x80, 0x02, 0x40, 0x63, 0x04,
0x20, 0x9c, 0x00, 0x00, 0x12, 0x01, 0x00, 0x12, 0x00, 0x00, 0x00, 0x00};
#define xnav_bitmap_confcomp24_width 28
#define xnav_bitmap_confcomp24_height 24
static unsigned char xnav_bitmap_confcomp24_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x01, 0x00, 0x80, 0x24, 0x09, 0x00,
0x00, 0xf9, 0x04, 0x00, 0x20, 0x06, 0x23, 0x00, 0xc0, 0x01, 0x1c, 0x00,
0x48, 0x00, 0x90, 0x00, 0x50, 0x00, 0x50, 0x00, 0x20, 0x00, 0x20, 0x00,
0x2c, 0x00, 0xa0, 0x01, 0x10, 0x00, 0x40, 0x00, 0x10, 0x00, 0x40, 0x00,
0x1c, 0x00, 0xc0, 0x01, 0x10, 0x00, 0x40, 0x00, 0x10, 0x00, 0x40, 0x00,
0x2c, 0x00, 0xa0, 0x01, 0x20, 0x00, 0x20, 0x00, 0x50, 0x00, 0x50, 0x00,
0x48, 0x00, 0x90, 0x00, 0xc0, 0x01, 0x1c, 0x00, 0x20, 0x06, 0x23, 0x00,
0x00, 0xf9, 0x04, 0x00, 0x80, 0x24, 0x09, 0x00, 0x00, 0x24, 0x01, 0x00};
#define xnav_bitmap_confcomp8_width 9
#define xnav_bitmap_confcomp8_height 8
static unsigned char xnav_bitmap_confcomp8_bits[] = {
0x10, 0x00, 0x5a, 0x00, 0x24, 0x00, 0x43, 0x00, 0xc2, 0x00, 0x24, 0x00,
0x5a, 0x00, 0x10, 0x00};
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