Skip to content

Commit

Permalink
Tb205gti spinnerText and fix for readconfig.py
Browse files Browse the repository at this point in the history
  • Loading branch information
BogGyver committed Oct 11, 2019
1 parent 4fc758c commit 923ba5c
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
9 changes: 8 additions & 1 deletion selfdrive/car/modules/test_UIBT_module.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import time
from selfdrive.car.modules.UIBT_module import UIButtons
from selfdrive.car.tesla.ACC_module import ACCMode
from selfdrive.car.tesla.PCC_module import PCCModes
Expand All @@ -14,11 +15,17 @@ def __init__(self):
["sound", "SND", [""]]]
self.UE = UIEvents(self)
self.cstm_btns = UIButtons(self,"Tesla Model S","tesla", False, False)
self.custom_alert_counter = 0
for i in range(6):
print (self.cstm_btns.btns[i].btn_name,len(self.cstm_btns.btns[i].btn_name))
print (self.cstm_btns.btns[i].btn_label,len(self.cstm_btns.btns[i].btn_label))
print (self.cstm_btns.btns[i].btn_label2,len(self.cstm_btns.btns[i].btn_label2))
print (self.cstm_btns.btns[i].btn_status)


cs = CarState()
cs = CarState()

while 1:
cs.UE.update_custom_ui()
CS.cstm_btns.send_button_info()
time.sleep(0.1)
1 change: 1 addition & 0 deletions selfdrive/car/tesla/carstate.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ def __init__(self, CP):
self.fix1916 = False
self.forceFingerprintTesla = False
self.eonToFront = 0.1
self.spinnerText = ""
#read config file
read_config_file(self)
### END OF MAIN CONFIG OPTIONS ###
Expand Down
14 changes: 12 additions & 2 deletions selfdrive/car/tesla/readconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class ConfigFile():

### Do NOT modify here, modify in /data/bb_openpilot.cfg and reboot
def read(self, into, config_path):
configr = configparser.ConfigParser()
configr = configparser.RawConfigParser()
file_changed = False

try:
Expand Down Expand Up @@ -317,6 +317,15 @@ def read(self, into, config_path):
comment = 'Set this setting to False if you do not want OP to autoupdate every time you reboot and there is a change on the repo'
)
file_changed |= didUpdate

#spiner_text -> spinnerText
into.spinnerText, didUpdate = self.read_config_entry(
config, configr, prev_file_contents, section = main_section,
entry = 'spinner_text', entry_type = str,
default_value = '%d',
comment = 'The text that is shown for the spinner when spawning the managed services.'
)
file_changed |= didUpdate

into.shouldLogCanErrors, didUpdate = self.read_config_entry(
config, configr, prev_file_contents, section = logging_section,
Expand Down Expand Up @@ -403,6 +412,7 @@ class CarSettings():
radarPosition = None
fix1916 = None
doAutoUpdate = None
spinnerText = None
shouldLogProcessCommErrors = None
shouldLogCanErrors = None

Expand All @@ -416,4 +426,4 @@ def get_value(self, name_of_variable):
# Legacy support
def read_config_file(into, config_path = default_config_file_path):
config_file = ConfigFile()
config_file.read(into, config_path)
config_file.read(into, config_path)
5 changes: 3 additions & 2 deletions selfdrive/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,13 +471,14 @@ def manager_update():
def manager_prepare(spinner=None):
# build cereal first
subprocess.check_call(["make", "-j4"], cwd=os.path.join(BASEDIR, "cereal"))

carSettings = CarSettings()
# build all processes
os.chdir(os.path.dirname(os.path.abspath(__file__)))

for i, p in enumerate(managed_processes):
if spinner is not None:
spinner.update("%d" % (100.0 * (i + 1) / len(managed_processes),))
spinText = carSettings.spinnerText
spinner.update(spinText % (100.0 * (i + 1) / len(managed_processes),))
prepare_managed_process(p)

def uninstall():
Expand Down

0 comments on commit 923ba5c

Please sign in to comment.