Sub Process_Globals
Dim DegF As Int = 0
Dim DegC As Int = 0
End Sub
Sub Globals
'all on Home view screen
Dim Decrease_btn As Button
Dim Degrees_Btn As Button
Dim degreeC_view As ImageView
Dim degreeF_view As ImageView
Dim Device_txt As Label
Dim EnergySmart_Btn As Button
Dim Grid_Btn As Button
Dim ImageView1 As ImageView
Dim Increase_Btn As Button
Dim Label1 As Label
Dim Refresh_Btn As Label
Dim Standard_Btn As Button
Dim Summit_Btn As Button
Dim Temp_Txt As EditText
Dim Vacation_Btn As Button
Dim Home_Pnl As Panel
'________________________________
'all on Logon view screen
Dim Login_Btn As Button
Dim Logon_Pnl As Panel
Dim NewUser_Btn As Button
Dim Password_Txt As EditText
Dim UserName_Txt As EditText
'________________________________
'all on Main view screen (Tabhosting screen)
Dim Main As TabHost
'________________________________
'all on Settings view screen
Dim ChangeUser_btn As Button
Dim GridQuestion_Btn As Button
Dim Setting_Pnl As Panel
'_____________________________________
'all on Status view screen
Dim Status_Pnl As Panel
Dim DisplayFwVer_Txt As Label
Dim DryFire_Txt As Label
Dim EcoError_Txt As Label
Dim ElementFail_Txt As Label
Dim FaultCodes_Txt As Label
Dim Grid_Txt As Label
Dim GridCmd_txt As Label
Dim HotWaterVol_Txt As Label
Dim LeakDetect_Txt As Label
Dim LowerTemp_Txt As Label
Dim MasterDispFail_Txt As Label
Dim MasterFwVer_Txt As Label
Dim MaxSetPoint_txt As Label
Dim Mode_Txt As Label
Dim ModFwVer_Txt As Label
Dim ModuleApi_Txt As Label
Dim SetPoint_Txt As Label
Dim SignalStrength_Txt As Label
Dim TankSensorFail_Txt As Label
Dim Units_Txt As Label
Dim UpdateRate_Txt As Label
Dim UpperTemp_Txt As Label
Dim WifiFwVer_Txt As Label
'_____________________________________
'all on Status view screen (Scrollscreen)
Dim Status_scroll As ScrollView
'________________________________________
'all on Debug_Scroll
Dim Debug_scroll As ScrollView
Dim Clear_btn As Button
Dim Debug_txt As Label
'______________________________________
'Theses dim setting are for the program it self to run and work.
Dim tabPic1, tabPic2, tabpic3, tabPic4, tabPic5, tabPic6 As Bitmap
Dim Job1, Job2, Job3, Job4 As HttpJob
Dim parser As SaxParser
End Sub
Sub Activity_Create(FirstTime As Boolean)
'This loads in the primary layout for the tabs and screens groups.
Activity.LoadLayout("Main")
'This is to set up the tabs on the program screen.
tabPic1 = LoadBitmap(File.DirAssets, "53-house.png")
tabPic2 = LoadBitmap(File.DirAssets, "GreenHome.png")
Main.AddTabWithIcon ("Home", tabPic1, tabPic2, "Home1") '0 page
tabpic3 = LoadBitmap(File.DirAssets, "title_information_icon_edit.png")
tabPic4 = LoadBitmap(File.DirAssets, "GreenStatus.png")
Main.AddTabWithIcon ("Status", tabpic3, tabPic4, "Status") '1 page
tabPic5 = LoadBitmap(File.DirAssets, "title_service_icon_edit.png")
tabPic6 = LoadBitmap(File.DirAssets, "GreenSettings.png")
Main.AddTabWithIcon ("Settings", tabPic5, tabPic6, "Settings") '2 page
Main.AddTab ("Debug", "Debug_Scroll") '3 page
Debug_scroll.Panel.LoadLayout ("Debug")
' This starts the memory of the Temp settings until it is read from the web on start up.
If FirstTime Then
DegF = 70
degreeC_view.Visible = False
degreeF_view.Visible = True
DegC = (DegF-32)*5/9
End If
'Job1.Initialize("JobGetDevice", Me)
'Job2.Initialize("JobGetTemp",Me)
'Job3.Initialize("JobPost",Me)
'Job4.Initialize("JobgetHistory",Me)
'parser.Initialize
File.writestring(File.DirInternal,"Device.txt", "123456")
'If File.Exists(File.DirInternal, "Device.txt") = True Then
' Device_txt.Text = File.ReadString(File.DirInternal, "Device.txt")
'Job2.Download2("http://www.energysmartwaterheater.com/latestHistoryGet.php", _
' Array As String("DeviceText", Device_txt.Text))
'Else If File.Exists(File.DirInternal, "Device.txt") = False Then
' File.writestring(File.DirInternal,"Device.txt", "123456")
' Device_txt.Text = File.ReadString(File.DirInternal, "Device.txt")
'End If
End Sub
Sub Activity_Pause (Finishing As Boolean)
End Sub
Sub Activity_Resume
UpdateUi
End Sub
Sub Decrease_btn_Click
DegF = DegF - 1
DegC = DegC - 1
UpdateUi
End Sub
Sub Increase_Btn_Click
DegF = DegF + 1
DegC = DegC + 1
UpdateUi
End Sub
Sub Degrees_Btn_Click
'code to hold the button on true or false depending on the degrees setting you want.
End Sub
Sub UpdateUi
Temp_Txt.Text = DegF
'If Degress_Btn.Text = True Then
' Temp_Txt.Text = DegC
'DegF = DegC*9/5+32
'Else If Degress_Btn.Text = False Then
' Temp_Txt.Text = DegF
' DegC = (DegF-32)*5/9
'End If
End Sub
Sub Host_TabChanged
Dim DB As Float
Activity.Title = "Current Tab = " & Main.CurrentTab
If Main.CurrentTab = 0 Then
Device_txt.Text = File.ReadString(File.DirInternal, "Device.txt")
End If
If Main.CurrentTab = 1 Then
DisplayFwVer_Txt.Text = ""
DryFire_Txt.Text = ""
EcoError_Txt.Text = ""
ElementFail_Txt.Text = ""
FaultCodes_Txt.Text = ""
Grid_Txt.Text = ""
GridCmd_txt.Text = ""
HotWaterVol_Txt.Text = ""
LeakDetect_Txt.Text = ""
LowerTemp_Txt.Text = ""
MasterDispFail_Txt.Text = ""
MasterFwVer_Txt.Text = ""
MaxSetPoint_txt.Text = ""
Mode_Txt.Text = ""
ModFwVer_Txt.Text = ""
ModuleApi_Txt.Text = ""
SetPoint_Txt.Text = ""
SignalStrength_Txt.Text = ""
TankSensorFail_Txt.Text = ""
Units_Txt.Text = ""
UpdateRate_Txt.Text = ""
UpperTemp_Txt.Text = ""
WifiFwVer_Txt.Text = ""
End If
End Sub