Commit 402ea828 authored by Claes Sjofors's avatar Claes Sjofors Committed by Christoffer Ackelman

Xtt logging, logging of strings added

parent 6aa8bcfd
...@@ -370,6 +370,7 @@ int XttLogging::logging_set( ...@@ -370,6 +370,7 @@ int XttLogging::logging_set(
case pwr_eType_UInt32: case pwr_eType_UInt32:
case pwr_eType_Int64: case pwr_eType_Int64:
case pwr_eType_UInt64: case pwr_eType_UInt64:
case pwr_eType_String:
case pwr_eType_Objid: case pwr_eType_Objid:
case pwr_eType_AttrRef: case pwr_eType_AttrRef:
case pwr_eType_Time: case pwr_eType_Time:
...@@ -1105,6 +1106,9 @@ static void *xtt_logproc( void *arg) ...@@ -1105,6 +1106,9 @@ static void *xtt_logproc( void *arg)
case pwr_eType_UInt64: case pwr_eType_UInt64:
char_cnt += logg->log_print( " %llu", *(pwr_tUInt64 *)value_ptr); char_cnt += logg->log_print( " %llu", *(pwr_tUInt64 *)value_ptr);
break; break;
case pwr_eType_String:
char_cnt += logg->log_print( " %s", value_ptr);
break;
case pwr_eType_Objid: case pwr_eType_Objid:
objid = *(pwr_tObjid *)value_ptr; objid = *(pwr_tObjid *)value_ptr;
if ( !objid.oix) if ( !objid.oix)
...@@ -1320,9 +1324,9 @@ static void *xtt_logproc( void *arg) ...@@ -1320,9 +1324,9 @@ static void *xtt_logproc( void *arg)
*(pwr_tUInt64 *)value_ptr; *(pwr_tUInt64 *)value_ptr;
} }
break; break;
case pwr_eType_Int64: case pwr_eType_String:
if ( (*(pwr_tInt64 *)value_ptr != if ( strncmp( value_ptr, old_value_ptr, sizeof(logg->old_value[0])) != 0 ||
*(pwr_tInt64 *)old_value_ptr) || first_scan) first_scan)
{ {
/* Value is changed, print */ /* Value is changed, print */
time_AtoAscii( &time, time_eFormat_DateAndTime, time_AtoAscii( &time, time_eFormat_DateAndTime,
...@@ -1330,9 +1334,8 @@ static void *xtt_logproc( void *arg) ...@@ -1330,9 +1334,8 @@ static void *xtt_logproc( void *arg)
logg->log_print( "%s", &time_str); logg->log_print( "%s", &time_str);
logg->log_print( " %s", logg->log_print( " %s",
&(logg->parameterstr[i])); &(logg->parameterstr[i]));
logg->log_print( " %lld\n", *(pwr_tInt64 *)value_ptr); logg->log_print( " %s\n", value_ptr);
*(pwr_tInt64 *)old_value_ptr = strncpy( old_value_ptr, value_ptr, sizeof(logg->old_value[0]));
*(pwr_tInt64 *)value_ptr;
} }
break; break;
case pwr_eType_Objid: case pwr_eType_Objid:
......
...@@ -81,7 +81,7 @@ class XttLogging { ...@@ -81,7 +81,7 @@ class XttLogging {
float logg_time; float logg_time;
pwr_tFileName logg_filename; pwr_tFileName logg_filename;
FILE *logg_file; FILE *logg_file;
char old_value[RTT_LOGG_MAXPAR][8]; char old_value[RTT_LOGG_MAXPAR][80];
pwr_tTime starttime; pwr_tTime starttime;
#if defined OS_POSIX #if defined OS_POSIX
pthread_t thread; pthread_t thread;
......
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