/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/digital_clock_mode.cc

  • Committer: edam
  • Date: 2012-02-29 21:56:32 UTC
  • Revision ID: edam@waxworlds.org-20120229215632-kypb9491vx7bicef
moved some stuf round, created a re-usable pool of message buffers, genericised "modes" for messages

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
 
30
30
DigitalClockMode::DigitalClockMode()
31
31
        :
32
 
        MinorMode( 4 )
 
32
        MinorMode( 6 )
33
33
{
34
34
}
35
35
 
38
38
{
39
39
        MinorMode::press();
40
40
 
41
 
//      set_message( false );
 
41
        set_message( false );
42
42
}
43
43
 
44
44
 
77
77
        PString str0( Text::_messages[ 0 ], MESSAGE_LEN );
78
78
//      PString str1( Text::_messages[ 1 ], MESSAGE_LEN );
79
79
        str0.begin();
80
 
//      str1.begin();
81
 
//      switch( get_flavour() )
82
 
//      {
83
 
//      case 0:
84
 
//              str0.format( "%d:%02d:%02 %s", time.get_hours() % 12,
85
 
//                                      time.get_minutes(), time.get_seconds(),
86
 
//                                      time.get_hours() / 12 > 0? "pm" : "am" );
87
 
//              Text::set_message( 0, str0 );
88
 
//              str1.print( "-" );
89
 
//              Text::set_message( 1, str1 );
90
 
//              if( update ) {
91
 
//                      Text::reset_message( 0, Text::MODE_TOP +
92
 
//                                                               Text::MODE_ALL );
93
 
//                      Text::reset_message( 1, Text::MODE_BOTTOM +
94
 
//                                                               Text::MODE_ONEQUARTER );
95
 
//              }
96
 
//              break;
97
 
//      case 1:
 
80
        str0.print( "1234567890" );
 
81
        Text::set_message( 0, str0 );
 
82
        if( !update )
 
83
                Text::set_message_mode( 0, get_flavour() * 4
 
84
                                                                + Text::MODE_TOP + Text::MODE_HSCROLL );
 
85
/*      str1.begin();
 
86
        switch( get_flavour() )
 
87
        {
 
88
        case 0:
 
89
                str0.format( "%d:%02d:%02d %s", time.get_hours() % 12,
 
90
                                        time.get_minutes(), time.get_seconds(),
 
91
                                        time.get_hours() / 12 > 0? "pm" : "am" );
 
92
                Text::set_message( 0, str0, update? 0 : 'T' );
 
93
                str1.print( "-" );
 
94
                Text::set_message( 1, str1, update? 0 : 'B' );
 
95
                break;
 
96
        case 1:
98
97
                str0.format( "%d%s %s, %d", time.get_day(),
99
98
                                        time.get_day_suffix(),
100
99
                                        time.get_month_name(), time.get_year() );
101
 
                Text::set_message( 0, str0 );
102
 
//              Text::set_message( 1, str1 );
103
 
                if( !update ) {
104
 
                        Text::reset_message( 0, Text::MODE_HSCROLL | Text::MODE_TOP |
105
 
                                                                 Text::MODE_THREEQUARTERS );
106
 
//                      Text::reset_message( 1, Text::MODE_BOTTOM +
107
 
//                                                               Text::MODE_ONEQUARTER );
108
 
                }
109
 
//              break;
110
 
//      }
111
 
 
112
 
        TextRenderer::select_font( get_flavour() );
 
100
                Text::set_message( 0, str0, update? 0 : 'S' );
 
101
                Text::set_message( 1, str1, update? 0 : 'b' );
 
102
                break;
 
103
        }
 
104
*/
113
105
}