mirror of
https://github.com/fasteddy516/SimplySerial.git
synced 2024-11-24 10:04:35 +00:00
clean up display of unknown pid/vid
This commit is contained in:
parent
3ce3ae3100
commit
8e2ddff8ef
@ -511,7 +511,7 @@ namespace SimplySerial
|
|||||||
c.vid = c.vid.Substring(0, Math.Min(4, c.vid.Length));
|
c.vid = c.vid.Substring(0, Math.Min(4, c.vid.Length));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
c.vid = "????";
|
c.vid = "----";
|
||||||
|
|
||||||
if (mPID.Success)
|
if (mPID.Success)
|
||||||
{
|
{
|
||||||
@ -519,7 +519,7 @@ namespace SimplySerial
|
|||||||
c.pid = c.pid.Substring(0, Math.Min(4, c.vid.Length));
|
c.pid = c.pid.Substring(0, Math.Min(4, c.vid.Length));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
c.pid = "????";
|
c.pid = "----";
|
||||||
|
|
||||||
Match mName = Regex.Match(c.name, namePattern);
|
Match mName = Regex.Match(c.name, namePattern);
|
||||||
if (mName.Success)
|
if (mName.Success)
|
||||||
@ -527,11 +527,11 @@ namespace SimplySerial
|
|||||||
c.name = mName.Value;
|
c.name = mName.Value;
|
||||||
c.num = int.Parse(c.name.Substring(3));
|
c.num = int.Parse(c.name.Substring(3));
|
||||||
if (c.num == 0)
|
if (c.num == 0)
|
||||||
c.name = "????";
|
c.name = "?";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
c.name = "????";
|
c.name = "?";
|
||||||
c.num = 0;
|
c.num = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -542,7 +542,7 @@ namespace SimplySerial
|
|||||||
}).ToList();
|
}).ToList();
|
||||||
|
|
||||||
// remove all unusable ports from the list
|
// remove all unusable ports from the list
|
||||||
detectedPorts.RemoveAll(p => p.name == "????");
|
detectedPorts.RemoveAll(p => p.name == "?");
|
||||||
|
|
||||||
return (detectedPorts);
|
return (detectedPorts);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user