Subversion Repositories HomeAutomation

Rev

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

Rev 1352 Rev 1402
Line 42... Line 42...
42
    }
42
    }
43
   
43
   
44
    this.CanService.prototype.canMessageHandler.call(this, canMessage);
44
    this.CanService.prototype.canMessageHandler.call(this, canMessage);
45
}
45
}
46
 
46
 
47
HD44789.prototype.onlineHandler = function()
47
HD44789.prototype.setOnline = function()
48
{
48
{
49
    this.CanService.prototype.onlineHandler.call(this);
49
    this.CanService.prototype.setOnline.call(this);
50
 
50
 
51
    // Request size of LCD
51
    // Request size of LCD
52
    var canMessage = new CanMessage("act", "To_Owner", this.myName, this.myId, "LCD_Size");
52
    var canMessage = new CanMessage("act", "To_Owner", this.myName, this.myId, "LCD_Size");
53
    sendMessage(canMessage);
53
    sendMessage(canMessage);
54
   
54
   
Line 65... Line 65...
65
    text = text.replace(/ä/, String.fromCharCode(225));
65
    text = text.replace(/ä/, String.fromCharCode(225));
66
    text = text.replace(/Ö/, String.fromCharCode(3));
66
    text = text.replace(/Ö/, String.fromCharCode(3));
67
    text = text.replace(/ö/, String.fromCharCode(239));
67
    text = text.replace(/ö/, String.fromCharCode(239));
68
    text = text.replace(/¤/, String.fromCharCode(223));
68
    text = text.replace(/¤/, String.fromCharCode(223));
69
 
69
 
70
    while (text.length > 0)
70
    while (text.length > 0 && y < this.myHeight)
71
    {
71
    {
72
        var text6 = text.substr(0, 6);
72
        var text6 = text.substr(0, 6);
-
 
73
       
-
 
74
        if (text6.length > this.myWidth - x)
-
 
75
        {
-
 
76
            text6 = text6.substr(0, this.myWidth - x);
-
 
77
        }
73
 
78
 
74
        var canMessage = new CanMessage("act", "To_Owner", this.myName, this.myId, "LCD_TextAt");
79
        var canMessage = new CanMessage("act", "To_Owner", this.myName, this.myId, "LCD_TextAt");
75
        canMessage.setData("X", x);
80
        canMessage.setData("X", x);
76
        canMessage.setData("Y", y);
81
        canMessage.setData("Y", y);
77
        canMessage.setData("Text", text6);
82
        canMessage.setData("Text", text6);
78
        sendMessage(canMessage);
83
        sendMessage(canMessage);
79
       
84
       
80
        x += text6.length;
85
        x += text6.length;
81
        text = text.slice(text6.length);
86
        text = text.slice(text6.length);
-
 
87
       
-
 
88
        if (text6.length < 6)
-
 
89
        {
-
 
90
            y++;
-
 
91
            x = 0;
-
 
92
        }
82
    }
93
    }
83
}
94
}
84
 
95
 
85
HD44789.prototype.clearScreen = function()
96
HD44789.prototype.clearScreen = function()
86
{
97
{
87
    var canMessage = new CanMessage("act", "To_Owner", this.myName, this.myId, "LCD_Clear");
98
    var canMessage = new CanMessage("act", "To_Owner", this.myName, this.myId, "LCD_Clear");
88
    sendMessage(canMessage);
99
    sendMessage(canMessage);
89
}
100
}
90
 
101
 
91
HD44789.prototype.setBacklight = function(strength)
102
HD44789.prototype.setBacklight = function(strength)
-
 
103
{
-
 
104
    if (strength != this.myBacklight)
92
{
105
    {
93
    var canMessage = new CanMessage("act", "To_Owner", this.myName, this.myId, "LCD_Backlight");
106
        var canMessage = new CanMessage("act", "To_Owner", this.myName, this.myId, "LCD_Backlight");
94
    canMessage.setData("Strength", strength);
107
        canMessage.setData("Strength", strength);
95
    sendMessage(canMessage);
108
        sendMessage(canMessage);
-
 
109
    }
96
}
110
}
97
 
111
 
98
HD44789.prototype.getBacklight = function()
112
HD44789.prototype.getBacklight = function()
99
{
113
{
100
    return this.myBacklight;
114
    return this.myBacklight;