• MobileTests.cs
- Pre test now checks firmware and adds the label dynamically to the panel • AiQ_GUI.Designer.cs - Added CbBxCameraModel.SelectedIndexChanged to properly wire UI element. • Microsoft/StatsExcel.cs - Improved workbook loading error handling to distinguish between corruption and file access issues.
This commit is contained in:
@@ -40,7 +40,7 @@ namespace AiQ_GUI
|
||||
const string selectColumns = @"
|
||||
ModelNumber,
|
||||
[Total Tests Run],
|
||||
[Pre Tests Passed]
|
||||
[Pre Tests Passed],
|
||||
[Pre Tests Failed],
|
||||
[Final Tests Passed],
|
||||
[Final Tests Failed],
|
||||
@@ -84,8 +84,28 @@ namespace AiQ_GUI
|
||||
XLWorkbook workbook;
|
||||
if (File.Exists(exportPath))
|
||||
{
|
||||
workbook = new XLWorkbook(exportPath);
|
||||
MainForm.Instance.AddToActionsList("Opened existing workbook.");
|
||||
try
|
||||
{
|
||||
workbook = new XLWorkbook(exportPath);
|
||||
MainForm.Instance.AddToActionsList("Opened existing workbook.");
|
||||
}
|
||||
catch (Exception loadEx)
|
||||
{
|
||||
// Workbook is corrupted, backup the old file and create a new one
|
||||
string backupPath = exportPath + ".corrupted_" + DateTime.Now.ToString("yyyyMMdd_HHmmss");
|
||||
try
|
||||
{
|
||||
File.Move(exportPath, backupPath, overwrite: true);
|
||||
MainForm.Instance.AddToActionsList($"WARNING: Existing workbook was corrupted. Backed up to: {backupPath}");
|
||||
}
|
||||
catch (Exception backupEx)
|
||||
{
|
||||
MainForm.Instance.AddToActionsList($"WARNING: Could not backup corrupted workbook. Details: {backupEx.Message}");
|
||||
}
|
||||
|
||||
workbook = new XLWorkbook();
|
||||
MainForm.Instance.AddToActionsList("Created new workbook (previous file was corrupted).");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user