Canola  0.8.D001
Public Types | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes
window_card_reader Class Reference

#include <card_reader.h>

List of all members.

Public Types

typedef Glib::RefPtr
< window_card_reader
pointer

Public Member Functions

virtual ~window_card_reader ()
bool start (const std::string &src, bool binary=false)
bool is_busy ()

Static Public Member Functions

static pointer create (calculator_gnome *dst)

Private Types

typedef Glib::RefPtr< Gdk::Pixbuf > pixbuf_ptr_t
typedef std::vector< pixbuf_ptr_tcard_pixbufs_t
typedef boost::shared_ptr
< Gtk::Image > 
gtk_image_ptr_t
typedef std::vector
< gtk_image_ptr_t
card_image_widgets_t

Private Member Functions

 window_card_reader (calculator_gnome *dst)
bool empty (void) const
bool on_animation_timer (void)
void done (void)
 window_card_reader ()
 window_card_reader (const window_card_reader &rhs)
window_card_readeroperator= (const window_card_reader &rhs)

Private Attributes

calculator_proxy dst
Gtk::Fixed layout
card_pixbufs_t card_pixbufs
card_image_widgets_t card_image_widgets
sigc::connection animation_timer
double pixels_per_second
int pixels_per_instruction
int current_address
size_t current_card_number
bool currently_moving_left
double current_card_started

Detailed Description

The window_card_reader class is used to represent a window within which the card images are animated to simulate a card reader drawing each card in and passing the holes over the optical sensors.

Definition at line 35 of file card_reader.h.


Member Typedef Documentation

Definition at line 109 of file card_reader.h.

typedef std::vector<pixbuf_ptr_t> window_card_reader::card_pixbufs_t [private]

Definition at line 98 of file card_reader.h.

typedef boost::shared_ptr<Gtk::Image> window_card_reader::gtk_image_ptr_t [private]

Definition at line 107 of file card_reader.h.

typedef Glib::RefPtr<Gdk::Pixbuf> window_card_reader::pixbuf_ptr_t [private]

Definition at line 96 of file card_reader.h.

Definition at line 39 of file card_reader.h.


Constructor & Destructor Documentation

The destructor.

Definition at line 27 of file card_reader.cc.

The constructor. It is private on purpose, use the create class method instead.

Definition at line 32 of file card_reader.cc.

The default constructor. Do not use.

The copy constructor. Do not use.

Parameters:
rhsThe right hand side of the initialization.

Member Function Documentation

The create class method is used to create new dynamicall allocated isnatnces of this class.

Parameters:
dstThe destination, the calulator into which the program is to be loaded.

Definition at line 59 of file card_reader.cc.

void window_card_reader::done ( void  ) [private]

The done method is used to dismiss the window when the last of the last simulated card has passed under the simulated card reader.

Definition at line 248 of file card_reader.cc.

bool window_card_reader::empty ( void  ) const [private]

The empty method is used to determine whether or not any cards are presently loaded into the card reader simulation.

Definition at line 181 of file card_reader.cc.

bool window_card_reader::is_busy ( void  )

The is_busy method may be used to determine whether or not the card reader is currently animating the reading of a card set.

Definition at line 278 of file card_reader.cc.

bool window_card_reader::on_animation_timer ( void  ) [private]

The on_animation_timer method is used to update the card positions each time the animation timer ticks over.

Definition at line 189 of file card_reader.cc.

window_card_reader& window_card_reader::operator= ( const window_card_reader rhs) [private]

The assignment operator. Do not use.

Parameters:
rhsThe right hand side of the assignment.
bool window_card_reader::start ( const std::string &  src,
bool  binary = false 
)

The start method is used to start the card reader animation going.

Parameters:
srcThe source, the file to read to obtain the program.
binaryWhether or not he file containing the program to be loaded is assembler text (false) or binary (true).
Returns:
true if the program was read successfully, false if there was one or more errors (erorrs reported via dst.on_error already).

Definition at line 89 of file card_reader.cc.


Member Data Documentation

sigc::connection window_card_reader::animation_timer [private]

The animation_timer instance variable is used to remember the timer being used to animate the cards, vis a the on_animation_timer method.

Definition at line 128 of file card_reader.h.

The card_image_widgets instance variable is used to remember the Gtk::Image instances, one for each card pixbuf.

Definition at line 115 of file card_reader.h.

The card_pixbufs instance variable is used to remember the images of each vcard to be animated. They are actually faithful images of the cards that the program would require.

Definition at line 105 of file card_reader.h.

The current_address instance variable is used to remember the address from which to fetch the next opcode to be forwarded to the dst destination.

Definition at line 151 of file card_reader.h.

The current_card_number instance variable is used to remember which card is currently being animated. Once this exceeds the size of card_image_widgets, we are done.

Definition at line 158 of file card_reader.h.

The current_card_started instance variable is used to remember the time in seconds (see getdaytime(2)) that the current phase of the current card started reading. The time implies the position, thanks to pixels_per_second.

Definition at line 174 of file card_reader.h.

The currently_moving_left instance variable is used to remember whether the current card is moving left (true) or moving up (false). Only when moving up does the card pass under the simulated card reader.

Definition at line 166 of file card_reader.h.

The dst instance variable is used to remember the program, and also where to forward opcodes to, at the right time.

Definition at line 88 of file card_reader.h.

Gtk::Fixed window_card_reader::layout [private]

The layout instance variable is used to remember the positions of each of the card image widgets.

Definition at line 94 of file card_reader.h.

The pixels_per_instruction instance variable is used to remember how many pixels pass under the read position for one instruction. This is used within on_animation_timer to determine when to forward opcodes.

Definition at line 144 of file card_reader.h.

The pixels_per_second instance variable is used to remember how man pixels of the card image pass under the read head per second. This ensures that each card takes 4 seconds to read, but this isn't a constant becaise each display is different.

Definition at line 136 of file card_reader.h.


The documentation for this class was generated from the following files: