Ejemplo n.º 1
0
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()
Ejemplo n.º 2
0
 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
Ejemplo n.º 3
0
def FuelEvent(x):
    global FuelSelection,amount,Gas

    amount = ac.getValue(FuelSelection)
    ac.setText(label3,"{}".format(round(amount)))
    Gas = ac.getText(label3)
    WriteData()
Ejemplo n.º 4
0
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()
Ejemplo n.º 5
0
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()
Ejemplo n.º 6
0
 def text(self) -> str:
     if self.has_id:
         return ac.getText(self.id)
     return self._text
Ejemplo n.º 7
0
Archivo: nChat.py Proyecto: nuggs/nChat
def onValidateListener(string):
    global textInput
    text = ac.getText(textInput)
    ac.setText(textInput, '')
    ac.setFocus(textInput, 1)
    ac.sendChatMessage(text)