Commit 6e3f8fe1 authored by Claes Sjofors's avatar Claes Sjofors

Plc editor, build debug fetched from wtt settings (refs #203)

parent 88608f4e
...@@ -1046,10 +1046,14 @@ WFoe *WFoeGtk::subwindow_new( void *f_parent_ctx, ...@@ -1046,10 +1046,14 @@ WFoe *WFoeGtk::subwindow_new( void *f_parent_ctx,
unsigned int f_options, unsigned int f_options,
pwr_tStatus *sts) pwr_tStatus *sts)
{ {
return new WFoeGtk( f_parent_ctx, widgets.foe_window, f_name, plcprogram, WFoeGtk *foe = new WFoeGtk( f_parent_ctx, widgets.foe_window, f_name, plcprogram,
ldhwbctx, ldhsesctx, nodeobject, windowindex, ldhwbctx, ldhsesctx, nodeobject, windowindex,
new_window, f_map_window, f_access, function_access, new_window, f_map_window, f_access, function_access,
f_options, sts); f_options, sts);
if ( ODD(*sts))
foe->get_build_options_cb = get_build_options_subwindow_cb;
return foe;
} }
......
...@@ -439,12 +439,13 @@ int WNavGtk::open_foe( const char *name, pwr_tOid plcpgm, ...@@ -439,12 +439,13 @@ int WNavGtk::open_foe( const char *name, pwr_tOid plcpgm,
foe = WFoe::get( plcpgm); foe = WFoe::get( plcpgm);
if ( foe) if ( foe)
foe->pop(); foe->pop();
else else {
foe = new WFoeGtk( (void *)parent_ctx, parent_wid, name, foe = new WFoeGtk( (void *)this, parent_wid, name,
plcpgm, wbctx, ldhses, plcpgm, wbctx, ldhses,
map_window, access, options, &sts); map_window, access, options, &sts);
if ( EVEN(sts)) return sts; if ( EVEN(sts)) return sts;
foe->get_build_options_cb = foe_get_build_options_cb;
}
if ( cdh_ObjidIsNotNull( oid)) if ( cdh_ObjidIsNotNull( oid))
foe->center_object(oid); foe->center_object(oid);
*foectx = foe; *foectx = foe;
......
...@@ -73,6 +73,7 @@ ...@@ -73,6 +73,7 @@
#include "cow_wow.h" #include "cow_wow.h"
#include "cow_xhelp.h" #include "cow_xhelp.h"
#include "wb_log.h" #include "wb_log.h"
#include "wb_build_opt.h"
#define BEEP putchar( '\7' ); #define BEEP putchar( '\7' );
...@@ -464,6 +465,7 @@ void WFoe::activate_compile() ...@@ -464,6 +465,7 @@ void WFoe::activate_compile()
char msg[80]; char msg[80];
vldh_t_wind wind; vldh_t_wind wind;
int vldh_mod; int vldh_mod;
int debug = 0;
if ( msg_label_id != 0 ) message( ""); if ( msg_label_id != 0 ) message( "");
...@@ -477,8 +479,15 @@ void WFoe::activate_compile() ...@@ -477,8 +479,15 @@ void WFoe::activate_compile()
return; return;
} }
if ( get_build_options_cb) {
wb_build_opt *buildopt;
(get_build_options_cb)( parent_ctx, &buildopt);
debug = buildopt->debug;
}
disable_ldh_cb(); disable_ldh_cb();
sts = gcg_plcwindow_compile( wind, 1, &errcount, &warncount, 0, 0); sts = gcg_plcwindow_compile( wind, 1, &errcount, &warncount, 0, debug);
enable_ldh_cb(); enable_ldh_cb();
if ( sts == GSX__AMBIGOUS_EXECUTEORDER) { if ( sts == GSX__AMBIGOUS_EXECUTEORDER) {
message( "Execute order error"); message( "Execute order error");
...@@ -508,7 +517,7 @@ void WFoe::activate_compile() ...@@ -508,7 +517,7 @@ void WFoe::activate_compile()
} }
sts = gcg_plc_compile( wind->hw.plc, 1, sts = gcg_plc_compile( wind->hw.plc, 1,
&plc_errcount, &plc_warncount, 0, 0); &plc_errcount, &plc_warncount, 0, debug);
warncount += plc_warncount; warncount += plc_warncount;
errcount += plc_errcount; errcount += plc_errcount;
if ( sts == GSX__PLCPGM_ERRORS) { if ( sts == GSX__PLCPGM_ERRORS) {
...@@ -2715,8 +2724,8 @@ WFoe::WFoe( void *f_parent_ctx, ...@@ -2715,8 +2724,8 @@ WFoe::WFoe( void *f_parent_ctx,
pwr_tStatus *sts) : pwr_tStatus *sts) :
WUtility(wb_eUtility_PlcEditor), WUtility(wb_eUtility_PlcEditor),
parent_ctx(f_parent_ctx), parent_ctx(f_parent_ctx),
node_palctx(0), con_palctx(0), navctx(0), tractx(0), gre(0), msg_label_id(0), node_palctx(0), con_palctx(0), navctx(0), tractx(0), gre(0), get_build_options_cb(0),
function(0), wanted_function(0), plcobject(0), con_palette_managed(0), msg_label_id(0), function(0), wanted_function(0), plcobject(0), con_palette_managed(0),
node_palette_managed(0), nav_palette_managed(0), con_drawtype(GOEN_CONDRAW), node_palette_managed(0), nav_palette_managed(0), con_drawtype(GOEN_CONDRAW),
show_execorder(0), searchindex(0), popupmenu_mask(~0), popupmenu_node(0), show_execorder(0), searchindex(0), popupmenu_mask(~0), popupmenu_node(0),
access(f_access), map_window(f_map_window), advanced_user(1), ldh_cb_enabled(0), access(f_access), map_window(f_map_window), advanced_user(1), ldh_cb_enabled(0),
...@@ -4287,6 +4296,14 @@ int WFoe::create_volume_xtthelpfile( ldh_tSession ldhses, pwr_tVid vid) ...@@ -4287,6 +4296,14 @@ int WFoe::create_volume_xtthelpfile( ldh_tSession ldhses, pwr_tVid vid)
return FOE__SUCCESS; return FOE__SUCCESS;
} }
void WFoe::get_build_options_subwindow_cb( void *ctx, wb_build_opt **opt)
{
WFoe *foe = (WFoe *)ctx;
if ( foe->get_build_options_cb)
(foe->get_build_options_cb)( foe->parent_ctx, opt);
}
/* API routines */ /* API routines */
#if 0 #if 0
......
...@@ -95,6 +95,7 @@ class WAtt; ...@@ -95,6 +95,7 @@ class WAtt;
class CoWow; class CoWow;
class Pal; class Pal;
class Nav; class Nav;
class wb_build_opt;
typedef struct { typedef struct {
void *a_ctx; void *a_ctx;
...@@ -116,6 +117,7 @@ class WFoe : public WUtility { ...@@ -116,6 +117,7 @@ class WFoe : public WUtility {
void (* popupmsg_yes_p)(WFoe *); void (* popupmsg_yes_p)(WFoe *);
void (* popupmsg_no_p)(WFoe *); void (* popupmsg_no_p)(WFoe *);
void (* popupmsg_cancel_p)(WFoe *); void (* popupmsg_cancel_p)(WFoe *);
void (* get_build_options_cb)(void *, wb_build_opt **);
int msg_label_id; int msg_label_id;
int function; /* TRACE or EDIT or ... */ int function; /* TRACE or EDIT or ... */
int wanted_function; int wanted_function;
...@@ -357,6 +359,7 @@ class WFoe : public WUtility { ...@@ -357,6 +359,7 @@ class WFoe : public WUtility {
static void pal_select_cb( void *ctx, pwr_tCid cid); static void pal_select_cb( void *ctx, pwr_tCid cid);
static int create_volume_xtthelpfile( ldh_tSession ldhses, pwr_tVid vid); static int create_volume_xtthelpfile( ldh_tSession ldhses, pwr_tVid vid);
static void get_build_options_subwindow_cb( void *ctx, wb_build_opt **opt);
}; };
......
...@@ -206,7 +206,8 @@ static int gobj_get_select( WFoe *foe, pwr_sAttrRef *attrref, int *is_attr) ...@@ -206,7 +206,8 @@ static int gobj_get_select( WFoe *foe, pwr_sAttrRef *attrref, int *is_attr)
return sts; return sts;
} }
sts = ((Wtt *)plc->hp.hinactx)->get_select_first( attrref, is_attr); WNav *wnav = (WNav *)plc->hp.hinactx;
sts = ((Wtt *)wnav->parent_ctx)->get_select_first( attrref, is_attr);
if ( ODD(sts)) if ( ODD(sts))
return sts; return sts;
......
...@@ -633,7 +633,7 @@ WNav::WNav( ...@@ -633,7 +633,7 @@ WNav::WNav(
window_type(xn_type), ldhses(xn_ldhses), wbctx(0), window_type(xn_type), ldhses(xn_ldhses), wbctx(0),
brow(0), brow_cnt(0), trace_started(0), brow(0), brow_cnt(0), trace_started(0),
message_cb(NULL), close_cb(NULL), map_cb(NULL), change_value_cb(NULL), message_cb(NULL), close_cb(NULL), map_cb(NULL), change_value_cb(NULL),
ccm_func_registred(0), get_build_options_cb(NULL), ccm_func_registred(0),
menu_tree(NULL), closing_down(0), menu_tree(NULL), closing_down(0),
base_priv(pwr_mPrv_System), priv(pwr_mPrv_System), editmode(0), base_priv(pwr_mPrv_System), priv(pwr_mPrv_System), editmode(0),
layout_objid(pwr_cNObjid), search_last(pwr_cNObjid), search_compiled(0), layout_objid(pwr_cNObjid), search_last(pwr_cNObjid), search_compiled(0),
...@@ -3599,6 +3599,13 @@ int WNav::init_brow_cb( BrowCtx *ctx, void *client_data) ...@@ -3599,6 +3599,13 @@ int WNav::init_brow_cb( BrowCtx *ctx, void *client_data)
} }
void WNav::foe_get_build_options_cb( void *ctx, wb_build_opt **opt)
{
WNav *wnav = (WNav *)ctx;
*opt = &wnav->gbl.build;
}
ApplListElem::ApplListElem( applist_eType al_type, void *al_ctx, ApplListElem::ApplListElem( applist_eType al_type, void *al_ctx,
pwr_tObjid al_objid, const char *al_name): pwr_tObjid al_objid, const char *al_name):
type(al_type), ctx(al_ctx), objid(al_objid), next(NULL) type(al_type), ctx(al_ctx), objid(al_objid), next(NULL)
...@@ -3671,3 +3678,4 @@ char *wnav_get_message( int sts) ...@@ -3671,3 +3678,4 @@ char *wnav_get_message( int sts)
return msg_GetMsg( sts, msg, sizeof(msg)); return msg_GetMsg( sts, msg, sizeof(msg));
} }
...@@ -283,6 +283,7 @@ class WNav : public WUtility{ ...@@ -283,6 +283,7 @@ class WNav : public WUtility{
int (*global_unselect_objid_cb)( void *, pwr_tObjid objid); int (*global_unselect_objid_cb)( void *, pwr_tObjid objid);
void (*set_window_char_cb)( void *, int, int); void (*set_window_char_cb)( void *, int, int);
void (*open_vsel_cb)( void *, wb_eType, char *, wow_eFileSelType); void (*open_vsel_cb)( void *, wb_eType, char *, wow_eFileSelType);
void (*get_build_options_cb)( void *, wb_build_opt **);
int ccm_func_registred; int ccm_func_registred;
wnav_sMenu *menu_tree; wnav_sMenu *menu_tree;
int closing_down; int closing_down;
...@@ -356,6 +357,7 @@ class WNav : public WUtility{ ...@@ -356,6 +357,7 @@ class WNav : public WUtility{
flow_eTraceType type, void **p); flow_eTraceType type, void **p);
static int trace_disconnect_bc( brow_tObject object); static int trace_disconnect_bc( brow_tObject object);
static int trace_scan_bc( brow_tObject object, void *p); static int trace_scan_bc( brow_tObject object, void *p);
static void foe_get_build_options_cb( void *ctx, wb_build_opt **opt);
int create_object_item( pwr_tObjid objid, int create_object_item( pwr_tObjid objid,
brow_tNode dest, flow_eDest dest_code, void **item, brow_tNode dest, flow_eDest dest_code, void **item,
......
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