Make EDID detection robust

Modified EDID detection to make it more
robust and to report what went wrong in
the logs in more detail. Aids in #16
This commit is contained in:
Terry MacDonald
2021-05-19 21:32:49 +12:00
parent a4db4b39b7
commit 2096322cf0
3 changed files with 96 additions and 20 deletions

View File

@ -511,14 +511,20 @@ namespace DisplayMagicianShared
int validDisplayCount = 0;
//validDisplayCount = (from connectedDisplay in ProfileRepository.ConnectedDisplayIdentifiers select connectedDisplay == profileDisplayIdentifier).Count();
foreach (string profileDisplayIdentifier in ProfileDisplayIdentifiers)
{
// If this profile has a display that isn't currently available then we need to say it's a no!
//if (ProfileRepository.ConnectedDisplayIdentifiers.Contains(profileDisplayIdentifier))
//validDisplayCount = (from connectedDisplay in ProfileRepository.ConnectedDisplayIdentifiers select connectedDisplay == profileDisplayIdentifier).Count();
if (ProfileRepository.ConnectedDisplayIdentifiers.Any(s => profileDisplayIdentifier.Equals(s)))
{
SharedLogger.logger.Trace($"ProfileItem/RefreshPossbility: We found the display in the profile {Name} with profileDisplayIdentifier {profileDisplayIdentifier} is connected now.");
validDisplayCount++;
}
else
{
SharedLogger.logger.Warn($"ProfileItem/RefreshPossbility: We found the display in the profile {Name} with profileDisplayIdentifier {profileDisplayIdentifier} is NOT currently connected, so this profile cannot be used.");
}
}
if (validDisplayCount == ProfileDisplayIdentifiers.Count)
{