snu-quiqcl / qiwis

QuIqcl Widget Integration Software
MIT License
6 stars 2 forks source link

[FEATURE] Base Logic #11

Closed BECATRUE closed 1 year ago

BECATRUE commented 1 year ago

Feature you want to implement

Logic is a controller for Frames.
All Frames are contained in their Logic respectively, and multiple Frames may be controlled by the same Logic.
Also, Logic is communicated with swift directly, such as sending and receiving global signals through Bus in swift.

BaseLogic is a parent class of Logic, where core fields and methods are already implemented.

How the feature is implemented

BaseLogic class will be implemented in swift.base module.

API:

  1. Signals
    • broadcast: Signal for broadcasting to a Bus which contains i) the destination bus name and ii) the message.
    • received: Signal for receiving a global siganl from a bus which contains i) the departure bus name and ii) the message.
  2. Fields
    • name (str): A name of Logic.
    • show (bool): Where Frames are shwon at the beginning.
    • pos (str): An initial position of Frames.
  3. Methods
    • frames() → Iterable: Return an iterable object of Frame objects for showing
kangz12345 commented 1 year ago

My suggestions:

  1. Name broadcasted would be more consistent.
  • broadcast_signal: Signal for broadcasting to a Bus which contains i) the destination bus name and ii) the message.
  1. I would prefer 'source bus' to 'departure bus'. (+ typo 'Signal')
  • received: Siganl for receiving a global siganl from a bus which contains i) the departure bus name and ii) the message.
  1. An iterable of Frame would be enough, instead of list.
  • frames() → list: Return a list of Frame objects for showing
BECATRUE commented 1 year ago

My suggestions:

  1. Name broadcasted would be more consistent.
  • broadcast_signal: Signal for broadcasting to a Bus which contains i) the destination bus name and ii) the message.
  1. I would prefer 'source bus' to 'departure bus'. (+ typo 'Signal')
  • received: Siganl for receiving a global siganl from a bus which contains i) the departure bus name and ii) the message.
  1. An iterable of Frame would be enough, instead of list.
  • frames() → list: Return a list of Frame objects for showing

I reflected your commnts. How about this?