Sub GetListTempSensors()
Dim myselect As String
Dim sql As SQL = DBMdomotica.GetSQL
myselect = "SELECT tblinputs.* FROM tblinputs INNER JOIN tblmodules ON (tblinputs.idmodule = tblmodules.idmodule) WHERE tblmodules.soort = 'a'"
Dim myresult As List = DBMdomotica.SQLSelect(sql,myselect)
DBMdomotica.CloseSQL(sql)
If myresult.size > 0 Then
Dim r As Int
For r = 0 To myresult.Size - 1
Dim resultdata As Map = myresult.Get(r)
Dim mytemp As temperatuur
mytemp.beschrijving = resultdata.Get("beschrijving")
mytemp.inputid = resultdata.Get("idinput")
mytemp.modulecode = resultdata.Get("idmodule")
mytemp.tempvalue = 0
Dim mygauge As Gauge
mygauge.Initialize("")
mygauge.Tag = mytemp.modulecode
InitGauge(mygauge,-5,50,mytemp.tempvalue,1,mytemp.beschrijving,"°C","DASHBOARD","")
listTemp.Add(mygauge)
PanelMain.AddNode(mygauge,(r+1)*100,100,200,200)
Next
End If
End Sub
Sub InitGauge(s_gauge As Gauge, minValue As Double, maxValue As Double, Value As Double, decimal As Double, Title As String, Unit As String, Skin As String, subTitle As String )
Dim jo As JavaObject = s_gauge
jo.RunMethod("setSkinType", Array(Skin))
jo.RunMethod("setMinValue", Array(minValue))
jo.RunMethod("setMaxValue", Array(maxValue))
jo.RunMethod("setValue", Array(Value))
jo.RunMethod("setTitle", Array(Title))
jo.RunMethod("setUnit", Array(Unit))
jo.RunMethod("setSubTitle", Array(subTitle))
jo.RunMethod("setForegroundBaseColor", Array(fx.Colors.RGB(82,82,82))) ' Color for title, subtitle, unit, value, tick label, zeroColor
jo.RunMethod("setUnitColor", Array(fx.Colors.RGB(82,82,82)))
jo.RunMethod("setTitleColor", Array(fx.Colors.RGB(82,82,82)))
jo.RunMethod("setSubTitleColor", Array(fx.Colors.RGB(82,82,82)))
jo.RunMethod("setValueColor", Array(fx.Colors.RGB(82,82,82)))
jo.RunMethod("setBarBackgroundColor", Array(fx.Colors.RGB(255,64,64)))
jo.RunMethod("setBarColor", Array(fx.Colors.RGB(125,125,125)))
jo.RunMethod("setDecimals", Array(1))
End Sub