AntennaRelay, ModuleLimitedDataTransmitter: Integrated getLineOfSight methods to detect when LOS is almost lost. ARdev-LOS
[AntennaRange.git] / ModuleLimitedDataTransmitter.cs
blob:a/ModuleLimitedDataTransmitter.cs -> blob:b/ModuleLimitedDataTransmitter.cs
--- a/ModuleLimitedDataTransmitter.cs
+++ b/ModuleLimitedDataTransmitter.cs
@@ -522,7 +522,7 @@
 			{
 				if (this.CanTransmit())
 				{
-					this.UIrelayStatus = string.Intern("Connected");
+					this.UIrelayStatus = string.Format("Connected via {0}", this.relay);
 					this.UItransmitDistance = Tools.MuMech_ToSI(this.transmitDistance) + "m";
 					this.UIpacketSize = Tools.MuMech_ToSI(this.DataRate) + "MiT";
 					this.UIpacketCost = Tools.MuMech_ToSI(this.DataResourceCost) + "E";
@@ -535,7 +535,16 @@
 					}
 					else
 					{
-						this.UIrelayStatus = string.Format("Blocked by {0}", this.relay.firstOccludingBody.bodyName);
+						if (this.relay.losStatus == LineOfSightStatus.Blocked)
+						{
+							this.UIrelayStatus =
+								string.Format("Blocked by {0}", this.relay.firstOccludingBody.bodyName);
+						}
+						else if (this.relay.losStatus == LineOfSightStatus.Marginal)
+						{
+							this.UIrelayStatus =
+								string.Format("Almost blocked by {0}", this.relay.firstOccludingBody.bodyName);
+						}
 					}
 					this.UImaxTransmitDistance = "N/A";
 					this.UIpacketSize = "N/A";