add geo to grpc calls getting node values, updated emane position hook to set lon/lat/alt values
This commit is contained in:
parent
d31cfedde9
commit
c6a06baf29
2 changed files with 5 additions and 0 deletions
|
@ -235,6 +235,9 @@ def get_node_proto(session: Session, node: NodeBase) -> core_pb2.Node:
|
||||||
position = core_pb2.Position(
|
position = core_pb2.Position(
|
||||||
x=node.position.x, y=node.position.y, z=node.position.z
|
x=node.position.x, y=node.position.y, z=node.position.z
|
||||||
)
|
)
|
||||||
|
geo = core_pb2.Geo(
|
||||||
|
lat=node.position.lat, lon=node.position.lon, alt=node.position.alt
|
||||||
|
)
|
||||||
services = getattr(node, "services", [])
|
services = getattr(node, "services", [])
|
||||||
if services is None:
|
if services is None:
|
||||||
services = []
|
services = []
|
||||||
|
@ -255,6 +258,7 @@ def get_node_proto(session: Session, node: NodeBase) -> core_pb2.Node:
|
||||||
model=model,
|
model=model,
|
||||||
type=node_type.value,
|
type=node_type.value,
|
||||||
position=position,
|
position=position,
|
||||||
|
geo=geo,
|
||||||
services=services,
|
services=services,
|
||||||
icon=node.icon,
|
icon=node.icon,
|
||||||
image=image,
|
image=image,
|
||||||
|
|
|
@ -202,6 +202,7 @@ class EmaneNet(CoreNetworkBase):
|
||||||
lat, lon, alt = self.session.location.getgeo(x, y, z)
|
lat, lon, alt = self.session.location.getgeo(x, y, z)
|
||||||
if node.position.alt is not None:
|
if node.position.alt is not None:
|
||||||
alt = node.position.alt
|
alt = node.position.alt
|
||||||
|
node.position.set_geo(lon, lat, alt)
|
||||||
# altitude must be an integer or warning is printed
|
# altitude must be an integer or warning is printed
|
||||||
alt = int(round(alt))
|
alt = int(round(alt))
|
||||||
return nemid, lon, lat, alt
|
return nemid, lon, lat, alt
|
||||||
|
|
Loading…
Add table
Reference in a new issue