Skip to content

Commit

Permalink
Adds support for G11
Browse files Browse the repository at this point in the history
  • Loading branch information
gnthibault committed Aug 9, 2023
1 parent 8137b91 commit a48ede9
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 16 deletions.
39 changes: 24 additions & 15 deletions Mount/IndiG11.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,14 @@ def __init__(self, location, serv_time, config, connect_on_create=False):
module="IndiG11",
mount_name="Losmandy Gemini",
equatorial_eod="J2000", # JNOW
tcp_host="192.168.8.63",
tcp_port="11110",
indi_client=dict(
indi_host="localhost",
indi_port=7625)
)
self.tcp_host = config["tcp_host"]
self.tcp_port = config["tcp_port"]

super().__init__(location=location,
serv_time=serv_time,
Expand All @@ -239,9 +243,12 @@ def unpark(self):
IndiAbstractMount.unpark(self)

def initialize(self):
self.connect()
self.connect(connect_device=False)
self.set_connectivity_config()
self.connect_device()
self.set_startup_mode(mode='WARM_RESTART')
self.set_park_settings(mode='HOME')
self.set_geographic_config()
self.set_time_config()
#TODO TN URGENT as a temporary fix. we decided to park at startup but
# the proper behaviour for the mount should be parked status by default
Expand All @@ -260,7 +267,23 @@ def set_time_config(self):
self.set_text("TIME_UTC", {"UTC": utc_time_str}, sync=True)
self.set_number('TIME_UTC', {'OFFSET': utc_offset_value}, sync=True)

def set_geographic_config(self):
self.set_number('GEOGRAPHIC_COORD', {
'LAT': self.location.lat.to(u.deg).value,
'LONG': self.location.lon.to(u.deg).value,
'ELEV': self.location.height.to(u.meter).value},
sync=True)

def set_connectivity_config(self):
"""
In fact it's not tcp but udp, but ok ...
:return:
"""
self.set_switch('CONNECTION_MODE', ["CONNECTION_TCP"], sync=True)
self.set_switch('CONNECTION_TYPE', ["UDP"], sync=True)
self.set_text("DEVICE_ADDRESS",
{"ADDRESS": self.tcp_host,
"PORT": self.tcp_port}, sync=True)

def set_startup_mode(self, mode='WARM_RESTART'):
"""
Expand Down Expand Up @@ -300,17 +323,3 @@ def set_park_settings(self, mode='HOME'):
# self.logger.info(f"Now setting J2k coord: {rahour_decdeg}")
# self.set_number('EQUATORIAL_EOD_COORD', rahour_decdeg, sync=True,
# timeout=180)
#set_numberVector Losmandy Gemini GEOGRAPHIC_COORD Ok
# LAT='51.466666666666668561'
# LONG='5.7166666666666401397'
# ELEV='0'

#Dispatch command error(-1):
#<set_switchVector device="Losmandy Gemini" name="TELESCOPE_PARK" state="Ok" timeout="60" timestamp="2019-08-05T00:03:43">
# <oneSwitch name="PARK">
#On
# </oneSwitch>
# <oneSwitch name="UNPARK">
#Off
# </oneSwitch>
#</set_switchVector>
4 changes: 3 additions & 1 deletion conf_files/config_backyard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ observatory:
investigator: gnthibault
latitude: 45.67 # Degrees
longitude: 5.67 # Degrees
elevation: 150.0 # Meters
elevation: 650.0 # Meters
timezone: Europe/Paris #This is not mandatory, just speeds up startup
# UTC+1 CET Central European Time,
# UTC +2 CEST Central European Summer Time
Expand Down Expand Up @@ -143,6 +143,8 @@ mount:
module: IndiG11
mount_name: Losmandy Gemini
equatorial_eod: J2000 # JNOW
tcp_host: 192.168.8.63
tcp_port: 11110
indi_client :
indi_host : localhost
indi_port : 7625
Expand Down

0 comments on commit a48ede9

Please sign in to comment.