Commit 3fa82e1e authored by claes's avatar claes

Update Classes command and added to wtt menue

parent a0eec161
/* /*
* Proview $Id: wb_wnav_command.cpp,v 1.41 2006-05-11 07:12:20 claes Exp $ * Proview $Id: wb_wnav_command.cpp,v 1.42 2006-05-22 08:20:36 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -84,6 +84,7 @@ extern "C" { ...@@ -84,6 +84,7 @@ extern "C" {
#include "wb_erep.h" #include "wb_erep.h"
#include "wb_vrepwbl.h" #include "wb_vrepwbl.h"
#include "wb_vrepmem.h" #include "wb_vrepmem.h"
#include "wb_vrepdb.h"
#include "wb_pkg.h" #include "wb_pkg.h"
#include "wb_build.h" #include "wb_build.h"
#include "wb_wtt.h" #include "wb_wtt.h"
...@@ -178,6 +179,10 @@ static int wnav_release_func( void *client_data, ...@@ -178,6 +179,10 @@ static int wnav_release_func( void *client_data,
void *client_flag); void *client_flag);
static int wnav_build_func( void *client_data, static int wnav_build_func( void *client_data,
void *client_flag); void *client_flag);
static int wnav_check_func( void *client_data,
void *client_flag);
static int wnav_update_func( void *client_data,
void *client_flag);
dcli_tCmdTable wnav_command_table[] = { dcli_tCmdTable wnav_command_table[] = {
{ {
...@@ -428,6 +433,16 @@ dcli_tCmdTable wnav_command_table[] = { ...@@ -428,6 +433,16 @@ dcli_tCmdTable wnav_command_table[] = {
{ "dcli_arg1", "dcli_arg2", "/FORCE", "/DEBUG", "/CROSSREFERENCE", { "dcli_arg1", "dcli_arg2", "/FORCE", "/DEBUG", "/CROSSREFERENCE",
"/MANUAL", "/NAME", ""} "/MANUAL", "/NAME", ""}
}, },
{
"CHECK",
&wnav_check_func,
{ "dcli_arg1", ""}
},
{
"UPDATE",
&wnav_update_func,
{ "dcli_arg1", ""}
},
{"",}}; {"",}};
...@@ -4637,6 +4652,70 @@ static int wnav_build_func( void *client_data, ...@@ -4637,6 +4652,70 @@ static int wnav_build_func( void *client_data,
return 1; return 1;
} }
static int wnav_check_func( void *client_data,
void *client_flag)
{
WNav *wnav = (WNav *)client_data;
char arg1_str[80];
pwr_tStatus sts;
sts = wnav_wccm_get_ldhsession_cb( wnav, &wnav->ldhses);
if ( EVEN(sts)) return sts;
sts = dcli_get_qualifier( "dcli_arg1", arg1_str, sizeof(arg1_str));
if ( EVEN(sts)) {
wnav->message('E', "Syntax error");
return WNAV__SYNTAX;
}
if ( strncmp( arg1_str, "CLASSES", strlen( arg1_str)) == 0) {
wb_volume *v = (wb_volume *) ldh_SessionToVol( wnav->ldhses);
wb_vrepdb *vrep = (wb_vrepdb *)((wb_vrep *) *v);
vrep->checkMeta();
}
else {
wnav->message('E', "Syntax error");
return WNAV__SYNTAX;
}
return 1;
}
static int wnav_update_func( void *client_data,
void *client_flag)
{
WNav *wnav = (WNav *)client_data;
char arg1_str[80];
pwr_tStatus sts;
sts = wnav_wccm_get_ldhsession_cb( wnav, &wnav->ldhses);
if ( EVEN(sts)) return sts;
sts = dcli_get_qualifier( "dcli_arg1", arg1_str, sizeof(arg1_str));
if ( EVEN(sts)) {
wnav->message('E', "Syntax error");
return WNAV__SYNTAX;
}
if ( strncmp( arg1_str, "CLASSES", strlen( arg1_str)) == 0) {
if ( !wnav->editmode) {
wnav->message('E', "Not in edit mode");
return WNAV__NOEDIT;
}
wb_volume *v = (wb_volume *) ldh_SessionToVol( wnav->ldhses);
wb_vrepdb *vrep = (wb_vrepdb *)((wb_vrep *) *v);
vrep->updateMeta();
wnav->message('E', "Classvolumes updated");
}
else {
wnav->message('E', "Syntax error");
return WNAV__SYNTAX;
}
return 1;
}
int WNav::show_database() int WNav::show_database()
{ {
int sts; int sts;
......
/* /*
* Proview $Id: wb_wtt.cpp,v 1.32 2006-05-11 10:47:24 claes Exp $ * Proview $Id: wb_wtt.cpp,v 1.33 2006-05-22 08:20:36 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -265,6 +265,7 @@ void Wtt::menu_setup() ...@@ -265,6 +265,7 @@ void Wtt::menu_setup()
XtSetValues( menu_change_value_w, sensitive, 1); XtSetValues( menu_change_value_w, sensitive, 1);
XtSetValues( menu_edit_w, sensitive, 1); XtSetValues( menu_edit_w, sensitive, 1);
XtSetValues( menu_classeditor_w, nosensitive, 1); XtSetValues( menu_classeditor_w, nosensitive, 1);
XtSetValues( menu_updateclasses_w, sensitive, 1);
} }
else { else {
XtSetValues( menu_save_w, nosensitive, 1); XtSetValues( menu_save_w, nosensitive, 1);
...@@ -284,6 +285,7 @@ void Wtt::menu_setup() ...@@ -284,6 +285,7 @@ void Wtt::menu_setup()
XtSetValues( menu_change_value_w, nosensitive, 1); XtSetValues( menu_change_value_w, nosensitive, 1);
XtSetValues( menu_edit_w, sensitive, 1); XtSetValues( menu_edit_w, sensitive, 1);
XtSetValues( menu_classeditor_w, sensitive, 1); XtSetValues( menu_classeditor_w, sensitive, 1);
XtSetValues( menu_updateclasses_w, nosensitive, 1);
} }
break; break;
case wb_eType_Volume: case wb_eType_Volume:
...@@ -305,6 +307,10 @@ void Wtt::menu_setup() ...@@ -305,6 +307,10 @@ void Wtt::menu_setup()
XtSetValues( menu_change_value_w, sensitive, 1); XtSetValues( menu_change_value_w, sensitive, 1);
XtSetValues( menu_edit_w, sensitive, 1); XtSetValues( menu_edit_w, sensitive, 1);
XtSetValues( menu_classeditor_w, nosensitive, 1); XtSetValues( menu_classeditor_w, nosensitive, 1);
if ( ldhses && ldh_VolRepType( ldhses) == ldh_eVolRep_Dbs)
XtSetValues( menu_updateclasses_w, nosensitive, 1);
else
XtSetValues( menu_updateclasses_w, sensitive, 1);
} }
else { else {
XtSetValues( menu_save_w, nosensitive, 1); XtSetValues( menu_save_w, nosensitive, 1);
...@@ -327,6 +333,7 @@ void Wtt::menu_setup() ...@@ -327,6 +333,7 @@ void Wtt::menu_setup()
XtSetValues( menu_change_value_w, nosensitive, 1); XtSetValues( menu_change_value_w, nosensitive, 1);
XtSetValues( menu_edit_w, sensitive, 1); XtSetValues( menu_edit_w, sensitive, 1);
XtSetValues( menu_classeditor_w, nosensitive, 1); XtSetValues( menu_classeditor_w, nosensitive, 1);
XtSetValues( menu_updateclasses_w, nosensitive, 1);
} }
break; break;
case wb_eType_Class: case wb_eType_Class:
...@@ -348,6 +355,7 @@ void Wtt::menu_setup() ...@@ -348,6 +355,7 @@ void Wtt::menu_setup()
XtSetValues( menu_change_value_w, sensitive, 1); XtSetValues( menu_change_value_w, sensitive, 1);
XtSetValues( menu_edit_w, sensitive, 1); XtSetValues( menu_edit_w, sensitive, 1);
XtSetValues( menu_classeditor_w, nosensitive, 1); XtSetValues( menu_classeditor_w, nosensitive, 1);
XtSetValues( menu_updateclasses_w, nosensitive, 1);
} }
else { else {
XtSetValues( menu_save_w, nosensitive, 1); XtSetValues( menu_save_w, nosensitive, 1);
...@@ -367,6 +375,7 @@ void Wtt::menu_setup() ...@@ -367,6 +375,7 @@ void Wtt::menu_setup()
XtSetValues( menu_change_value_w, nosensitive, 1); XtSetValues( menu_change_value_w, nosensitive, 1);
XtSetValues( menu_edit_w, nosensitive, 1); XtSetValues( menu_edit_w, nosensitive, 1);
XtSetValues( menu_classeditor_w, nosensitive, 1); XtSetValues( menu_classeditor_w, nosensitive, 1);
XtSetValues( menu_updateclasses_w, nosensitive, 1);
} }
break; break;
case wb_eType_ClassEditor: case wb_eType_ClassEditor:
...@@ -392,6 +401,7 @@ void Wtt::menu_setup() ...@@ -392,6 +401,7 @@ void Wtt::menu_setup()
XtSetValues( menu_change_value_w, sensitive, 1); XtSetValues( menu_change_value_w, sensitive, 1);
XtSetValues( menu_edit_w, sensitive, 1); XtSetValues( menu_edit_w, sensitive, 1);
XtSetValues( menu_classeditor_w, nosensitive, 1); XtSetValues( menu_classeditor_w, nosensitive, 1);
XtSetValues( menu_updateclasses_w, nosensitive, 1);
} }
else { else {
XtSetValues( menu_save_w, nosensitive, 1); XtSetValues( menu_save_w, nosensitive, 1);
...@@ -411,6 +421,7 @@ void Wtt::menu_setup() ...@@ -411,6 +421,7 @@ void Wtt::menu_setup()
XtSetValues( menu_change_value_w, nosensitive, 1); XtSetValues( menu_change_value_w, nosensitive, 1);
XtSetValues( menu_edit_w, sensitive, 1); XtSetValues( menu_edit_w, sensitive, 1);
XtSetValues( menu_classeditor_w, nosensitive, 1); XtSetValues( menu_classeditor_w, nosensitive, 1);
XtSetValues( menu_updateclasses_w, nosensitive, 1);
} }
break; break;
case wb_eType_Buffer: case wb_eType_Buffer:
...@@ -432,6 +443,7 @@ void Wtt::menu_setup() ...@@ -432,6 +443,7 @@ void Wtt::menu_setup()
XtSetValues( menu_change_value_w, sensitive, 1); XtSetValues( menu_change_value_w, sensitive, 1);
XtSetValues( menu_edit_w, sensitive, 1); XtSetValues( menu_edit_w, sensitive, 1);
XtSetValues( menu_classeditor_w, nosensitive, 1); XtSetValues( menu_classeditor_w, nosensitive, 1);
XtSetValues( menu_updateclasses_w, nosensitive, 1);
} }
else { else {
XtSetValues( menu_save_w, nosensitive, 1); XtSetValues( menu_save_w, nosensitive, 1);
...@@ -451,6 +463,7 @@ void Wtt::menu_setup() ...@@ -451,6 +463,7 @@ void Wtt::menu_setup()
XtSetValues( menu_change_value_w, nosensitive, 1); XtSetValues( menu_change_value_w, nosensitive, 1);
XtSetValues( menu_edit_w, sensitive, 1); XtSetValues( menu_edit_w, sensitive, 1);
XtSetValues( menu_classeditor_w, nosensitive, 1); XtSetValues( menu_classeditor_w, nosensitive, 1);
XtSetValues( menu_updateclasses_w, nosensitive, 1);
} }
break; break;
case wb_eType_ExternVolume: case wb_eType_ExternVolume:
...@@ -472,6 +485,7 @@ void Wtt::menu_setup() ...@@ -472,6 +485,7 @@ void Wtt::menu_setup()
XtSetValues( menu_change_value_w, sensitive, 1); XtSetValues( menu_change_value_w, sensitive, 1);
XtSetValues( menu_edit_w, sensitive, 1); XtSetValues( menu_edit_w, sensitive, 1);
XtSetValues( menu_classeditor_w, nosensitive, 1); XtSetValues( menu_classeditor_w, nosensitive, 1);
XtSetValues( menu_updateclasses_w, nosensitive, 1);
} }
else { else {
XtSetValues( menu_save_w, nosensitive, 1); XtSetValues( menu_save_w, nosensitive, 1);
...@@ -491,6 +505,7 @@ void Wtt::menu_setup() ...@@ -491,6 +505,7 @@ void Wtt::menu_setup()
XtSetValues( menu_change_value_w, nosensitive, 1); XtSetValues( menu_change_value_w, nosensitive, 1);
XtSetValues( menu_edit_w, sensitive, 1); XtSetValues( menu_edit_w, sensitive, 1);
XtSetValues( menu_classeditor_w, nosensitive, 1); XtSetValues( menu_classeditor_w, nosensitive, 1);
XtSetValues( menu_updateclasses_w, nosensitive, 1);
} }
break; break;
default: default:
...@@ -2501,6 +2516,14 @@ static void wtt_activate_showcrossref( Widget w, Wtt *wtt, XmAnyCallbackStruct * ...@@ -2501,6 +2516,14 @@ static void wtt_activate_showcrossref( Widget w, Wtt *wtt, XmAnyCallbackStruct *
wtt->focused_wnav->command( cmd); wtt->focused_wnav->command( cmd);
} }
static void wtt_activate_updateclasses( Widget w, Wtt *wtt, XmAnyCallbackStruct *data)
{
char cmd[80] = "update classes";
if ( !wtt->focused_wnav)
wtt->set_focus_default();
wtt->focused_wnav->command( cmd);
}
static void wtt_activate_zoom_in( Widget w, Wtt *wtt, XmAnyCallbackStruct *data) static void wtt_activate_zoom_in( Widget w, Wtt *wtt, XmAnyCallbackStruct *data)
{ {
double zoom_factor; double zoom_factor;
...@@ -2628,6 +2651,7 @@ void wtt_create_menubutton( Widget w, Wtt *wtt) ...@@ -2628,6 +2651,7 @@ void wtt_create_menubutton( Widget w, Wtt *wtt)
case 15: wtt->menu_edit_w = w; break; case 15: wtt->menu_edit_w = w; break;
case 16: wtt->menu_classeditor_w = w; break; case 16: wtt->menu_classeditor_w = w; break;
case 17: wtt->menu_copykeep_w = w; break; case 17: wtt->menu_copykeep_w = w; break;
case 18: wtt->menu_updateclasses_w = w; break;
default: default:
; ;
} }
...@@ -3537,6 +3561,7 @@ Wtt::Wtt( ...@@ -3537,6 +3561,7 @@ Wtt::Wtt(
{"wtt_activate_buildvolume",(caddr_t)wtt_activate_buildvolume }, {"wtt_activate_buildvolume",(caddr_t)wtt_activate_buildvolume },
{"wtt_activate_buildnode",(caddr_t)wtt_activate_buildnode }, {"wtt_activate_buildnode",(caddr_t)wtt_activate_buildnode },
{"wtt_activate_distribute",(caddr_t)wtt_activate_distribute }, {"wtt_activate_distribute",(caddr_t)wtt_activate_distribute },
{"wtt_activate_updateclasses",(caddr_t)wtt_activate_updateclasses },
{"wtt_activate_showcrossref",(caddr_t)wtt_activate_showcrossref }, {"wtt_activate_showcrossref",(caddr_t)wtt_activate_showcrossref },
{"wtt_activate_change_value",(caddr_t)wtt_activate_change_value }, {"wtt_activate_change_value",(caddr_t)wtt_activate_change_value },
{"wtt_activate_command",(caddr_t)wtt_activate_command }, {"wtt_activate_command",(caddr_t)wtt_activate_command },
......
/* /*
* Proview $Id: wb_wtt.h,v 1.15 2006-03-31 14:29:39 claes Exp $ * Proview $Id: wb_wtt.h,v 1.16 2006-05-22 08:20:36 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -228,6 +228,7 @@ class Wtt { ...@@ -228,6 +228,7 @@ class Wtt {
Widget menu_change_value_w; Widget menu_change_value_w;
Widget menu_edit_w; Widget menu_edit_w;
Widget menu_classeditor_w; Widget menu_classeditor_w;
Widget menu_updateclasses_w;
uted_ctx utedctx; uted_ctx utedctx;
WPkg *wpkg; WPkg *wpkg;
WNav *input_wnav; WNav *input_wnav;
......
! !
! Proview $Id: wb_wtt.uil,v 1.9 2006-05-11 10:46:05 claes Exp $ ! Proview $Id: wb_wtt.uil,v 1.10 2006-05-22 08:20:36 claes Exp $
! Copyright (C) 2005 SSAB Oxelsund AB. ! Copyright (C) 2005 SSAB Oxelsund AB.
! !
! This program is free software; you can redistribute it and/or ! This program is free software; you can redistribute it and/or
...@@ -65,6 +65,7 @@ procedure ...@@ -65,6 +65,7 @@ procedure
wtt_activate_messages(integer); wtt_activate_messages(integer);
wtt_activate_openplc(integer); wtt_activate_openplc(integer);
wtt_activate_showcrossref(integer); wtt_activate_showcrossref(integer);
wtt_activate_updateclasses(integer);
wtt_activate_change_value(integer); wtt_activate_change_value(integer);
wtt_activate_command(integer); wtt_activate_command(integer);
wtt_activate_zoom_in(integer); wtt_activate_zoom_in(integer);
...@@ -854,6 +855,21 @@ object functions_entry : XmCascadeButton ...@@ -854,6 +855,21 @@ object functions_entry : XmCascadeButton
}; };
}; };
XmPushButton XmPushButton
{
arguments
{
XmNlabelString = compound_string("Update Classes");
XmNmnemonic = keysym('p');
XmNfontList = menu_font;
XmNuserData = 18;
};
callbacks
{
XmNactivateCallback = procedure wtt_activate_updateclasses(wtt_ctx);
MrmNcreateCallback = procedure wtt_create_menubutton(wtt_ctx);
};
};
XmPushButton
{ {
arguments arguments
{ {
......
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