From 30e856b9e4a44f6cc044313fa4d58cc23fbe7fb1 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Wed, 15 Jan 2020 23:16:25 -0500 Subject: [PATCH] Renames motor_is_on_ to motor_input_is_on_ to start to disambiguate the two things. --- Storage/Disk/Drive.cpp | 18 +++++++++--------- Storage/Disk/Drive.hpp | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Storage/Disk/Drive.cpp b/Storage/Disk/Drive.cpp index be90395ba..a281c3a06 100644 --- a/Storage/Disk/Drive.cpp +++ b/Storage/Disk/Drive.cpp @@ -68,7 +68,7 @@ bool Drive::has_disk() const { } ClockingHint::Preference Drive::preferred_clocking() { - return (!motor_is_on_ || !has_disk_) ? ClockingHint::Preference::None : ClockingHint::Preference::JustInTime; + return (!motor_input_is_on_ || !has_disk_) ? ClockingHint::Preference::None : ClockingHint::Preference::JustInTime; } bool Drive::get_is_track_zero() const { @@ -146,13 +146,13 @@ bool Drive::get_is_ready() const { } void Drive::set_motor_on(bool motor_is_on) { - if(motor_is_on_ != motor_is_on) { - motor_is_on_ = motor_is_on; + if(motor_input_is_on_ != motor_is_on) { + motor_input_is_on_ = motor_is_on; if(observer_) { - observer_->set_drive_motor_status(drive_name_, motor_is_on_); + observer_->set_drive_motor_status(drive_name_, motor_input_is_on_); if(announce_motor_led_) { - observer_->set_led_status(drive_name_, motor_is_on_); + observer_->set_led_status(drive_name_, motor_input_is_on_); } } @@ -165,7 +165,7 @@ void Drive::set_motor_on(bool motor_is_on) { } bool Drive::get_motor_on() const { - return motor_is_on_; + return motor_input_is_on_; } bool Drive::get_index_pulse() const { @@ -185,7 +185,7 @@ void Drive::run_for(const Cycles cycles) { // Assumed: the index pulse pulses even if the drive has stopped spinning. index_pulse_remaining_ = std::max(index_pulse_remaining_ - cycles, Cycles(0)); - if(motor_is_on_) { + if(motor_input_is_on_) { if(has_disk_) { Time zero(0); @@ -407,11 +407,11 @@ void Drive::set_activity_observer(Activity::Observer *observer, const std::strin drive_name_ = name; observer->register_drive(drive_name_); - observer->set_drive_motor_status(drive_name_, motor_is_on_); + observer->set_drive_motor_status(drive_name_, motor_input_is_on_); if(add_motor_led) { observer->register_led(drive_name_); - observer->set_led_status(drive_name_, motor_is_on_); + observer->set_led_status(drive_name_, motor_input_is_on_); } } } diff --git a/Storage/Disk/Drive.hpp b/Storage/Disk/Drive.hpp index 330cdd734..d2b3f8a81 100644 --- a/Storage/Disk/Drive.hpp +++ b/Storage/Disk/Drive.hpp @@ -75,7 +75,7 @@ class Drive: public ClockingHint::Source, public TimedEventLoop { void set_motor_on(bool); /*! - @returns @c true if the motor is on; @c false otherwise. + @returns @c true if the motor on input is active; @c false otherwise. This does not necessarily indicate whether the drive is spinning, due to momentum. */ bool get_motor_on() const; @@ -213,7 +213,7 @@ class Drive: public ClockingHint::Source, public TimedEventLoop { int available_heads_ = 0; // Motor control state. - bool motor_is_on_ = false; + bool motor_input_is_on_ = false; // Current state of the index pulse output. Cycles index_pulse_remaining_;