Skip to content

Commit

Permalink
Fixed invalid date error reporter by Anders F.
Browse files Browse the repository at this point in the history
  • Loading branch information
grodansparadis committed May 12, 2016
1 parent e1dd9d7 commit baf6b95
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 116 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -196,3 +196,4 @@ src/vscp/drivers/level2/sim/linux/test
/src/vscp/daemon/win32/service/vscpsrv.sdf
/src/vscp/.vs/vscp_project/v14/*.suo
/src/vscp/*.opendb
/config_examples/web/browse.VC.db
6 changes: 3 additions & 3 deletions config_examples/vscpd32.conf_windows_distro
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@
<!-- zone/subzone server use -->
<zone>1</zone>
<sub-zone>2</sub-zone>
<!-- sunrise/sunset events data (use comma or period as decimal separator according to your locale) -->
<longitude>15,1604167</longitude>
<latitude>61,7441833</latitude>
<!-- sunrise/sunset events data -->
<longitude>15.1604167</longitude>
<latitude>61.7441833</latitude>
<sunrise enable="true" />
<sunrise-twilight enable="true" />
<sunset enable="true" />
Expand Down
6 changes: 3 additions & 3 deletions config_examples/vscpd64.conf_windows_distro
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,9 @@
<!-- zone/subzone server use -->
<zone>1</zone>
<sub-zone>2</sub-zone>
<!-- sunrise/sunset events data (use comma or period as decimal separator according to your locale) -->
<longitude>15,1604167</longitude>
<latitude>61,7441833</latitude>
<!-- sunrise/sunset events data -->
<longitude>15.1604167</longitude>
<latitude>61.7441833</latitude>
<sunrise enable="true" />
<sunrise-twilight enable="true" />
<sunset enable="true" />
Expand Down
Binary file removed config_examples/web/browse.VC.db
Binary file not shown.
102 changes: 0 additions & 102 deletions config_examples/web/web/index.html

This file was deleted.

7 changes: 6 additions & 1 deletion src/vscp/common/canalsuperwrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5248,7 +5248,12 @@ wxString CCanalSuperWrapper::getAbstractionValueAsString( wxWindow *pwnd,
pdlg,
bLevel2,
bSilent );
strValue = val.FormatISODate();
if ( val.IsValid() ) {
strValue = val.FormatISODate();
}
else {
strValue = _( "00-00-00T00:00:00" );
}
}
break;

Expand Down
2 changes: 1 addition & 1 deletion src/vscp/common/mdf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2671,7 +2671,7 @@ uint32_t CMDF::getNumberOfRegisters( uint32_t page )

uint32_t CMDF::getPages( wxArrayLong& array )
{
bool bFound;
//bool bFound;

MDF_REGISTER_LIST::iterator iterValue;
for ( iterValue = m_list_register.begin();
Expand Down
25 changes: 20 additions & 5 deletions src/vscp/common/vscpvariable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,21 +352,36 @@ bool CVSCPVariable::writeValueToString( wxString& strValueOut )
break;

case VSCP_DAEMON_VARIABLE_CODE_DATETIME:
strValueOut = m_timestamp.FormatISODate();
strValueOut += wxT("T");
strValueOut += m_timestamp.FormatISOTime();
if ( m_timestamp.IsValid() ) {
strValueOut = m_timestamp.FormatISODate();
strValueOut += wxT( "T" );
strValueOut += m_timestamp.FormatISOTime();
}
else {
strValueOut = _("00-00-00T00:00:00");
}
break;

case VSCP_DAEMON_VARIABLE_CODE_BASE64:
strValueOut = m_strValue;
break;

case VSCP_DAEMON_VARIABLE_CODE_DATE:
strValueOut = m_timestamp.FormatISODate();
if ( m_timestamp.IsValid() ) {
strValueOut = m_timestamp.FormatISODate();
}
else {
strValueOut = _( "00-00-00T00:00:00" );
}
break;

case VSCP_DAEMON_VARIABLE_CODE_TIME:
strValueOut = m_timestamp.FormatISOTime();
if ( m_timestamp.IsValid() ) {
strValueOut = m_timestamp.FormatISOTime();
}
else {
strValueOut = _( "00-00-00T00:00:00" );
}
break;

case VSCP_DAEMON_VARIABLE_CODE_UNASSIGNED:
Expand Down
2 changes: 1 addition & 1 deletion src/vscp/daemon/win32/vscpd.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@
<SuppressStartupBanner>true</SuppressStartupBanner>
<WarningLevel>Level3</WarningLevel>
<AdditionalIncludeDirectories>.\;$(OPENSSL64)\include;$(wxwin)\include\msvc;$(WXWIN)\include\;$(LUA64)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>MG_ENABLE_COAP;MG_ENABLE_MQTT_BROKER;_WINSOCK_DEPRECATED_NO_WARNINGS;NS_ENABLE_SSL;NOEMBED_NET_SKELETON;DEBUG;WIN32;_CONSOLE;WINVER=0x0601;_MT;wxUSE_GUI=0;__WXDEBUG__;WXDEBUG=0;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>MG_ENABLE_COAP;MG_ENABLE_MQTT_BROKER;_WINSOCK_DEPRECATED_NO_WARNINGS;NS_ENABLE_SSL;NOEMBED_NET_SKELETON;NDEBUG;WIN32;_CONSOLE;WINVER=0x0601;_MT;wxUSE_GUI=0;WXDEBUG=0;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
<BrowseInformation>true</BrowseInformation>
<PrecompiledHeaderOutputFile>$(OutDir)$(TargetName).pch</PrecompiledHeaderOutputFile>
Expand Down

0 comments on commit baf6b95

Please sign in to comment.