Commit 4acf065b authored by Marcus Nordenberg's avatar Marcus Nordenberg

Merge branch 'set-attribute-ignore-missing-feature'

parents dd4ccca3 815e0c1c
...@@ -167,6 +167,7 @@ uted_sCommand WUted::commands[ UTED_MAX_COMMANDS ] = { ...@@ -167,6 +167,7 @@ uted_sCommand WUted::commands[ UTED_MAX_COMMANDS ] = {
{"Attribute", 0, 0, 1, 0, UTED_QUAL_QUAL}, {"Attribute", 0, 0, 1, 0, UTED_QUAL_QUAL},
{"Value", 0, 0, 1, 0, UTED_QUAL_QUAL}, {"Value", 0, 0, 1, 0, UTED_QUAL_QUAL},
{"Noconfirm", 0, 0, 0, 1, UTED_QUAL_QUAL}, {"Noconfirm", 0, 0, 0, 1, UTED_QUAL_QUAL},
{"IgnoreMissing", 0, 0, 0, 1, UTED_QUAL_QUAL},
{"Log", 0, 0, 0, 1, UTED_QUAL_QUAL}, {"Log", 0, 0, 0, 1, UTED_QUAL_QUAL},
{"Output", 0, 0, 1, 0, UTED_QUAL_QUAL}, {"Output", 0, 0, 1, 0, UTED_QUAL_QUAL},
{"",}}}, {"",}}},
......
...@@ -153,6 +153,7 @@ typedef struct { ...@@ -153,6 +153,7 @@ typedef struct {
FILE *output_file; FILE *output_file;
int terminal; int terminal;
int confirm; int confirm;
int ignore_missing;
int log; int log;
int append; int append;
int page; int page;
...@@ -3313,7 +3314,8 @@ int utl_set_object_parameter ( ...@@ -3313,7 +3314,8 @@ int utl_set_object_parameter (
int terminal, int terminal,
const char *filename, const char *filename,
int confirm, int confirm,
int log int log,
int ignore_missing
) )
{ {
utl_ctx utlctx; utl_ctx utlctx;
...@@ -3416,6 +3418,7 @@ int utl_set_object_parameter ( ...@@ -3416,6 +3418,7 @@ int utl_set_object_parameter (
} }
utl_ctx_new( &utlctx, ldhses, "", UTL_PORTRAIT); utl_ctx_new( &utlctx, ldhses, "", UTL_PORTRAIT);
utlctx->confirm = confirm; utlctx->confirm = confirm;
utlctx->ignore_missing = ignore_missing;
utlctx->log = log; utlctx->log = log;
sts = u_open( utlctx, filename, terminal, 0); sts = u_open( utlctx, filename, terminal, 0);
if ( EVEN(sts)) if ( EVEN(sts))
...@@ -3444,6 +3447,7 @@ int utl_set_object_parameter ( ...@@ -3444,6 +3447,7 @@ int utl_set_object_parameter (
/* Open file */ /* Open file */
utl_ctx_new( &utlctx, ldhses, "", UTL_PORTRAIT); utl_ctx_new( &utlctx, ldhses, "", UTL_PORTRAIT);
utlctx->confirm = confirm; utlctx->confirm = confirm;
utlctx->ignore_missing = ignore_missing;
utlctx->log = log; utlctx->log = log;
sts = u_open( utlctx, filename, terminal, 0); sts = u_open( utlctx, filename, terminal, 0);
if ( EVEN(sts)) if ( EVEN(sts))
...@@ -5676,7 +5680,8 @@ static int utl_set_parameter ( ...@@ -5676,7 +5680,8 @@ static int utl_set_parameter (
sts = ldh_NameToAttrRef( ldhses, aname, &aref); sts = ldh_NameToAttrRef( ldhses, aname, &aref);
if ( EVEN(sts)) return sts; if ( EVEN(sts) && utlctx->ignore_missing) return FOE__SUCCESS; //Just ignore this and continue to the next child
else if (EVEN(sts)) return sts;
sts = ldh_AttrRefToName( ldhses, &aref, cdh_mNName, &np,&size); sts = ldh_AttrRefToName( ldhses, &aref, cdh_mNName, &np,&size);
if ( EVEN(sts)) return sts; if ( EVEN(sts)) return sts;
...@@ -5991,7 +5996,12 @@ static int utl_set_parameter ( ...@@ -5991,7 +5996,12 @@ static int utl_set_parameter (
/* Set the parameter */ /* Set the parameter */
sts = ldh_WriteAttribute( ldhses, &aref, object_par, parsize); sts = ldh_WriteAttribute( ldhses, &aref, object_par, parsize);
if ( EVEN(sts)) return sts; if (EVEN(sts))
{
printf( "FEL: sts=%d\n", sts);
printf( "FEL2: utlctx->ignore_missing=%d\n", utlctx->ignore_missing);
}
if (EVEN(sts)) return sts;
/* Specific updates for grafcet orders */ /* Specific updates for grafcet orders */
sts = vldh_object_update_spec( ldhses, objid); sts = vldh_object_update_spec( ldhses, objid);
......
...@@ -142,7 +142,8 @@ int utl_set_object_parameter ( ...@@ -142,7 +142,8 @@ int utl_set_object_parameter (
int terminal, int terminal,
const char *filename, const char *filename,
int confirm, int confirm,
int log int log,
int ignore_missing = 0
); );
int utl_show_obj_hier_class_name ( int utl_show_obj_hier_class_name (
......
...@@ -407,7 +407,7 @@ dcli_tCmdTable wnav_command_table[] = { ...@@ -407,7 +407,7 @@ dcli_tCmdTable wnav_command_table[] = {
"/CLASS", "/HIERARCHY", "/NAME", "/ATTRIBUTE", "/CLASS", "/HIERARCHY", "/NAME", "/ATTRIBUTE",
"/SIGNALOBJECTSEG", "/SIGCHANCONSEG", "/SIGNALOBJECTSEG", "/SIGCHANCONSEG",
"/SHOSIGCHANCON", "/SHODETECTTEXT", "/VOLUMENAME", "/SHOSIGCHANCON", "/SHODETECTTEXT", "/VOLUMENAME",
"/VALUE", "/SOURCE", "/MODAL", ""} "/VALUE", "/SOURCE", "/MODAL", "/IGNOREMISSING", ""}
}, },
{ {
"SETUP", "SETUP",
...@@ -1558,6 +1558,7 @@ static int wnav_set_func( void *client_data, ...@@ -1558,6 +1558,7 @@ static int wnav_set_func( void *client_data,
int sts_class, sts_hier, sts_name; int sts_class, sts_hier, sts_name;
pwr_tStatus sts; pwr_tStatus sts;
int confirm; int confirm;
int ignore_missing;
int log; int log;
if ( !wnav->editmode) if ( !wnav->editmode)
...@@ -1578,6 +1579,7 @@ static int wnav_set_func( void *client_data, ...@@ -1578,6 +1579,7 @@ static int wnav_set_func( void *client_data,
} }
confirm = EVEN( dcli_get_qualifier( "/NOCONFIRM", 0, 0)); confirm = EVEN( dcli_get_qualifier( "/NOCONFIRM", 0, 0));
ignore_missing = ODD( dcli_get_qualifier( "/IGNOREMISSING", 0, 0));
log = ODD( dcli_get_qualifier( "/LOG", 0, 0)); log = ODD( dcli_get_qualifier( "/LOG", 0, 0));
if (( sts_class = ODD( dcli_get_qualifier( "/CLASS" , classstr, sizeof(classstr))))) if (( sts_class = ODD( dcli_get_qualifier( "/CLASS" , classstr, sizeof(classstr)))))
...@@ -1606,7 +1608,7 @@ static int wnav_set_func( void *client_data, ...@@ -1606,7 +1608,7 @@ static int wnav_set_func( void *client_data,
{ {
sts = utl_set_object_parameter sts = utl_set_object_parameter
( wnav->ldhses, hierstr_p , classstr_p ,namestr_p, parameterstr, ( wnav->ldhses, hierstr_p , classstr_p ,namestr_p, parameterstr,
valuestr_p, termflg , file, confirm, log); valuestr_p, termflg , file, confirm, log, ignore_missing);
if ( EVEN(sts)) if ( EVEN(sts))
wnav->message(' ', wnav_get_message(sts)); wnav->message(' ', wnav_get_message(sts));
return sts; return sts;
......
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