Browse Source

For all setValues(), always.

ui_file
Gregory Rudolph 4 years ago
parent
commit
51b3fd6c8e
Signed by: rudi
GPG Key ID: EF64F3CBD1A1EBDD
  1. 51
      main.go

51
main.go

@ -13,15 +13,15 @@ import (
var ( var (
// Info/Statuses // Info/Statuses
batteryLevel *widgets.QLineEdit batteryLevel *widgets.QLabel
batteryRange *widgets.QLineEdit batteryRange *widgets.QLabel
chargingState *widgets.QLineEdit chargingState *widgets.QLabel
minutesToFull *widgets.QLineEdit minutesToFull *widgets.QLabel
fastChargerInd *widgets.QLineEdit fastChargerInd *widgets.QLabel
batteryHeaterInd *widgets.QLineEdit batteryHeaterInd *widgets.QLabel
chargeDoorOpenInd *widgets.QLineEdit chargeDoorOpenInd *widgets.QLabel
insideTemp *widgets.QLineEdit insideTemp *widgets.QLabel
outsideTemp *widgets.QLineEdit outsideTemp *widgets.QLabel
// Controls // Controls
tempSetting *widgets.QLineEdit tempSetting *widgets.QLineEdit
@ -52,27 +52,18 @@ func main() {
vboxLayout := widgets.NewQVBoxLayout() vboxLayout := widgets.NewQVBoxLayout()
statusLayout := widgets.NewQFormLayout(nil) statusLayout := widgets.NewQFormLayout(nil)
batteryLevel = widgets.NewQLineEdit(nil) batteryLevel = widgets.NewQLabel(nil, 0)
batteryLevel.SetReadOnly(true)
batteryLevel.SetFixedWidth(30) batteryLevel.SetFixedWidth(30)
batteryRange = widgets.NewQLineEdit(nil) batteryRange = widgets.NewQLabel(nil, 0)
batteryRange.SetReadOnly(true) chargingState = widgets.NewQLabel(nil, 0)
chargingState = widgets.NewQLineEdit(nil) minutesToFull = widgets.NewQLabel(nil, 0)
chargingState.SetReadOnly(true) fastChargerInd = widgets.NewQLabel(nil, 0)
minutesToFull = widgets.NewQLineEdit(nil) batteryHeaterInd = widgets.NewQLabel(nil, 0)
minutesToFull.SetReadOnly(true)
fastChargerInd = widgets.NewQLineEdit(nil) chargeDoorOpenInd = widgets.NewQLabel(nil, 0)
fastChargerInd.SetReadOnly(true) insideTemp = widgets.NewQLabel(nil, 0)
batteryHeaterInd = widgets.NewQLineEdit(nil)
batteryHeaterInd.SetReadOnly(true)
chargeDoorOpenInd = widgets.NewQLineEdit(nil)
chargeDoorOpenInd.SetReadOnly(true)
insideTemp = widgets.NewQLineEdit(nil)
insideTemp.SetReadOnly(true)
insideTemp.SetFixedWidth(25) insideTemp.SetFixedWidth(25)
outsideTemp = widgets.NewQLineEdit(nil) outsideTemp = widgets.NewQLabel(nil, 0)
outsideTemp.SetReadOnly(true)
outsideTemp.SetFixedWidth(25) outsideTemp.SetFixedWidth(25)
tempSetting = widgets.NewQLineEdit(nil) tempSetting = widgets.NewQLineEdit(nil)
tempSetting.SetFixedWidth(25) tempSetting.SetFixedWidth(25)
@ -323,6 +314,7 @@ func honkHorn(c bool) {
showDialogue("There was an error honking the horn\n%+v", err) showDialogue("There was an error honking the horn\n%+v", err)
fmt.Printf("%+v\n", err) fmt.Printf("%+v\n", err)
} }
go setValues()
} }
func flash(c bool) { func flash(c bool) {
err := vehicle.FlashLights() err := vehicle.FlashLights()
@ -330,6 +322,7 @@ func flash(c bool) {
showDialogue("There was an error flashing the lights\n%+v", err) showDialogue("There was an error flashing the lights\n%+v", err)
fmt.Printf("%+v\n", err) fmt.Printf("%+v\n", err)
} }
go setValues()
} }
func openTrunk(c bool) { func openTrunk(c bool) {
err := vehicle.OpenTrunk("rear") err := vehicle.OpenTrunk("rear")
@ -337,6 +330,7 @@ func openTrunk(c bool) {
showDialogue("There was an error opening your trunk\n%+v", err) showDialogue("There was an error opening your trunk\n%+v", err)
fmt.Printf("%+v\n", err) fmt.Printf("%+v\n", err)
} }
go setValues()
} }
func openFrunk(c bool) { func openFrunk(c bool) {
err := vehicle.OpenTrunk("front") err := vehicle.OpenTrunk("front")
@ -344,6 +338,7 @@ func openFrunk(c bool) {
showDialogue("There was an error opening your frunk\n%+v", err) showDialogue("There was an error opening your frunk\n%+v", err)
fmt.Printf("%+v\n", err) fmt.Printf("%+v\n", err)
} }
go setValues()
} }
func showDialogue(msg string, a ...interface{}) { func showDialogue(msg string, a ...interface{}) {

Loading…
Cancel
Save