Example #1
0
 def fill_indexes(self):
     assert len(Systems.get_systems())
     for system in Systems.get_systems():
         star = system.star_system
         if star not in self._markers:
             self._markers[star] = []
             self._orbits[star] = []
             self._buttons[star] = []
             self.indexes.append(star)
Example #2
0
    def save_orbits(self, event):
        orbits = self._loaded_orbits
        for system in Systems.get_systems():
            if system.star_system.letter == 'S':
                for star in system:
                    for marker in self._orbits.get(star, []):
                        d = self.create_save_data(marker.orbit)
                        orbits.append(d)
            else:
                star = system.star_system
                for marker in self._orbits.get(star, []):
                    d = self.create_save_data(marker.orbit)
                    orbits.append(d)

        EventHandler.trigger(event.tipo + 'Data', 'Orbit',
                             {'Stellar Orbits': orbits})
Example #3
0
 def save_planets(self, event):
     data = self.current.loaded_data if self.current.loaded_data is not None else []
     for system in Systems.get_systems():
         for planet in self.planets:
             if planet in system.planets:
                 planet_data = {
                     'name': planet.name,
                     'mass': planet.mass.m,
                     'radius': planet.radius.m,
                     'unit': planet.unit,
                     'atmosphere': planet.atmosphere,
                     'composition': planet.composition,
                     'clase': planet.clase,
                     'system': system.id,
                     'id': planet.id,
                     'albedo': planet.albedo.m,
                     'tilt': planet.tilt.m
                 }
                 data.append(planet_data)
     EventHandler.trigger(event.tipo + 'Data', 'Planet', {"Planets": data})
Example #4
0
 def show(self):
     for system in Systems.get_systems():
         self.create_button(system.star_system)
     super().show()
     for prop in self.properties.widgets():
         prop.show()