2018-05-08 01:57:54 +00:00
|
|
|
//
|
2018-05-11 01:54:10 +00:00
|
|
|
// ActivityObserver.h
|
2018-05-08 01:57:54 +00:00
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 07/05/2018.
|
|
|
|
// Copyright © 2018 Thomas Harte. All rights reserved.
|
|
|
|
//
|
|
|
|
|
2018-05-11 01:54:10 +00:00
|
|
|
#ifndef ActivityObserver_h
|
|
|
|
#define ActivityObserver_h
|
2018-05-08 01:57:54 +00:00
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
2018-05-11 01:54:10 +00:00
|
|
|
namespace Activity {
|
|
|
|
|
2018-05-08 01:57:54 +00:00
|
|
|
/*!
|
|
|
|
Provides a purely virtual base class for anybody that wants to receive notifications of
|
|
|
|
'activity' — any feedback from an emulated system which a user could perceive other than
|
|
|
|
through the machine's native audio and video outputs.
|
|
|
|
|
|
|
|
So: status LEDs, drive activity, etc. A receiver may choose to make appropriate noises
|
|
|
|
and/or to show or unshow status indicators.
|
|
|
|
*/
|
2018-05-11 01:54:10 +00:00
|
|
|
class Observer {
|
2018-05-08 01:57:54 +00:00
|
|
|
public:
|
|
|
|
/// Announces to the receiver that there is an LED of name @c name.
|
|
|
|
virtual void register_led(const std::string &name) = 0;
|
|
|
|
|
|
|
|
/// Announces to the receiver that there is a drive of name @c name.
|
|
|
|
virtual void register_drive(const std::string &name) = 0;
|
|
|
|
|
|
|
|
/// Informs the receiver of the new state of the LED with name @c name.
|
|
|
|
virtual void set_led_status(const std::string &name, bool lit) = 0;
|
|
|
|
|
|
|
|
enum class DriveEvent {
|
2018-05-12 01:44:08 +00:00
|
|
|
StepNormal,
|
2018-05-08 01:57:54 +00:00
|
|
|
StepBelowZero,
|
|
|
|
StepBeyondMaximum
|
|
|
|
};
|
|
|
|
|
|
|
|
/// Informs the receiver that the named event just occurred for the drive with name @c name.
|
|
|
|
virtual void announce_drive_event(const std::string &name, DriveEvent event) = 0;
|
|
|
|
|
|
|
|
/// Informs the receiver of the motor-on status of the drive with name @c name.
|
|
|
|
virtual void set_drive_motor_status(const std::string &name, bool is_on) = 0;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2018-05-11 01:54:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* ActivityObserver_h */
|