Skip to content

Commit

Permalink
multistep find and deliver + details on error detection
Browse files Browse the repository at this point in the history
  • Loading branch information
jarig committed Feb 1, 2016
1 parent 1a6fade commit bbdd00b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
Binary file not shown.
3 changes: 3 additions & 0 deletions EliteReporter/EliteReporter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,9 @@
<Content Include="Assets\mTypes\MultiStepCourierDelivery.bmp">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Assets\mTypes\MultiStepFindAndDeliver.bmp">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Assets\mTypes\PirateCargo.bmp">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
Expand Down
13 changes: 9 additions & 4 deletions EliteReporter/Forms/ReportForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,12 @@ private void RegisterMission(object source, FileSystemEventArgs e)
{
Trace.TraceInformation("File: " + e.FullPath + " " + e.ChangeType);
Thread.Sleep(500); // wait until file is ready
analyzeScreenShot(e.FullPath);
try {
analyzeScreenShot(e.FullPath);
}catch (Exception ex)
{
toolStripStatusLabel1.Text = "Error during screen analysis: " + ex.Message;
}
}

private void analyzeScreenShot(string pathToBmp)
Expand All @@ -73,13 +78,13 @@ private void analyzeScreenShot(string pathToBmp)
if (existingLvItem != null)
{
//finshing mission
if (((MissionInfo)existingLvItem.Tag).MissionTakenDateTime.Value.Add(takenMisisonCoolDown) < DateTime.UtcNow)
if (((MissionInfo)existingLvItem.Tag).MissionTakenDateTime.Value.Add(takenMisisonCoolDown) < DateTime.Now)
{
var edProfile = edapi.getProfile();
var missionInfo = (MissionInfo)existingLvItem.Tag;
if (missionInfo.MissionFinishedEDProfile == null)
{
missionInfo.MissionFinishedDateTime = DateTime.UtcNow;
missionInfo.MissionFinishedDateTime = DateTime.Now;
missionInfo.MissionFinishedEDProfile = edProfile;
fillMissionListViewItem(existingLvItem, missionInfo);
}
Expand All @@ -96,7 +101,7 @@ private void analyzeScreenShot(string pathToBmp)
var edProfile = edapi.getProfile();
if (string.IsNullOrEmpty(commanderName))
commanderName = edProfile.CommanderName;
result.MissionTakenDateTime = DateTime.UtcNow;
result.MissionTakenDateTime = DateTime.Now;
result.MissionTakenEDProfile = edProfile;
ListViewItem lvItem = new ListViewItem();
lvItem.Tag = result;
Expand Down

0 comments on commit bbdd00b

Please sign in to comment.