Skip to content
Snippets Groups Projects
Commit 48b7e45d authored by Muhamed's avatar Muhamed
Browse files

Implement Telescope class with observe method and initial setup

parent 165c0745
Branches Feature-Aider-Telescope
No related tags found
No related merge requests found
......@@ -462,4 +462,17 @@ Include the following:
- Define the method `drive(self, cmd: str) -> str`.
- Add a class docstring explaining its purpose ("Eine Klasse zur Repräsentation des Mars.").
- Add a method docstring for the `drive` method based on the diagram and your previous plan ("Führt Fahrbefehle auf dem Mars aus." etc.).
- Use `pass` inside the method body for now.
\ No newline at end of file
- Use `pass` inside the method body for now.
### Erstellung der Telescope Klasse:
Create a new file named `telescope.py` and define the `Telescope` class within it.
Include the following:
- Define a constructor `__init__(self, plateau)`. Add a docstring: "Initializes the Telescope with a Plateau object." Also store the `plateau` object as an instance attribute (e.g., `self.plateau = plateau`).
- Define the method `observe(self) -> any`. Add a docstring based on the diagram note: "Observes the Plateau's grid."
- Add a class docstring explaining its purpose ("Eine Klasse zur Repräsentation eines Teleskops, das das Plateau beobachtet.").
- Use `pass` inside the method body for now.
> Aider hatte hier Probleme, es passierte zunächst nichts, im anschluss wurde die Klasse 3 mal erstellt.
......@@ -23,50 +23,3 @@ class Telescope:
"""
# Gibt eine Kopie des Rasters zurück, um unbeabsichtigte Änderungen zu vermeiden
return self.plateau.grid.copy() if hasattr(self.plateau, 'grid') else []
from plateau import Plateau
class Telescope:
"""
Eine Klasse zur Repräsentation eines Teleskops, das das Plateau beobachtet.
"""
def __init__(self, plateau: Plateau):
"""
Initialisiert das Teleskop mit einem Plateau-Objekt.
Args:
plateau: Das zu beobachtende Plateau-Objekt
"""
self.plateau = plateau
def observe(self) -> list:
"""
Beobachtet das Raster des Plateaus.
Returns:
Das Raster des Plateaus (grid)
"""
# Gibt eine Kopie des Rasters zurück, um unbeabsichtigte Änderungen zu vermeiden
return self.plateau.grid.copy() if hasattr(self.plateau, 'grid') else []
class Telescope:
"""
Eine Klasse zur Repräsentation eines Teleskops, das das Plateau beobachtet.
"""
def __init__(self, plateau):
"""
Initialisiert das Teleskop mit einem Plateau-Objekt.
Args:
plateau: Das zu beobachtende Plateau-Objekt
"""
self.plateau = plateau
def observe(self) -> any:
"""
Beobachtet das Raster des Plateaus.
Returns:
Das Raster des Plateaus (grid)
"""
pass
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment