def btn1_clicked(*args): if ac.getText(uiElements.btn1) != "starting..." and ( antManagerExecutable is None or antManagerExecutable.poll() is not None ): startExecutable() elif not workoutInProgress(): loadWorkout() else: stopWorkout()
def onValidateInput(self, string): text = ac.getText(self.textInput) ac.setText(self.textInput, "") ac.setFocus(self.textInput, 1) if len(text) > 0: if ac.sendChatMessage(text) == -1: self.delayedChat = text
def FuelEvent(x): global FuelSelection,amount,Gas amount = ac.getValue(FuelSelection) ac.setText(label3,"{}".format(round(amount))) Gas = ac.getText(label3) WriteData()
def onRender(*args): try: stateFound = antManagerState.updateFromMemory() if stateFound: if not workoutInProgress(): ac.setText(uiElements.btn1, "load workout") else: ac.setText(uiElements.btn1, "stop workout") ac.console("Workout message : " + repr(antManagerState.WorkoutMessage)) elif not stateFound and ac.getText(uiElements.btn1) != "starting...": ac.setText(uiElements.btn1, "start") except Exception as e: ac.console(repr(e)) antManagerState.TrackLength = ac.getTrackLength(0) / 1000 antManagerState.LapPosition = ac.getCarState(0, acsys.CS.NormalizedSplinePosition) * ac.getTrackLength(0) / 1000 uiElements.update(antManagerState) workoutUi.update(antManagerState) RaceState().updateToMemory()
def btn2_clicked(*args): if ac.getText(uiElements.btn1) == "starting...": antManagerExecutable.kill() ac.setText(uiElements.btn1, "start") if antManagerExecutable is not None and antManagerExecutable.poll() is None: stopExecutable()
def text(self) -> str: if self.has_id: return ac.getText(self.id) return self._text
def onValidateListener(string): global textInput text = ac.getText(textInput) ac.setText(textInput, '') ac.setFocus(textInput, 1) ac.sendChatMessage(text)