private void BUT_doit_Click(object sender, EventArgs e)
{
string dirPictures = TXT_jpgdir.Text;
string logFilePath = TXT_logfile.Text;
if (!File.Exists(logFilePath))
return;
if (!Directory.Exists(dirPictures))
return;
float seconds = 0;
if (selectedProcessingMode == PROCESSING_MODE.TIME_OFFSET)
{
if (float.TryParse(TXT_offsetseconds.Text, NumberStyles.Float, CultureInfo.InvariantCulture, out seconds) == false)
{
TXT_outputlog.AppendText("Offset number not in correct format. Use . as decimal separator\n");
return;
}
}
BUT_doit.Enabled = false;
TXT_outputlog.Clear();
try
{
switch (selectedProcessingMode)
{
case PROCESSING_MODE.TIME_OFFSET:
picturesInfo = doworkGPSOFFSET(logFilePath, dirPictures, seconds);
if (picturesInfo != null)
CreateReportFiles(picturesInfo, dirPictures, seconds);
break;
case PROCESSING_MODE.CAM_MSG:
{
picturesInfo = doworkCAM(logFilePath, dirPictures);
if (picturesInfo != null)
CreateReportFiles(picturesInfo, dirPictures, seconds);
break;
}
}
}
catch (Exception ex) { TXT_outputlog.AppendText("Error " + ex.ToString()); }
BUT_doit.Enabled = true;
BUT_Geotagimages.Enabled = true;
}