Skip to content

Commit

Permalink
Try making a function check?
Browse files Browse the repository at this point in the history
  • Loading branch information
Capkirk123 committed Jul 19, 2024
1 parent bd2b40f commit c3ba36d
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions src/RealAntennasProject/PlannerGUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -256,17 +256,27 @@ private bool RenderPanel(SelectionMode mode, ref RealAntenna antenna, ref Vector
res = true;
}
foreach (Network.RACommNetHome home in homes)
foreach (RealAntenna ra in home.Comm.RAAntennaList.Where(x => x.Compatible(peer)))
if (GUILayout.Button($"{home.displaynodeName} {ra.ToStringShort()}", buttonStyle))
{
antenna = ra;
res = true;
}
foreach (RealAntenna ra in home.Comm.RAAntennaList)
if(CheckMatchingGroundStation(peer, ra)

Check failure on line 260 in src/RealAntennasProject/PlannerGUI.cs

View workflow job for this annotation

GitHub Actions / build

) expected
if (GUILayout.Button($"{home.displaynodeName} {ra.ToStringShort()}", buttonStyle))
{
antenna = ra;
res = true;
}
}
GUILayout.EndScrollView();
return res;
}

public bool CheckMatchingGroundStation(RealAntenna peer, RealAntenna station)
{
if(peer.RFBand == station.RFBand)
{
return true;
}
return false;
}

public RealAntenna GetBestMatchingGroundStation(RealAntenna peer, IEnumerable<Network.RACommNetHome> stations)
{
RealAntenna best = null;
Expand Down

0 comments on commit c3ba36d

Please sign in to comment.