The files contained in this repository can be downloaded to your computer using a svn client.
On Linux you simply type the command displayed below.
This URL has Read-Only access.
root / trunk / DomotiGa / FDebug.class @ 780
History | View | Annotate | Download (3 kB)
| 1 | ' Gambas class file |
|---|---|
| 2 | |
| 3 | ' Description: |
| 4 | ' FDebug.class |
| 5 | ' Page for test programs, variables, buttons etc. |
| 6 | |
| 7 | ' Development Status: |
| 8 | ' Just implemented, needs work. |
| 9 | |
| 10 | ' DomotiGa - an open source home automation program. |
| 11 | ' Copyright(C) 2008-2010 Ron Klinkien |
| 12 | |
| 13 | ' Read file called COPYING for license details. |
| 14 | |
| 15 | PRIVATE tRefresh AS NEW Timer |
| 16 | |
| 17 | PUBLIC SUB Form_Open() |
| 18 | |
| 19 | GetVarList() |
| 20 | |
| 21 | ' create refresh timer |
| 22 | tRefresh = NEW Timer AS "tRefresh" |
| 23 | tRefresh.Delay = 10000 ' 10 seconds |
| 24 | tRefresh.Start |
| 25 | |
| 26 | |
| 27 | END |
| 28 | |
| 29 | PUBLIC SUB GetVarList() |
| 30 | |
| 31 | DIM iCount AS Integer |
| 32 | DIM vValue AS Variant |
| 33 | |
| 34 | WITH tbvGlobalVar |
| 35 | .Columns.Count = 2 |
| 36 | .Rows.Count = Main.GlobalVar.Count |
| 37 | .Columns[0].Title = ("Name")
|
| 38 | .Columns[0].Width = 180 |
| 39 | .Columns[1].Title = ("Value")
|
| 40 | .Columns[1].Width = 150 |
| 41 | END WITH |
| 42 | |
| 43 | FOR EACH vValue IN Main.GlobalVar |
| 44 | tbvGlobalVar[iCount, 0].Text = Main.GlobalVar.Key |
| 45 | IF gb.Boolean = TypeOf(vValue) THEN |
| 46 | tbvGlobalVar[iCount, 1].Text = Main.DisplayBool(vValue) |
| 47 | ELSE |
| 48 | tbvGlobalVar[iCount, 1].Text = vValue |
| 49 | END IF |
| 50 | iCount = iCount + 1 |
| 51 | NEXT |
| 52 | |
| 53 | END |
| 54 | |
| 55 | PUBLIC SUB tbvGlobalVar_ColumnClick(Column AS Integer) |
| 56 | |
| 57 | Main.SortTableView(FDebug.tbvGlobalVar, Column, TRUE) |
| 58 | |
| 59 | END |
| 60 | |
| 61 | '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 62 | ' voicetext test buttons |
| 63 | '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 64 | PUBLIC SUB btnSpeakMale_Click() |
| 65 | |
| 66 | VoiceText.Speak(Main.Random_Text("remarks_plants"), "male")
|
| 67 | |
| 68 | END |
| 69 | |
| 70 | PUBLIC SUB btnSpeakFemale_Click() |
| 71 | |
| 72 | VoiceText.Speak(Main.Random_Text("remarks_plants"), "female")
|
| 73 | |
| 74 | END |
| 75 | |
| 76 | PUBLIC SUB btnSpeakDefault_Click() |
| 77 | |
| 78 | VoiceText.Speak(Main.Random_Text("remarks_plants"))
|
| 79 | |
| 80 | END |
| 81 | |
| 82 | PUBLIC SUB btnSpeakAllison_Click() |
| 83 | |
| 84 | VoiceText.Speak(Main.Random_Text("remarks_plants"), "allison")
|
| 85 | |
| 86 | END |
| 87 | |
| 88 | PUBLIC SUB btnSpeakLinda_Click() |
| 89 | |
| 90 | VoiceText.Speak(Main.Random_Text("remarks_plants"), "linda")
|
| 91 | |
| 92 | END |
| 93 | |
| 94 | PUBLIC SUB btnSpeakEmily_Click() |
| 95 | |
| 96 | VoiceText.Speak(Main.Random_Text("remarks_plants"), "emily")
|
| 97 | |
| 98 | END |
| 99 | |
| 100 | '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 101 | ' refresh page contents |
| 102 | '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 103 | PUBLIC SUB tRefresh_Timer() |
| 104 | |
| 105 | GetVarList() |
| 106 | |
| 107 | END |
| 108 | |
| 109 | PUBLIC SUB Form_Close() |
| 110 | |
| 111 | tRefresh.Stop |
| 112 | |
| 113 | END |
| 114 | |
| 115 | PUBLIC SUB btnSoundPlay_Click() |
| 116 | |
| 117 | Sounds.PlaySnd("click.wav")
|
| 118 | |
| 119 | END |
| 120 | |
| 121 | PUBLIC SUB btnSoundPlay50_Click() |
| 122 | |
| 123 | Sounds.PlaySnd("click.wav", 50)
|
| 124 | |
| 125 | END |
| 126 | |
| 127 | PUBLIC SUB btnWOL_Click() |
| 128 | |
| 129 | Main.WakeOnLan("00:19:bb:d4:ad:41")
|
| 130 | |
| 131 | END |
| 132 | |
| 133 | PUBLIC SUB btnFanSpd1_Click() |
| 134 | |
| 135 | IF Main.bServer THEN |
| 136 | Devices.SetDevice("House Ventilation", "1")
|
| 137 | ELSE |
| 138 | XMLClient.DeviceSetDevice("House Ventilation", "1")
|
| 139 | END IF |
| 140 | |
| 141 | END |
| 142 | |
| 143 | PUBLIC SUB btnFanSpd2_Click() |
| 144 | |
| 145 | IF Main.bServer THEN |
| 146 | Devices.SetDevice("House Ventilation", "2")
|
| 147 | ELSE |
| 148 | XMLClient.DeviceSetDevice("House Ventilation", "2")
|
| 149 | END IF |
| 150 | |
| 151 | END |
| 152 | |
| 153 | PUBLIC SUB btnFanSpd3_Click() |
| 154 | |
| 155 | IF Main.bServer THEN |
| 156 | Devices.SetDevice("House Ventilation", "3")
|
| 157 | ELSE |
| 158 | XMLClient.DeviceSetDevice("House Ventilation", "3")
|
| 159 | END IF |
| 160 | |
| 161 | END |
| 162 | |
| 163 | PUBLIC SUB btnFanTimer_Click() |
| 164 | |
| 165 | IF Main.bServer THEN |
| 166 | Devices.SetDevice("House Ventilation", "T")
|
| 167 | ELSE |
| 168 | XMLClient.DeviceSetDevice("House Ventilation", "T")
|
| 169 | END IF |
| 170 | |
| 171 | END |
