Skip to content

Commit

Permalink
Add camera to list only if it supports controls
Browse files Browse the repository at this point in the history
  • Loading branch information
sajmons committed Apr 18, 2024
1 parent 0e99fc1 commit b05acbd
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions CollimationCircles/Services/CameraControlService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public static async Task<List<CameraControl>> GetV4L2CameraControls(Camera camer

var matches = Regex.Matches(result, pattern);

logger.Info($"Parsed {matches.Count} controls for '{camera.Name}'");
logger.Info($"Parsed {matches.Count} controls for '{camera.Name} {camera.Path}'");

foreach (Match m in matches.Cast<Match>())
{
Expand Down Expand Up @@ -318,7 +318,7 @@ public static async Task<List<Camera>> GetV4L2Cameras()

if (match.Success)
{
string name = match.Groups[2].Value.Trim();
string name = match.Groups[1].Value.Trim();

string[] camStr = match.Groups[3].Value.Trim().Split("\t");

Expand All @@ -338,9 +338,11 @@ public static async Task<List<Camera>> GetV4L2Cameras()

c.Controls = await GetV4L2CameraControls(c);

cameras.Add(c);

logger.Info($"Adding camera: '{c.Name} {c.Path}'");
if (c.Controls.Count > 0)
{
cameras.Add(c);
logger.Info($"Adding camera: '{c.Name} {c.Path}'");
}
}
}
else
Expand Down

0 comments on commit b05acbd

Please sign in to comment.