Subversion Repositories HomeAutomation

Rev

Rev 1335 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 1335 Rev 1345
Line 161... Line 161...
161
    this.screenSaverMenuItem = new MenuItem(this);
161
    this.screenSaverMenuItem = new MenuItem(this);
162
    this.screenSaverMenuItem.displayData[0] = this.lcdCenterText("");
162
    this.screenSaverMenuItem.displayData[0] = this.lcdCenterText("");
163
    this.screenSaverMenuItem.displayData[1] = this.lcdCenterText("");
163
    this.screenSaverMenuItem.displayData[1] = this.lcdCenterText("");
164
    this.screenSaverMenuItem.doRight = function(args) { self.changeToNext(); };
164
    this.screenSaverMenuItem.doRight = function(args) { self.changeToNext(); };
165
    this.screenSaverMenuItem.doLeft = function(args) { self.changeToPrev(); };
165
    this.screenSaverMenuItem.doLeft = function(args) { self.changeToPrev(); };
-
 
166
    this.screenSaverMenuItem.doUpdate = function(args) { self.updateBookMenuItem(); };
166
    this.screenSaverMenuItem.setNextItem(this.statusMenuItem);
167
    this.screenSaverMenuItem.setNextItem(this.statusMenuItem);
167
    this.screenSaverMenuItem.setPrevItem(this.statusMenuItem);
168
    this.screenSaverMenuItem.setPrevItem(this.statusMenuItem);
168
 
169
 
169
    /* create the menuitem where you can choose to enter the booking sub-menu */
170
    /* create the menuitem where you can choose to enter the booking sub-menu */
170
    this.bookMenuItem = new MenuItem(this);
171
    this.bookMenuItem = new MenuItem(this);
Line 270... Line 271...
270
    menuSetFrom.setDescItem(menuChooseFrom);
271
    menuSetFrom.setDescItem(menuChooseFrom);
271
    menuChooseFrom.setDescItem(menuSetFrom);
272
    menuChooseFrom.setDescItem(menuSetFrom);
272
 
273
 
273
}
274
}
274
 
275
 
-
 
276
/* Callback for a booking call to exchange */
275
Display.prototype.exchangeCalendarBookCallback = function(shortname, data)
277
Display.prototype.exchangeCalendarBookCallback = function(shortname, data)
276
{
278
{
277
    if (shortname == this.shortName)
279
    if (shortname == this.shortName)
278
    {
280
    {
279
        //FIXME check if data contains error tag and error message, print to log and keep previous data?
281
        //FIXME check if data contains error tag and error message, print to log and keep previous data?
Line 301... Line 303...
301
        }
303
        }
302
        this.updateDisplay();
304
        this.updateDisplay();
303
    }
305
    }
304
}
306
}
305
 
307
 
-
 
308
/* When pressing <OK> in booking menu */
306
Display.prototype.doBooking = function()
309
Display.prototype.doBooking = function()
307
{
310
{
308
    this.bookResultMenuItem.displayData[0] = this.lcdCenterText("Booking...");
311
    this.bookResultMenuItem.displayData[0] = this.lcdCenterText("Booking...");
309
    if (this.currentMenuItem.descItem)
312
    if (this.currentMenuItem.descItem)
310
    {
313
    {
Line 317... Line 320...
317
    this.exchangeCalendarBook.book(this.shortName, bookFrom, bookTo);
320
    this.exchangeCalendarBook.book(this.shortName, bookFrom, bookTo);
318
   
321
   
319
    //bookFromTime bookToTime
322
    //bookFromTime bookToTime
320
}
323
}
321
 
324
 
-
 
325
/* When entering the booking menu, set up some parameters */
322
Display.prototype.prepareBookingMenu = function()
326
Display.prototype.prepareBookingMenu = function()
323
{
327
{
324
    this.bookFromTime = new Date();
328
    this.bookFromTime = new Date();
325
    this.bookToTime = new Date();
329
    this.bookToTime = new Date();
326
    //this.bookFromTime.setHours(8);
330
    //this.bookFromTime.setHours(8);
Line 449... Line 453...
449
        this.statusMenuItem.setNextItem(this.bookMenuItem);
453
        this.statusMenuItem.setNextItem(this.bookMenuItem);
450
        this.bookMenuItem.setPrevItem(this.statusMenuItem);
454
        this.bookMenuItem.setPrevItem(this.statusMenuItem);
451
    }
455
    }
452
}
456
}
453
 
457
 
-
 
458
/* Callback for an exchange calendar lookup*/
454
Display.prototype.exchangeCalendarLookupCallback = function(shortname, data)
459
Display.prototype.exchangeCalendarLookupCallback = function(shortname, data)
455
{
460
{
456
    if (shortname == this.shortName)
461
    if (shortname == this.shortName)
457
    {
462
    {
458
        //FIXME check if data contains error tag and error message, print to log and keep previous data?
463
        //FIXME check if data contains error tag and error message, print to log and keep previous data?
Line 505... Line 510...
505
        if (lastMenuItem)
510
        if (lastMenuItem)
506
        {
511
        {
507
            this.exchangeCalendarLastMenuItem = lastMenuItem;
512
            this.exchangeCalendarLastMenuItem = lastMenuItem;
508
            this.exchangeCalendarLastMenuItem.setNextItem(this.bookMenuItem);
513
            this.exchangeCalendarLastMenuItem.setNextItem(this.bookMenuItem);
509
            this.exchangeCalendarFirstMenuItem.setPrevItem(this.statusMenuItem);
514
            this.exchangeCalendarFirstMenuItem.setPrevItem(this.statusMenuItem);
510
       
-
 
511
        }
515
        }
512
        /* to link in the newly created menuitems with exchangeinformation the display must be showing
516
        /* to link in the newly created menuitems with exchangeinformation the display must be showing
513
           either the statusmenu or the bookingmenu */
517
           either the statusmenu or the bookingmenu */
514
        if (this.currentMenuItem == this.statusMenuItem || this.currentMenuItem == this.bookMenuItem || this.currentMenuItem == this.bookResultMenuItem)
518
        if (this.currentMenuItem == this.statusMenuItem || this.currentMenuItem == this.bookMenuItem || this.currentMenuItem == this.bookResultMenuItem || this.currentMenuItem == this.screenSaverMenuItem)
515
        {
519
        {
516
            /* if there is one or more exchangemenuitems */
520
            /* if there is one or more exchangemenuitems */
517
            if (this.exchangeCalendarFirstMenuItem && this.exchangeCalendarLastMenuItem)
521
            if (this.exchangeCalendarFirstMenuItem && this.exchangeCalendarLastMenuItem)
518
            {
522
            {
519
                this.statusMenuItem.setNextItem(this.exchangeCalendarFirstMenuItem);
523
                this.statusMenuItem.setNextItem(this.exchangeCalendarFirstMenuItem);