/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: Tim Marston
  • Date: 2012-05-18 18:29:50 UTC
  • Revision ID: tim@ed.am-20120518182950-t85bn9a21n72uzm8
text messages are now individually enabled and draw()n automatically

Show diffs side-by-side

added added

removed removed

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