Refactor StepControl and GUI to return change status.
StepControl methods SetSpeed, SetNoiseParameters, and SetPauseState now return a boolean indicating whether the state was actually changed. The GUI functions NoiseGui and StepControlGui also return a boolean reflecting if any parameters were modified. Noise parameters are now directly managed by StepControl rather than being stored in UxState. The StepControlEvent message has been expanded to include all step control parameters. Keyboard event handling has been slightly refactored to better align with event-based updates. PiperOrigin-RevId: 940656342 Change-Id: I3701623a2fdcfc4c084b5db0ae19048669040de4
This commit is contained in:
committed by
Copybara-Service
parent
f4b2f76def
commit
58d6910afa
@@ -13,7 +13,6 @@
|
||||
# limitations under the License.
|
||||
"""Messages and Channels for Studio."""
|
||||
|
||||
|
||||
import dataclasses
|
||||
from typing import Protocol
|
||||
from typing import runtime_checkable
|
||||
@@ -129,10 +128,13 @@ class PerturbEvent(Event):
|
||||
|
||||
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class SetPauseStateEvent(Event):
|
||||
"""An event requesting to set the pause state."""
|
||||
class StepControlEvent(Event):
|
||||
"""An event carrying the full step control state from the viewer to the sim."""
|
||||
|
||||
pause_state: sim.PauseState
|
||||
speed: float
|
||||
noise_scale: float
|
||||
noise_rate: float
|
||||
|
||||
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
|
||||
Reference in New Issue
Block a user