-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Fixed an issue where consecutive fades would not start from the correct value
- Loading branch information
spacemanspiff2007
committed
Feb 20, 2023
1 parent
27c6f2d
commit 5f0d0dc
Showing
11 changed files
with
149 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = '1.0.0' | ||
__version__ = '1.0.1' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,15 @@ | ||
import abc | ||
|
||
class FadeBase: | ||
|
||
class FadeBase(metaclass=abc.ABCMeta): | ||
|
||
def __init__(self, target: int): | ||
self.val_target : int = int(target) # Target Value | ||
self.val_start : int = 0 # Start Value | ||
self.val_current : float = 0.0 # Current Value | ||
|
||
def __init__(self): | ||
self.is_done = False | ||
|
||
@abc.abstractmethod | ||
def initialize(self, steps : int): | ||
def initialize(self, current: int, target: int, steps: int): | ||
raise NotImplementedError() | ||
|
||
def debug_initialize(self) -> str: | ||
"""return debug string of the calculated values in initialize fade""" | ||
return "" | ||
|
||
@abc.abstractmethod | ||
def calc_next_value(self) -> float: | ||
raise NotImplementedError() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from pyartnet.base import BaseUniverse | ||
|
||
|
||
def test_values_add_channel(universe: BaseUniverse): | ||
u = universe.add_channel(1, 2, byte_size=3, byte_order='big') | ||
assert u._start == 1 | ||
assert u._width == 2 | ||
assert u._byte_size == 3 | ||
assert u._byte_order == 'big' | ||
|
||
u = universe.add_channel(10, 5, byte_size=2, byte_order='little') | ||
assert u._start == 10 | ||
assert u._width == 5 | ||
assert u._byte_size == 2 | ||
assert u._byte_order == 'little' |
Oops, something went wrong.