aboutsummaryrefslogtreecommitdiffstats
path: root/Projects
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2013-07-16 20:02:33 +0200
committerDean Camera <dean@fourwalledcubicle.com>2013-07-16 20:02:33 +0200
commita899ee0cf4e48d8a2a4dd513ebe2676e15962eb1 (patch)
treed9f98ad2a0910eed00edda59a85c5b7e67343020 /Projects
parent7cd9e0dbc45afa4b047711d5dc255f4850e80c6b (diff)
downloadlufa-a899ee0cf4e48d8a2a4dd513ebe2676e15962eb1.tar.gz
lufa-a899ee0cf4e48d8a2a4dd513ebe2676e15962eb1.tar.bz2
lufa-a899ee0cf4e48d8a2a4dd513ebe2676e15962eb1.zip
Fixed incorrect time/date configuration data order in the TempDataLogger host application.
Diffstat (limited to 'Projects')
-rw-r--r--Projects/TempDataLogger/TempLogHostApp/DataLoggerSettings.cs37
1 files changed, 22 insertions, 15 deletions
diff --git a/Projects/TempDataLogger/TempLogHostApp/DataLoggerSettings.cs b/Projects/TempDataLogger/TempLogHostApp/DataLoggerSettings.cs
index 01e9fb6e7..c3d1e1564 100644
--- a/Projects/TempDataLogger/TempLogHostApp/DataLoggerSettings.cs
+++ b/Projects/TempDataLogger/TempLogHostApp/DataLoggerSettings.cs
@@ -31,12 +31,12 @@ namespace Project1HostApp
{
Byte[] Report = new Byte[7];
- Report[0] = this.Day;
- Report[1] = this.Month;
- Report[2] = this.Year;
- Report[3] = this.Hour;
- Report[4] = this.Minute;
- Report[5] = this.Second;
+ Report[0] = this.Hour;
+ Report[1] = this.Minute;
+ Report[2] = this.Second;
+ Report[3] = this.Day;
+ Report[4] = this.Month;
+ Report[5] = this.Year;
Report[6] = this.LogInterval500MS;
return Report;
@@ -44,12 +44,12 @@ namespace Project1HostApp
public void FromReport(Byte[] Report)
{
- this.Day = Report[0];
- this.Month = Report[1];
- this.Year = Report[2];
- this.Hour = Report[3];
- this.Minute = Report[4];
- this.Second = Report[5];
+ this.Hour = Report[0];
+ this.Minute = Report[1];
+ this.Second = Report[2];
+ this.Day = Report[3];
+ this.Month = Report[4];
+ this.Year = Report[5];
this.LogInterval500MS = Report[6];
}
};
@@ -127,14 +127,15 @@ namespace Project1HostApp
ConnectionHandle.Read(0x00, Report);
DeviceReport.FromReport(Report);
+ String msgText = "Device parameters retrieved successfully.";
try
{
dtpDate.Value = new DateTime(
(2000 + DeviceReport.Year),
DeviceReport.Month,
- DeviceReport.Day);
-
+ DeviceReport.Day);
+
dtpTime.Value = new DateTime(
DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day,
DeviceReport.Hour,
@@ -143,6 +144,12 @@ namespace Project1HostApp
}
catch (Exception ex)
{
+ msgText = "Problem reading device:\n" +
+ ex.Message +
+ "\nY:" + DeviceReport.Year.ToString() +
+ " M:" + DeviceReport.Month.ToString() +
+ " D:" + DeviceReport.Day.ToString() +
+ "\n\nUsing current date and time.";
dtpDate.Value = DateTime.Now;
dtpTime.Value = DateTime.Now;
}
@@ -156,7 +163,7 @@ namespace Project1HostApp
nudLogInterval.Value = nudLogInterval.Minimum;
}
- MessageBox.Show("Device parameters retrieved successfully.");
+ MessageBox.Show(msgText);
}
catch (Exception ex)
{