Commit 3a34d908 authored by Claes Sjofors's avatar Claes Sjofors

Togglebutton for feeback connection in plc editor

parent 207b4f59
......@@ -515,6 +515,14 @@ void WFoeGtk::activate_palette_object( GtkWidget *w, gpointer data)
foe->node_palctx->set_inputfocus( set);
}
void WFoeGtk::activate_confeedback( GtkWidget *w, gpointer data)
{
WFoeGtk *foe = (WFoeGtk *)data;
int set = (int) gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(w));
((WFoe *)foe)->activate_confeedback( set);
}
//
// Callback from the menu.
// Display or hide the connection palette.
......@@ -1825,6 +1833,15 @@ pwr_tStatus WFoeGtk::create_window( int x_top,
g_object_set( tools_plantpalette, "can-focus", FALSE, NULL);
gtk_toolbar_append_widget( tools, tools_plantpalette, "Show Plant Hierarchy", "");
// Feedback connection checkbutton
GtkWidget *tools_confeedback = gtk_toggle_button_new();
dcli_translate_filename( fname, "$pwr_exe/foe_confeedback.png");
gtk_container_add( GTK_CONTAINER(tools_confeedback),
gtk_image_new_from_file( fname));
g_signal_connect(tools_confeedback, "clicked", G_CALLBACK(activate_confeedback), this);
g_object_set( tools_confeedback, "can-focus", FALSE, NULL);
gtk_toolbar_append_widget( tools, tools_confeedback, "Feedback connection", "");
// Statusbar and cmd input
GtkWidget *statusbar = gtk_hbox_new( FALSE, 0);
widgets.label = gtk_label_new( "");
......
......@@ -239,6 +239,7 @@ class WFoeGtk : public WFoe {
static void activate_palette_con( GtkWidget *w, gpointer data);
static void activate_palette_object( GtkWidget *w, gpointer data);
static void activate_palette_plant( GtkWidget *w, gpointer data);
static void activate_confeedback( GtkWidget *w, gpointer data);
static void activate_refcon( GtkWidget *w, gpointer data);
static void activate_showexeord( GtkWidget *w, gpointer data);
static void activate_plcattribute( GtkWidget *w, gpointer data);
......
......@@ -1600,6 +1600,15 @@ void WFoe::gre_con_created( WGre *gre, double x, double y,
foe->error_msg( *sts);
if ( EVEN(*sts)) return;
if ( foe->use_feedback_con) {
// Change to corresponding feedback connection
if ( con_class == pwr_cClass_ConDigital)
con_class = pwr_cClass_ConFeedbackDigital;
else if ( con_class == pwr_cClass_ConAnalog)
con_class = pwr_cClass_ConFeedbackAnalog;
}
if ( user_class)
con_class = user_class;
......@@ -2573,7 +2582,7 @@ WFoe::WFoe( void *f_parent_ctx,
node_palette_managed(0), nav_palette_managed(0), con_drawtype(GOEN_CONDRAW),
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),
classeditor(0), options(f_options)
classeditor(0), options(f_options), use_feedback_con(0)
{
strcpy( name, f_name);
}
......@@ -2598,7 +2607,7 @@ WFoe::WFoe( void *f_parent_ctx,
node_palette_managed(0), nav_palette_managed(0), con_drawtype(GOEN_CONDRAW),
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),
classeditor(0), options(f_options)
classeditor(0), options(f_options), use_feedback_con(0)
{
strcpy( name, f_name);
}
......
......@@ -119,6 +119,7 @@ class WFoe : public WUtility {
int ldh_cb_enabled;
int classeditor;
unsigned int options;
int use_feedback_con;
static foe_sAttr *attr_pointer;
static int attr_count;
CoWow *wow;
......@@ -245,6 +246,7 @@ class WFoe : public WUtility {
void activate_view_togg( int set);
void activate_edit_togg( int set);
void activate_conpoint_lock();
void activate_confeedback( int set) { use_feedback_con = set;}
void function_setup();
int register_callbacks();
......
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