Commit b4f5ed5d authored by Claes Sjofors's avatar Claes Sjofors

Xtt logging, default filename and button names changed, entry cleared before restore

parent 2abf9449
...@@ -542,6 +542,7 @@ int XttLogging::store( ...@@ -542,6 +542,7 @@ int XttLogging::store(
fprintf( outfile, "logging set/create/entry=current/file=\"%s\"\n", fprintf( outfile, "logging set/create/entry=current/file=\"%s\"\n",
logg_filename); logg_filename);
fprintf( outfile, "logging delete/entry=current/all\n");
if ( logg_time != 0) if ( logg_time != 0)
fprintf( outfile, "logging set/entry=current/time=%f\n", fprintf( outfile, "logging set/entry=current/time=%f\n",
logg_time); logg_time);
...@@ -848,24 +849,28 @@ int XttLogging::remove( char *parameter) ...@@ -848,24 +849,28 @@ int XttLogging::remove( char *parameter)
int i; int i;
int found; int found;
/* Remove this parameter */ if ( parameter) {
found = 0; /* Remove this parameter */
for ( i = 0; i < RTT_LOGG_MAXPAR; i++) found = 0;
{ for ( i = 0; i < RTT_LOGG_MAXPAR; i++) {
if ( strcmp( parameterstr[i], parameter) == 0) if ( cdh_NoCaseStrcmp( parameterstr[i], parameter) == 0) {
{ /* Parmeter is found, remove it */
/* Parmeter is found, remove it */ parameterstr[i][0] = 0;
parameterstr[i][0] = 0; message('I', "Parameter removed");
message('I', "Parameter removed"); found = 1;
found = 1; break;
break; }
} }
} }
if ( !found) if ( !found) {
{
message('E',"Parameter not found"); message('E',"Parameter not found");
return XNAV__HOLDCOMMAND; return XNAV__HOLDCOMMAND;
} }
else {
/* Clear all parameters */
for ( i = 0; i < RTT_LOGG_MAXPAR; i++)
parameterstr[i][0] = 0;
}
return XNAV__SUCCESS; return XNAV__SUCCESS;
} }
......
...@@ -1318,6 +1318,9 @@ XNav::XNav( ...@@ -1318,6 +1318,9 @@ XNav::XNav(
strcpy( opplace_name, xn_opplace_name); strcpy( opplace_name, xn_opplace_name);
strcpy( base_user, ""); strcpy( base_user, "");
strcpy( user, ""); strcpy( user, "");
for ( int i = 0; i < XNAV_LOGG_MAX; i++)
sprintf(logg[i].logg_filename, "rtt_logging%d.rtt_log", i+1);
*status = 1; *status = 1;
} }
...@@ -3124,34 +3127,34 @@ int XNav::show_logging( int index) ...@@ -3124,34 +3127,34 @@ int XNav::show_logging( int index)
(void *) &logg[index].active, NULL, flow_eDest_IntoLast); (void *) &logg[index].active, NULL, flow_eDest_IntoLast);
sprintf( command, "logging set/insert/entry=%d", entry); sprintf( command, "logging set/insert/entry=%d", entry);
new ItemCommand( brow, Lng::translate("Insert"), 0, NULL, new ItemCommand( brow, Lng::translate("Insert collected parameters"), 0, NULL,
flow_eDest_IntoLast, command, 0, brow->pixmap_action); flow_eDest_IntoLast, command, 0, brow->pixmap_action);
sprintf( command, "logging start/entry=%d", entry); sprintf( command, "logging start/entry=%d", entry);
new ItemCommand( brow, Lng::translate("Start"), 0, NULL, new ItemCommand( brow, Lng::translate("Start logging"), 0, NULL,
flow_eDest_IntoLast, command, 0, brow->pixmap_action); flow_eDest_IntoLast, command, 0, brow->pixmap_action);
sprintf( command, "logging stop/entry=%d", entry); sprintf( command, "logging stop/entry=%d", entry);
new ItemCommand( brow, Lng::translate("Stop"), 0, NULL, new ItemCommand( brow, Lng::translate("Stop logging"), 0, NULL,
flow_eDest_IntoLast, command, 0, brow->pixmap_action); flow_eDest_IntoLast, command, 0, brow->pixmap_action);
sprintf( command, "logging store/entry=%d/file=\"rtt_store_logg%d.rtt_com\"", sprintf( command, "logging store/entry=%d/file=\"rtt_store_logg%d.rtt_com\"",
entry, entry); entry, entry);
new ItemCommand( brow, Lng::translate("Store"), 0, NULL, new ItemCommand( brow, Lng::translate("Store settings"), 0, NULL,
flow_eDest_IntoLast, command, 0, brow->pixmap_action); flow_eDest_IntoLast, command, 0, brow->pixmap_action);
sprintf( command, "@rtt_store_logg%d", entry); sprintf( command, "@rtt_store_logg%d", entry);
new ItemCommand( brow, Lng::translate("Restore"), 0, NULL, new ItemCommand( brow, Lng::translate("Restore settings"), 0, NULL,
flow_eDest_IntoLast, command, 0, brow->pixmap_action); flow_eDest_IntoLast, command, 0, brow->pixmap_action);
sprintf( command, "open loggfile/entry=current"); sprintf( command, "open loggfile/entry=current");
new ItemCommand( brow, Lng::translate("ShowFile"), 0, NULL, new ItemCommand( brow, Lng::translate("Show curve"), 0, NULL,
flow_eDest_IntoLast, command, 0, brow->pixmap_action); flow_eDest_IntoLast, command, 0, brow->pixmap_action);
new ItemLocal( brow, Lng::translate("Time (ms)"), "logg_Time", new ItemLocal( brow, Lng::translate("Scantime (ms)"), "logg_Time",
pwr_eType_Float32, sizeof( logg[0].logg_time), 0, 100000, 0, pwr_eType_Float32, sizeof( logg[0].logg_time), 0, 100000, 0,
(void *) &logg[index].logg_time, NULL, flow_eDest_IntoLast); (void *) &logg[index].logg_time, NULL, flow_eDest_IntoLast);
new ItemLocal( brow, Lng::translate("File "), "logg_File", new ItemLocal( brow, Lng::translate("Log file "), "logg_File",
pwr_eType_String, sizeof( logg[0].logg_filename), 0, 0, 0, pwr_eType_String, sizeof( logg[0].logg_filename), 0, 0, 0,
(void *) logg[index].logg_filename, NULL, flow_eDest_IntoLast); (void *) logg[index].logg_filename, NULL, flow_eDest_IntoLast);
new ItemLocal( brow, Lng::translate("Type"), "logg_Type", new ItemLocal( brow, Lng::translate("Type"), "logg_Type",
......
...@@ -6043,18 +6043,24 @@ static int xnav_logging_func( void *client_data, ...@@ -6043,18 +6043,24 @@ static int xnav_logging_func( void *client_data,
int entry; int entry;
int nr; int nr;
if ( ODD( dcli_get_qualifier( "/ENTRY", entry_str, sizeof(entry_str)))) if ( ODD( dcli_get_qualifier( "/ENTRY", entry_str, sizeof(entry_str)))) {
{ if ( !cdh_NoCaseStrcmp( entry_str, "CURRENT")) {
/* convert to integer */ if ( xnav->current_logging_index == -1) {
nr = sscanf( entry_str, "%d", &entry); xnav->message('E', "No current logging entry");
if ( nr != 1) return XNAV__HOLDCOMMAND;
{ }
xnav->message('E', "Entry syntax error"); entry = xnav->current_logging_index + 1;
return XNAV__HOLDCOMMAND; }
else {
/* convert to integer */
nr = sscanf( entry_str, "%d", &entry);
if ( nr != 1) {
xnav->message('E', "Entry syntax error");
return XNAV__HOLDCOMMAND;
}
} }
} }
else else {
{
xnav->message('E',"Enter entry"); xnav->message('E',"Enter entry");
return XNAV__HOLDCOMMAND; return XNAV__HOLDCOMMAND;
} }
...@@ -6064,12 +6070,15 @@ static int xnav_logging_func( void *client_data, ...@@ -6064,12 +6070,15 @@ static int xnav_logging_func( void *client_data,
return XNAV__HOLDCOMMAND; return XNAV__HOLDCOMMAND;
} }
if ( ODD( dcli_get_qualifier( "/PARAMETER", parameter_str, sizeof(parameter_str)))) if ( ODD( dcli_get_qualifier( "/ALL", 0, 0)))
parameter_ptr = 0;
else if ( ODD( dcli_get_qualifier( "/PARAMETER", parameter_str, sizeof(parameter_str))))
parameter_ptr = parameter_str; parameter_ptr = parameter_str;
else else
return XNAV__SUCCESS; return XNAV__SUCCESS;
sts = xnav->logg[entry-1].remove( parameter_ptr); sts = xnav->logg[entry-1].remove( parameter_ptr);
return sts; return sts;
} }
......
...@@ -109,19 +109,20 @@ E 1.1.103 "Event Log" ...@@ -109,19 +109,20 @@ E 1.1.103 "Event Log"
# #
# Logging entry # Logging entry
E 1.2.1 "Active" E 1.2.1 "Active"
E 1.2.2 "Insert" E 1.2.2 "Insert collected parameters"
E 1.2.3 "Start" E 1.2.3 "Start logging"
E 1.2.4 "Stop" E 1.2.4 "Stop logging"
E 1.2.5 "Restore" E 1.2.5 "Restore settings"
E 1.2.6 "ShowFile" E 1.2.6 "Show curve"
E 1.2.7 "Time (ms)" E 1.2.7 "Scantime (ms)"
E 1.2.8 "File " E 1.2.8 "Log file "
E 1.2.9 "Type" E 1.2.9 "Type"
E 1.2.10 "BufferSize" E 1.2.10 "BufferSize"
E 1.2.11 "FullBufferStop" E 1.2.11 "FullBufferStop"
E 1.2.12 "ShortName" E 1.2.12 "ShortName"
E 1.2.13 "Parameter" E 1.2.13 "Parameter"
E 1.2.14 "ConditionParameter" E 1.2.14 "Condition"
E 1.2.15 "Store settings"
# #
# Alarm blocking # Alarm blocking
E 1.3.1 "Blocked Alarms" E 1.3.1 "Blocked Alarms"
......
...@@ -109,19 +109,20 @@ E 1.1.103 "H ...@@ -109,19 +109,20 @@ E 1.1.103 "H
# #
# Logging entry # Logging entry
E 1.2.1 "Aktiv" E 1.2.1 "Aktiv"
E 1.2.2 "LggIn" E 1.2.2 "Lgg in samlade parametrar"
E 1.2.3 "Starta" E 1.2.3 "Starta loggning"
E 1.2.4 "Stoppa" E 1.2.4 "Stoppa loggning"
E 1.2.5 "terskapa" E 1.2.5 "terskapa uppsttning"
E 1.2.6 "VisaFil" E 1.2.6 "Visa kurva"
E 1.2.7 "Tid (ms)" E 1.2.7 "Skanntid (ms)"
E 1.2.8 "Fil" E 1.2.8 "Loggfil"
E 1.2.9 "Typ" E 1.2.9 "Typ"
E 1.2.10 "BufferStorlek" E 1.2.10 "BufferStorlek"
E 1.2.11 "FullBufferStopp" E 1.2.11 "FullBufferStopp"
E 1.2.12 "KortNamn" E 1.2.12 "KortNamn"
E 1.2.13 "Parameter" E 1.2.13 "Parameter"
E 1.2.14 "VillkorsParameter" E 1.2.14 "Villkor"
E 1.2.15 "Lagra uppsttning"
# #
# Alarm Blocking # Alarm Blocking
E 1.3.1 "Blockerade larm" E 1.3.1 "Blockerade larm"
......
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