SE-Projekt-LED-Detection / LED-Detection

LED-Detection is a tool for observing state leds on PCBs using a document camera.
MIT License
2 stars 2 forks source link

Refactor BoardObserver and LEDState #86

Closed morgenmuesli closed 2 years ago

morgenmuesli commented 2 years ago

The current LedStateDetector and BpardObserver combines Data and Logic in one class. This can be a bit confusing for later development.

A better approach would be to split those classes and their Functions on smaller batches to provide readability and modularity.

current

Note: The class diagram is shortened

classDiagram
class StateDetector{
 - currentOrientation: np.array
 - detect_current_state()
 + on_change()

}

class BoardObserver{
 + leds: List[StateDetector]
 - brightness: deque(maxlen=30)
 + check(frame, roid:List, on_change:Callback, *args, **kwargs)

}

class LedStateDetector{
 // led object 
 + id: int
 + name: str
 + is_on: Bool
 + ...

 - state_change()
 + detect()

}

Problems:

Possible Solutions