Commit d0aa3bde authored by Claes Sjofors's avatar Claes Sjofors

Time, possible to set NotATime and NotADeltaTime for test purposes

parent 7cbe4284
......@@ -866,6 +866,10 @@ pwr_tStatus time_AsciiToD(const char* tstr, pwr_tDeltaTime* ts)
int day, hour = 0, min, sec, hun = 0;
int useday = 1;
if ( streq( tstr, "NotADeltaTime")) {
*ts = pwr_cNotADeltaTime;
return TIME__SUCCESS;
}
strncpy(buf, tstr, sizeof(buf) - 1);
buf[sizeof(buf) - 1] = '\0';
sp = buf;
......@@ -924,6 +928,10 @@ pwr_tStatus time_AsciiToA(const char* tstr, pwr_tTime* ts)
char buf[64];
pwr_tStatus sts;
if ( streq( tstr, "NotATime")) {
*ts = pwr_cNotATime;
return TIME__SUCCESS;
}
strncpy(buf, tstr, sizeof(buf) - 1);
buf[sizeof(buf) - 1] = '\0';
......
......@@ -44,7 +44,7 @@ SObject pwrb:Class
! Subtract two absolute times.
! @image orm_atsub_fo.gif
!
! AtAdd subtracts the second absolute time input from the first absolute time
! AtSub subtracts the second absolute time input from the first absolute time
! input.
!
! The inputs has to be connected to absolute times.
......
......@@ -41,6 +41,7 @@
#include "co_msg.h"
#include "co_string.h"
#include "co_time.h"
#include "co_time_msg.h"
#include "cow_login.h"
......@@ -494,7 +495,7 @@ void wnav_attrvalue_to_string(
else {
sts = time_AtoAscii(
(pwr_tTime*)value_ptr, time_eFormat_DateAndTime, str, sizeof(str));
if (EVEN(sts))
if (EVEN(sts) && sts != TIME__NAT)
strcpy(str, "-");
}
*len = strlen(str);
......@@ -508,7 +509,7 @@ void wnav_attrvalue_to_string(
strcpy(str, "DtMax");
else {
sts = time_DtoAscii((pwr_tDeltaTime*)value_ptr, 1, str, sizeof(str));
if (EVEN(sts))
if (EVEN(sts) && sts != TIME__NADT)
strcpy(str, "Undefined time");
}
*len = strlen(str);
......
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