Add Reset and Detect buttons to Config dialog
- Reset button: clears custom labels, unhides all ports, removes discovered ports - Detect button: tries common VCP 60 values to discover available input ports - Version bumped to 1.1.2 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -39,17 +39,21 @@ public static class CMMCommand
|
||||
CMMexe,
|
||||
$"/GetValue {monitorSN} {vcpCode}");
|
||||
|
||||
// Empty result means timeout - don't retry, monitor is unresponsive
|
||||
if (string.IsNullOrEmpty(output) && exitCode == -1)
|
||||
// Timeout
|
||||
if (exitCode == -1)
|
||||
return string.Empty;
|
||||
|
||||
// Parse output - ControlMyMonitor outputs the value directly
|
||||
var value = output?.Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries).LastOrDefault()?.Trim();
|
||||
// ControlMyMonitor returns the value as the exit code
|
||||
// Exit code > 0 means success with that value
|
||||
if (exitCode > 0)
|
||||
return exitCode.ToString();
|
||||
|
||||
if (!string.IsNullOrEmpty(value) && exitCode == 0)
|
||||
// Also check stdout in case it outputs there
|
||||
var value = output?.Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries).LastOrDefault()?.Trim();
|
||||
if (!string.IsNullOrEmpty(value) && value != "0")
|
||||
return value;
|
||||
|
||||
// Only retry on non-timeout failures
|
||||
// Only retry on failure
|
||||
if (attempt < maxRetries)
|
||||
await Task.Delay(300);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user