/elec/propeller-clock

To get this branch, use:
bzr branch http://bzr.ed.am/elec/propeller-clock

« back to all changes in this revision

Viewing changes to src/modes/info_mode.cc

  • Committer: edam
  • Date: 2012-05-18 12:11:01 UTC
  • Revision ID: tim@ed.am-20120518121101-0wik922hyvjkcjdi
switched back to using classes for modes

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
#include "Arduino.h"
28
28
 
29
29
 
 
30
void InfoMode::draw( int segment )
 
31
{
 
32
        Text::draw( 0, segment );
 
33
        if( _flavour == 1 )
 
34
                Text::draw( 1, segment );
 
35
}
 
36
 
30
37
 
31
38
void InfoMode::draw_reset()
32
39
{
39
46
                                        "Propeller Clock mk.1   ...   "
40
47
                                        "Created by Tim and Dan Marston in 2012   ...   "
41
48
                                        "http://ed.am/dev/elec/propeller-clock" );
42
 
                        Text::set_message_text( 0, str0 );
 
49
                        Text::set_message( 0, str0 );
43
50
                }
44
51
                break;
45
52
        case 1: {
52
59
                        str1.format( "%ld",
53
60
                                        (unsigned long)60 * 1000 / ( millis - _millis_last ) );
54
61
                        _millis_last = millis;
55
 
                        Text::set_message_text( 0, str0 );
56
 
                        Text::set_message_text( 1, str1 );
 
62
                        Text::set_message( 0, str0 );
 
63
                        Text::set_message( 1, str1 );
57
64
                }
58
65
                break;
59
66
        }
80
87
 
81
88
void InfoMode::reset_messages()
82
89
{
83
 
        Text::reset();
84
 
 
85
90
        switch( _flavour )
86
91
        {
87
92
        case 0:
88
 
                Text::set_up_message( 0, Text::MODE_TOP | Text::MODE_THREEQUARTERS |
 
93
                Text::reset_message( 0, Text::MODE_TOP | Text::MODE_THREEQUARTERS |
89
94
                                Text::MODE_HSCROLL, Text::SCALE_SMALL );
90
95
                break;
91
96
        case 1:
92
 
                Text::set_up_message( 0, Text::MODE_TOP | Text::MODE_HALF,
 
97
                Text::reset_message( 0, Text::MODE_TOP | Text::MODE_HALF,
93
98
                                Text::SCALE_FAT );
94
 
                Text::set_up_message( 1, Text::MODE_BOTTOM | Text::MODE_HALF,
 
99
                Text::reset_message( 1, Text::MODE_BOTTOM | Text::MODE_HALF,
95
100
                                Text::SCALE_FAT );
96
101
                break;
97
102
        }