Ejemplo n.º 1
0
def acMain(ac_version):
    global uiElements, antManagerState, workoutUi
    appWindow = ac.newApp("ACSimCyclingDash")

    antManagerState = AntManagerState()
    antManagerState.eraseMemory()

    uiElements = UIElements(appWindow)
    uiElements.setup()

    workoutAppWindow = ac.newApp("WorkoutDash")
    workoutUi = WorkoutUI(workoutAppWindow)
    workoutUi.setup()

    return "ACSimCyclingDash"
Ejemplo n.º 2
0
def acMain(acVerison):
    global serPort, tick, appWindow, statusLabel

    try:
        ac.log("opening serial port {}".format(serialPortName))

        tick = ticker(
        )  # class below: keeps track of game tick rate and can be used to update over serial less frequently

        serPort = serial.Serial(port=serialPortName, baudrate=9600, timeout=0)
        time.sleep(3)
        serPort.write("0 0 \n".encode())

        appWindow = ac.newApp("vr-wind")
        ac.setSize(appWindow, 200, 200)

        statusLabel = ac.addLabel(appWindow, "Output: none yet")
        ac.setPosition(statusLabel, 5, 32)

        ac.log("vr-wind ready")

        return "vr-wind"

    except Exception as e:
        ac.log("startup error: {}".format(e))
Ejemplo n.º 3
0
def acMain(ac_version):
  global TYREINFO, optimal_spinner_id, optimal_spinner_shown
  appWindow = ac.newApp("Tyre Temperatures")
  ac.drawBackground(appWindow, background)  
  ac.drawBorder(appWindow, background)
  ac.setBackgroundOpacity(appWindow, background)
  ac.setSize(appWindow, x_app_size, y_app_size)
  TYREINFO = Tyre_Info(appWindow, x_start, y_start)
  ac.addRenderCallback(appWindow, onFormRender)
  
  TYREINFO.optimal_temp = d_optimal_temp
  TYREINFO.carinifilepath = inidir + getValidFileName(ac.getCarName(0)) + ".ini"
  TYREINFO.needwriteini = 1
  
  if os.path.exists(TYREINFO.carinifilepath):
    f = open(TYREINFO.carinifilepath, "r")
    TYREINFO.optimal_temp = int(f.readline()[8:])
    f.close()
    TYREINFO.needwriteini = 0
  
  optimal_spinner_id = ac.addSpinner(appWindow, "optimal")
  ac.setPosition(optimal_spinner_id, 0, y_app_size + 28)
  ac.setStep(optimal_spinner_id, 1)
  if inFahrenheit:
    ac.setRange(optimal_spinner_id, int(CelsiusToFahrenheit(50)), int(CelsiusToFahrenheit(150)))
    ac.setValue(optimal_spinner_id, int(CelsiusToFahrenheit(TYREINFO.optimal_temp)))
  else:
    ac.setRange(optimal_spinner_id, 50, 150)
    ac.setValue(optimal_spinner_id, TYREINFO.optimal_temp)
  ac.addOnValueChangeListener(optimal_spinner_id, onValueChanged)
  optimal_spinner_shown = 1
  
  ac.log("Danny Giusa Tyre Temperatures loaded")
  return "Danny Giusa Tyre Temperatures"
Ejemplo n.º 4
0
	def __init__(self, name="defaultAppWindow", title="", icon=True, width=100, height=100, scale=1, texture=""):
		# local variables
		self.name        = name
		self.title       = title
		self.width       = width
		self.height      = height
		self.x           = 0
		self.y           = 0
		self.is_attached = False
		self.attached_l  = -1
		self.attached_r  = -1
		
		# creating the app window
		self.app = ac.newApp(self.name)
		
		# default settings
		ac.drawBorder(self.app, 0)
		ac.setBackgroundOpacity(self.app, 0)
		if icon is False:
			ac.setIconPosition(self.app, 0, -10000)
		
		# applying settings
		ac.setTitle(self.app, self.title)
		ac.setBackgroundTexture(self.app, texture)
		ac.setSize(self.app, math.floor(self.width*scale), math.floor(self.height*scale))
Ejemplo n.º 5
0
def acMain(ac_version):
    global l_velocity, f
    time.strftime('%Y-%m-%d %H:%M:%S')
    app_name = "SAE Dummy Data Generator"
    app_window = ac.newApp(app_name)
    ac.setSize(app_window, 200, 200)

    l_velocity = ac.addLabel(app_window, "Velocity: --")
    ac.setPosition(l_velocity, 3, 30)
    
    f = open('apps\python\SAE\dummydata.txt', 'w')
    f.write('INSERT INTO SensorData (CanId, Data, UTCTimestamp) VALUES')
    
    # ac.console("CONNECTING TO DATABASE...")
    # connection = connector.connect(
    #    host="ts20.billydasdev.com",
    #    user="******",
    #    passwd="ts20",
    #    port="3306",
    #    db="ts20"
    # )
    # cursor = connection.cursor(prepared=True)
    # ac.console("CONNECTED!")

    return app_name
def acMain(ac_version):
    global updater, appHeight, appWidth, appWindow, numSecondsSpinner
    appWindow = ac.newApp("Traction Circle")
    ac.setSize(appWindow, appWidth, appHeight)
    ac.drawBorder(appWindow, 0)

    try:
        model = TractionCircleModel()
        assetto_corsa = AssettoCorsa()

        maxTimeSpan = 3
        numSecondsSpinner = ac.addSpinner(appWindow, 'Time Span(s)')
        ac.setPosition(numSecondsSpinner, 0, appHeight - 20)
        ac.setSize(numSecondsSpinner, 100, 20)
        ac.setRange(numSecondsSpinner, 1, 10)
        ac.setValue(numSecondsSpinner, maxTimeSpan)
        ac.addOnValueChangeListener(numSecondsSpinner, updateMaxTimeRange)

        gPlotter = GPlotter(appWidth, appHeight, maxG, maxG)
        view = TractionCircleView(appWindow, model, gPlotter, MovingAveragePlotter(10) )
        updater = TractionCircleUpdater(assetto_corsa, view, model, maxTimeRange=maxTimeSpan)

        ac.addRenderCallback(appWindow, doUpdate)
    except Exception as e:
        ac.log(str(traceback.format_exc()))

    return "Traction Circle"
Ejemplo n.º 7
0
def acMain(ac_version):

    global appwindow, speed_meters_s, angular_vel, gas_brake_clutch_handbrake, steer_pos, lap_invalidated, current_lap, last_lap, performance_meter

    appWindow = ac.newApp("TensorTrainer")
    ac.setSize(appWindow, 200, 200)
    speed_meters_s = ac.addLabel(appWindow, "Speed(M/s): 0")
    angular_vel = ac.addLabel(appWindow, "Ang.Vel.: 0")
    gas_brake_clutch_handbrake = ac.addLabel(appWindow, "GBCH: 0000")
    steer_pos = ac.addLabel(appWindow, "Steer: 0")
    lap_invalidated = ac.addLabel(appWindow, "LapValid: Yes")
    current_lap = ac.addLabel(appWindow, "Current: 0")
    last_lap = ac.addLabel(appWindow, "Last: 0")
    performance_meter = ac.addLabel(appWindow, "Perf: 0")

    ac.setPosition(speed_meters_s, 3, 30)
    ac.setPosition(angular_vel, 3, 45)
    ac.setPosition(gas_brake_clutch_handbrake, 3, 60)
    ac.setPosition(steer_pos, 3, 75)
    ac.setPosition(lap_invalidated, 3, 90)
    ac.setPosition(current_lap, 3, 105)
    ac.setPosition(last_lap, 3, 120)
    ac.setPosition(performance_meter, 3, 135)

    return "TensorTrainer"
Ejemplo n.º 8
0
def acMain(ac_version):
    global appWindow, label1, logPrefix, appName, splitsRenderer
    ac.console(logPrefix + "acMain")
    try:
        appWindow = ac.newApp(appName)
        ac.setTitle(appWindow, "")
        ac.setSize(appWindow, 300, 300)
        ac.drawBorder(appWindow, 0)
        ac.setBackgroundOpacity(appWindow, 0.3)

        resetBtn = ac.addButton(appWindow, "R")
        ac.setPosition(resetBtn, 5, 30)
        ac.setSize(resetBtn, 30, 30)
        ac.addOnClickedListener(resetBtn, onResetClicked)

        newSplitBtn = ac.addButton(appWindow, "N")
        ac.setPosition(newSplitBtn, 40, 30)
        ac.setSize(newSplitBtn, 30, 30)
        ac.addOnClickedListener(newSplitBtn, onNewSplitClicked)

        #label1 = ac.addLabel(appWindow, "____")
        #ac.setPosition(label1, 0, 70)

        splitsRenderer = SplitsRenderer(2, 62, 10, 10)

        ac.addRenderCallback(appWindow, onRender)
        ac.addOnAppActivatedListener(appWindow, onActivate)
        ac.addOnAppDismissedListener(appWindow, onDismiss)

        ac.console(logPrefix + "Initialized")
    except:
        printExceptionInfo("acMain")

    return appName
Ejemplo n.º 9
0
    def __init__(self, acd, configs):
        """ Default constructor. """
        self.__active = False
        self.__data = Data()
        self.__data_log = []
        self.__info = info
        self.__options = {
            "Logging": configs.get_bool_option("Logging"),
            "RPMPower": configs.get_bool_option("RPMPower")
        }
        self.__window_id = ac.newApp("Live Telemetry Engine")
        ac.drawBorder(self.__window_id, 0)
        ac.setBackgroundOpacity(self.__window_id, 0.0)
        ac.setIconPosition(self.__window_id, 0, -10000)
        ac.setTitle(self.__window_id, "")

        position = configs.get_window_position("EN")
        ac.setPosition(self.__window_id, *position)

        size = configs.get_option("Size")
        mult = BoxComponent.resolution_map[size]
        ac.setSize(self.__window_id, 512 * mult, 85 * mult)

        self.__components = []
        self.__components.append(RPMPower(acd, size, self.__window_id))

        # Only starts to draw after the setup.
        self.set_active(configs.is_window_active("EN"))
Ejemplo n.º 10
0
  def reinitialize_statusbox(self):
    field = 'enable_timing_window'
    if field not in self.data.config:
      self.data.config[field] = False

    if not self.data.config[field]:
      # Window is explicitly disabled, bail out.
      return

    if not hasattr(self.data, 'app_id2'):
      app_id2 = ac.newApp('deltabar timer')
      if app_id2 < 0:
        return  # bail out, new window did not work
      else:
        self.data.app_id2 = app_id2

    ac.setTitle(self.data.app_id2, "")
    ac.setBackgroundOpacity(self.data.app_id2, 0.5)
    ac.drawBorder(self.data.app_id2, 0)
    ac.setIconPosition(self.data.app_id2, 0, -10000)
    ac.setSize(self.data.app_id2, 300, 200)

    self.statusbox = statusbox.StatusBox(self.data, self.track.sector_count,
                                         bar_mode=self.bar_mode)
    self.statusbox.update_all(self.bar_mode)
Ejemplo n.º 11
0
def acMain(ac_version):
    """Main function that is invoked by Assetto Corsa."""
    global NOTIFICATION, LAPTIME_LABELS
    app = ac.newApp("AC-Ranking")
    ac.setSize(app, 400, 300)
    NOTIFICATION = ac.addLabel(app, '')
    ac.setPosition(NOTIFICATION, 15, 20)
    ac.setSize(NOTIFICATION, 190, 20)

    auth = read_auth()
    validate_token(auth['user'], auth['token'])

    validate_token_button = ac.addButton(app, 'Validate token')
    ac.setPosition(validate_token_button, 20, 40)
    ac.setSize(validate_token_button, 120, 20)
    ac.addOnClickedListener(validate_token_button, validate_token_button_func)

    refresh_button = ac.addButton(app, '\u21BB')
    ac.setPosition(refresh_button, 300, 5)
    ac.setSize(refresh_button, 15, 18)
    ac.addOnClickedListener(refresh_button, refresh_button_func)

    LAPTIME_LABELS = tuple(ac.addLabel(app, '#' + str(i)) for i in range(10))
    for index, label in enumerate(LAPTIME_LABELS):
        ac.setSize(label, 120, 20)
        ac.setPosition(label, 200, (index * 20) + 50)
    get_laptimes(ac.getCarName(0), ac.getTrackName(0),
                 ac.getTrackConfiguration(0) or None)
    return "ACR"
Ejemplo n.º 12
0
def acMain(ac_version):
    global DRIVER, TRACK, CAR, WINDOW, LAP_LABELS, LAP_VALID_INDICATOR

    DRIVER = ac.getDriverName(DRIVER_ID_SELF)
    TRACK = '%s-%s' % (ac.getTrackName(DRIVER_ID_SELF),
                       ac.getTrackConfiguration(DRIVER_ID_SELF))
    CAR = ac.getCarName(DRIVER_ID_SELF)

    ac.console('Initialize %s: driver %s on %s in %s' %
               (NAME, DRIVER, TRACK, CAR))

    WINDOW = ac.newApp(NAME)
    ac.setSize(WINDOW, *SIZE)
    ac.setTitle(NAME)

    if ac.addOnAppActivatedListener(WINDOW, onActivate) == -1:
        ac.console('Failed to add listener activate')
    if ac.addOnAppDismissedListener(WINDOW, onDeactivate) == -1:
        ac.console('Failed to add listener deactivate')

    i = 0
    while i < LAP_COUNT:
        label = ac.addLabel(WINDOW, 'Waiting for lap time...')
        LAP_LABELS.append(label)
        i += 1
    LAP_VALID_INDICATOR = ac.addLabel(WINDOW, 'Clean')
    refreshLapDisplay()

    return NAME
Ejemplo n.º 13
0
def acMain(ac_version): #app window init; global variables for later updating go here
    global appWindow
    appWindow = ac.newApp(appName)
    ac.setTitle(appWindow, appName)
    ac.setSize(appWindow, width, height)

    ac.log("z3D Gauge loaded")
    ac.console("z3D Gauge console test")

    ####################################################declaring gauge elements
    # gonna need new textures like
    # rpm_bar = ac.newTexture(app_path + theme_path + "rpm_bar.png")

    global l_kmph, l_rpm, l_gear, acceleration
    global ascii_RPM
    l_kmph = ac.addLabel(appWindow, "KMPH")
    l_rpm = ac.addLabel(appWindow, "RPM")
    l_gear = ac.addLabel(appWindow, "Current gear")
    ascii_RPM = ac.addLabel(appWindow, "")
    acceleration = ac.addLabel(appWindow, "")
    #l_TC = ac.addLabel(appWindow, "TC on/off")      #non-functional
    #l_ABS = ac.addLabel(appWindow, "ABS on/off")    #non-functional

    ac.setPosition(l_kmph, 3, 30)
    ac.setPosition(l_rpm, 3, 60)
    ac.setPosition(l_gear, 3, 80)
    ac.setPosition(ascii_RPM, 3, 160)
    ac.setPosition(acceleration, 3, 580)

    ac.addRenderCallback(appWindow, appGL) # -> links this app's window to an OpenGL render function

    return appName
Ejemplo n.º 14
0
def acMain(ac_version):
    global version, appName, mainApp, x_app_size, y_app_size, backgroundOpacity, customFontName

    try:
        debug("starting version " + version)

        mainApp = ac.newApp(appName)
        ac.setTitle(mainApp, "")
        ac.drawBorder(mainApp, 0)
        ac.setIconPosition(mainApp, 0, -10000)
        ac.setBackgroundOpacity(mainApp, backgroundOpacity)
#        ac.initFont(0, customFontName, 0, 0)
        ac.setSize(mainApp, x_app_size, y_app_size)
        ac.addOnAppActivatedListener(mainApp, onMainAppActivatedListener)
        ac.addOnAppDismissedListener(mainApp, onMainAppDismissedListener)
        ac.addRenderCallback(mainApp, onMainAppFormRender)

        getSettings()
        createUI()

        return appName

    except exception:
        debug(repr(traceback.format_exception(exc_type, exc_value, exc_traceback)))
        showMessage("Error: " + traceback.format_exc())
Ejemplo n.º 15
0
def acMain(ac_version):
    global appWindow, label1, logPrefix, appName, cfg, ui_enableButton
    ac.console(logPrefix + "acMain")
    try:
        appWindow = ac.newApp(appName)

        cfg = Configuration()
        cfg.load()

        ac.setTitle(appWindow, "")
        ac.setSize(appWindow, 400, 200)
        ac.drawBorder(appWindow, 0)
        ac.setBackgroundOpacity(appWindow, 0)

        ac.addRenderCallback(appWindow, onRender)

        ui_enableButton = ac.addButton(appWindow, "Enable")
        ac.setPosition(ui_enableButton, 0, 30)
        ac.setSize(ui_enableButton, 70, 30)
        ac.addOnClickedListener(ui_enableButton, onEnableButtonClicked)

        label1 = ac.addLabel(appWindow, "____")
        ac.setPosition(label1, 0, 65)

        if cfg.enable > 0:
            ac.setText(ui_enableButton, "Disable")
            startTelemetry()

        ac.console(logPrefix + "Initialized")
    except:
        printExceptionInfo("acMain")

    return appName
Ejemplo n.º 16
0
    def reinitialize_statusbox(self):
        field = 'enable_timing_window'
        if field not in self.data.config:
            self.data.config[field] = False

        if not self.data.config[field]:
            # Window is explicitly disabled, bail out.
            return

        if not hasattr(self.data, 'app_id2'):
            app_id2 = ac.newApp('deltabar timer')
            if app_id2 < 0:
                return  # bail out, new window did not work
            else:
                self.data.app_id2 = app_id2

        ac.setTitle(self.data.app_id2, "")
        ac.setBackgroundOpacity(self.data.app_id2, 0.5)
        ac.drawBorder(self.data.app_id2, 0)
        ac.setIconPosition(self.data.app_id2, 0, -10000)
        ac.setSize(self.data.app_id2, 300, 200)

        self.statusbox = statusbox.StatusBox(self.data,
                                             self.track.sector_count,
                                             bar_mode=self.bar_mode)
        self.statusbox.update_all(self.bar_mode)
Ejemplo n.º 17
0
    def __init__(self, cfg):
        # Config data
        self.cfg = cfg

        # Set up app window
        self.id = ac.newApp(self.cfg.app_name)

        # Set app dimensions
        ac.setSize(self.id, self.cfg.app_width, self.cfg.app_height)

        # TODO Check if this works.
        self.bg_texture_path = cfg.app_dir + "/img/bg.png"
        # self.bg_texture_path = "apps/python/traces/img/bg.png"
        ac.setBackgroundTexture(self.id, self.bg_texture_path)

        # Hide default background and border
        ac.setBackgroundOpacity(self.id, 0)
        ac.drawBorder(self.id, 0)

        # Empty app title in order to hide it
        ac.setTitle(self.id, "")

        # Move app icon off-screen
        ac.setIconPosition(self.id, 0, -10000)

        # Initialize empty list of drawable objects.
        self.drawables = []
Ejemplo n.º 18
0
def acMain(ac_version):
    global appWindow

    appWindow = ac.newApp("nCountdown")
    ac.setSize(appWindow, 177, 60)
    nButton = nCountdown(appWindow)

    return "nCountdown"
Ejemplo n.º 19
0
def acMain(ac_version):
  try:
    deltabar_data.app_id = ac.newApp('deltabar')
    ac.addRenderCallback(deltabar_data.app_id, onRender)

    return deltabar_app.acMain(ac_version)
  except:
    log_error()
    raise
Ejemplo n.º 20
0
def acMain(ac_version):
    global uiElements, f_loc
    appWindow=ac.newApp("AIGPXRecorder")

    uiElements = UIElements(appWindow)
    uiElements.setup()
    uiElements.update(0,0,0)

    return "AIGPXRecorder"
Ejemplo n.º 21
0
def createApp(label):
    app = ac.newApp(label)
    ac.setTitle(app, "")
    ac.setIconPosition(app, 0, -10000)
    ac.setSize(app, 100, 50)
    ac.drawBorder(app, 0)

    label = ac.addLabel(app, "")
    ac.setPosition(label, 10, 5)
    return app, label
Ejemplo n.º 22
0
def acMain(ac_version):
    global appWindow
    
    appWindow = ac.newApp("Analog Speedometer")
    ac.setTitle(appWindow, "")
    ac.setIconPosition(appWindow, 0, -10000)
    ac.setSize(appWindow, width, height)
    ac.drawBorder(appWindow, 0)

    ac.addRenderCallback(appWindow, drawNeedle)
Ejemplo n.º 23
0
def acMain(ac_version):
	global appWindow, CamberIndicators, CheckBoxes, Buttons, Options, Labels, UIData
	loadOptions()
	appWindow = ac.newApp("CamberExtravaganza")
	ac.setSize(appWindow, 200, 200)
	ac.drawBorder(appWindow, 0)
	ac.setBackgroundOpacity(appWindow, 0)
	ac.setIconPosition(appWindow, 0, -10000)

	# Only enable rendering if app is activated
	ac.addOnAppActivatedListener(appWindow, onAppActivated)
	ac.addOnAppDismissedListener(appWindow, onAppDismissed)

	# Target Camber Labels
	Labels["target"] = ac.addLabel(appWindow, "Target:")
	ac.setPosition(Labels["target"], 85, 100)
	ac.setFontSize(Labels["target"], 10)
	Labels["targetCamberF"] = ac.addLabel(appWindow, "")
	ac.setPosition(Labels["targetCamberF"], 75, 76)
	ac.setFontSize(Labels["targetCamberF"], 24)
	Labels["targetCamberR"] = ac.addLabel(appWindow, "")
	ac.setPosition(Labels["targetCamberR"], 75, 105)
	ac.setFontSize(Labels["targetCamberR"], 24)

	# Options Checkbox
	CheckBoxes["options"] = ac.addCheckBox(appWindow, "Options")
	ac.setPosition(CheckBoxes["options"], 50, 225)
	ac.addOnCheckBoxChanged(CheckBoxes["options"], checkboxHandler)

	# Option Buttons
	uidata = [
		["drawGraphs", "Draw Graphs", drawGraphsHandler],
		["normalize", "Normalize", normalizeHandler],
		["useSpectrum", "Use Spectrum", useSpectrumHandler]
	]
	x = 50
	y = 255
	dy = 30
	for d in uidata:
		Buttons[d[0]] = ac.addButton(appWindow, d[1])
		ac.setPosition(Buttons[d[0]], x, y)
		ac.setSize(Buttons[d[0]], 100, 25)
		ac.addOnClickedListener(Buttons[d[0]], d[2])
		ac.setVisible(Buttons[d[0]], 0)
		y += dy

	# Get optimal camber from files
	loadTireData()

	CamberIndicators["FL"] = CamberIndicator(appWindow, 25, 75)
	CamberIndicators["FR"] = CamberIndicator(appWindow,125, 75)
	CamberIndicators["RL"] = CamberIndicator(appWindow, 25,175)
	CamberIndicators["RR"] = CamberIndicator(appWindow,125,175)
	ac.addRenderCallback(appWindow, onFormRender)
	return "CamberExtravaganza"
Ejemplo n.º 24
0
def acMain(ac_version):
    global appWindow, Labels, gearSpacing, fontSize, gears, PxPer1000RPM, RPMdivs
    appWindow = ac.newApp("Reventach")
    ac.setSize(appWindow, appWidth, appHeight)
    ac.drawBorder(appWindow, 0)
    ac.setBackgroundOpacity(appWindow, 0)
    ac.setIconPosition(appWindow, 0, -10000)
    ac.setTitle(appWindow, "")

    # Only enable rendering if app is activated
    ac.addOnAppActivatedListener(appWindow, onAppActivated)
    ac.addOnAppDismissedListener(appWindow, onAppDismissed)

    loadCarData()
    PxPer1000RPM = 1000 * appHeight / CarData["maxRPM"]
    RPMdivs = CarData["maxRPM"] // 10000 + 1
    #~ fontSize = PxPer1000RPM * 0.5 * RPMdivs
    fontSize = appHeight / 15

    y = appHeight - PxPer1000RPM * RPMdivs
    count = RPMdivs
    while y > -1:
        dx = (appHeight - y) / lineSlope
        Labels["rpmL" + str(count)] = ac.addLabel(appWindow, str(count))
        ac.setPosition(Labels["rpmL" + str(count)], dx - fontSize,
                       y - fontSize / 2)
        ac.setFontSize(Labels["rpmL" + str(count)], fontSize)
        ac.setFontAlignment(Labels["rpmL" + str(count)], "center")
        Labels["rpmR" + str(count)] = ac.addLabel(appWindow, str(count))
        ac.setPosition(Labels["rpmR" + str(count)], appWidth - dx + fontSize,
                       y - fontSize / 2)
        ac.setFontSize(Labels["rpmR" + str(count)], fontSize)
        ac.setFontAlignment(Labels["rpmR" + str(count)], "center")

        if y < PxPer1000RPM * RPMdivs - 1:
            ac.setFontColor(Labels["rpmL" + str(count)], 0.7, 0.0, 0.0, 0.9)
            ac.setFontColor(Labels["rpmR" + str(count)], 0.7, 0.0, 0.0, 0.9)

        y -= (PxPer1000RPM * RPMdivs)
        count += RPMdivs

    for n in range(CarData["totalGears"]):
        gears.insert(0, str(n + 1))

    gearSpacing = appHeight / (CarData["totalGears"] + 2)
    fontSize = gearSpacing * 0.8

    for n, c in enumerate(gears):
        Labels["gear" + c] = ac.addLabel(appWindow, c)
        ac.setPosition(Labels["gear" + c], appWidth / 2, (n * gearSpacing))
        ac.setFontSize(Labels["gear" + c], fontSize)
        ac.setFontAlignment(Labels["gear" + c], "center")

    ac.addRenderCallback(appWindow, onFormRender)
    return "Reventach"
Ejemplo n.º 25
0
Archivo: Time.py Proyecto: Djudjou/Time
def acMain(ac_version):
    global label1

    appWindow = ac.newApp("Time")
    ac.setTitle(appWindow, '')
    ac.setSize(appWindow, 180, 30)
    ac.setPosition(appWindow, 1500, 50)
    label1 = ac.addLabel(appWindow, "")
    ac.setPosition(label1, 60, 5)

    return "Time"
def acMain(ac_version):
	global appWindow, timeLabel
	appWindow=ac.newApp("Time")
	ac.setTitle(appWindow,"Time")
	ac.setSize(appWindow,160,60)
	ac.drawBorder(appWindow,0)
	ac.setBackgroundOpacity(appWindow,0)
	theTime=datetime.now()
	timeLabel=ac.addLabel(appWindow, "{}".format(theTime.strftime("%H:%M")))
	ac.setPosition(timeLabel,70,30)
	ac.addRenderCallback(appWindow , onFormRender)
	return "Time"
Ejemplo n.º 27
0
def acMain(ac_version):
  global fuelUsage
  appWindow = ac.newApp("Fuel Usage")
  ac.drawBackground(appWindow, background)  
  ac.drawBorder(appWindow, background)
  ac.setBackgroundOpacity(appWindow, background)
  ac.setSize(appWindow, x_app_size, y_app_size)
  fuelUsage = Fuel_Usage(appWindow, x_start, y_start)  
  ac.addRenderCallback(appWindow, onFormRender)
  
  ac.log("Fuel Usage App loaded")
  return "Fuel Usage App"
Ejemplo n.º 28
0
def acMain(ac_version):
    global rpm_display, boost_display, gear_display, speed_display, fuel_display
    global min_rpm_spinner_Label, min_rpm_spinner, max_rpm_spinner_Label, max_rpm_spinner, settings_box_Label
    global units_spinner_Label, units_spinner
    global rpm_tag, speed_tag, boost_tag, fuel_tag

    appWindow = ac.newApp("RevHunterSkunkworks")
    ac.setTitle(appWindow, " ")
    ac.setSize(appWindow, windowx, windowy)
    ac.drawBorder(appWindow, 0)
    ac.setBackgroundOpacity(appWindow, 0)
    ac.addRenderCallback(appWindow, onFormRender)

    rpm_display = Label(appWindow, "").setSize(0, 0).setPosition(
        (2.05 * windowx / 3),
        (1.05 * windowy / 3)).setFontSize(50).setFontAlign("right")
    gear_display = Label(appWindow).setSize(0, 0).setPosition(
        (windowx / 2), -50).setFontSize(140).setFontAlign("center")
    speed_display = Label(appWindow, "").setSize(0, 0).setPosition(
        (1.25 * windowx / 3),
        (1.05 * windowy / 3)).setFontSize(50).setFontAlign("right")
    fuel_display = Label(appWindow, "").setSize(0, 0).setPosition(
        (0.8 * windowx / 3),
        (1.25 * windowy / 3)).setFontSize(35).setFontAlign("right")
    settings_box_Label = Label(appWindow, "").setSize(0, 0).setPosition(
        940, 83).setFontSize(15).setFontAlign("left")

    rpm_tag = Label(appWindow, "").setText("RPM").setSize(0, 0).setPosition(
        (2.06 * windowx / 3),
        (2.1 * windowy / 3)).setFontSize(15).setFontAlign("left")
    speed_tag = Label(appWindow, "").setText("MPH").setSize(0, 0).setPosition(
        (1.26 * windowx / 3),
        (2.1 * windowy / 3)).setFontSize(15).setFontAlign("left")
    fuel_tag = Label(appWindow, "").setText("%FUEL").setSize(0, 0).setPosition(
        (0.81 * windowx / 3),
        (1.9 * windowy / 3)).setFontSize(15).setFontAlign("left")

    min_rpm_spinner = ac.addSpinner(appWindow, "Min %RPM")
    spinnerConfig(min_rpm_spinner, 0, 125, 80, 20, 0, 1, 100, 80, setMinRPM, 0)
    max_rpm_spinner = ac.addSpinner(appWindow, "Max %RPM")
    spinnerConfig(max_rpm_spinner, 100, 125, 80, 20, 90, 1, 100, 97, setMaxRPM,
                  0)

    units_spinner = ac.addSpinner(appWindow, "Units")
    spinnerConfig(units_spinner, 200, 125, 80, 20, 1, 1, 2, 1, setUnits, 0)

    settings_box = ac.addCheckBox(appWindow, "")
    ac.setPosition(settings_box, 950, 95)
    ac.setSize(settings_box, 10, 10)

    ac.addOnCheckBoxChanged(settings_box, toggle_settings_visiblity)

    return "RevHunterSkunkworks"
Ejemplo n.º 29
0
def acMain(ac_version):
    global server
    try:
        appWindow = ac.newApp(APP_NAME)
        ac.setSize(appWindow, 200, 200)
        server = socketserver.UDPServer(('localhost', 18149), UDPServer)
        threading.Thread(target=server.serve_forever).start()
        setupUI(appWindow)
        log("Startup Complete")
    except Exception as e:
        log("ERROR:  {}".format(e))
    return APP_NAME
Ejemplo n.º 30
0
 def __init__(self, name, tyre=None, render_function=None):
     self.window = ac.newApp(name)
     self.tyre = tyre
     ac.setIconPosition(self.window, 9999999, 99999999)  # hide the icon
     ac.setSize(self.window, TyreWindow.width, TyreWindow.height)
     self.opt_label = ac.addLabel(self.window, "Opt:")
     ac.setPosition(self.opt_label, 5, 50)
     self.slip_label = ac.addLabel(self.window, "Slip:\nSkid:")
     ac.setPosition(self.slip_label, 5, 70)
     self.starting_label_no = ac.addLabel(self.window, "")
     ac.addRenderCallback(self.window, render_function)
     ac.setFontSize(self.starting_label_no, 25)
     ac.setPosition(self.starting_label_no, 35, 20)
Ejemplo n.º 31
0
Archivo: nChat.py Proyecto: nuggs/nChat
def acMain(ac_version):
    global textInput, appWindow, inputWindow, messages, lines, maxLines
    appWindow = ac.newApp('nChat')
    inputWindow = ac.newApp('nInput')

    ac.setSize(appWindow, 500, 100)
    ac.drawBorder(appWindow, 0)
    ac.setTitle(appWindow, '')
    ac.setIconPosition(appWindow, -9000, 0)
    ac.setBackgroundOpacity(appWindow, 0)

    ac.setSize(inputWindow, 435, 62)
    ac.drawBorder(inputWindow, 0)
    ac.setTitle(inputWindow, '')
    ac.setIconPosition(inputWindow, -9000, 0)
    ac.setBackgroundOpacity(inputWindow, 0)

    textInput = ac.addTextInput(inputWindow, 'TEXT_INPUT')
    ac.setPosition(textInput, 1, 32)
    ac.setSize(textInput, 435, 30)

    ac.addOnChatMessageListener(appWindow, onChatMessage)
    ac.addOnClickedListener(appWindow, onWindowClick)

    ac.addOnValidateListener(textInput, onValidateListener)
    ac.addOnClickedListener(inputWindow, onWindowClick)

    for i in range(0, maxLines):
        lines.append([ac.addLabel(appWindow, ''), ac.addLabel(appWindow, '')])
        for x in range(0, 2):
            ac.setSize(lines[i][x], 14*60, 14)
            ac.setPosition(lines[i][x], 0, i*14+5)
            ac.setFontSize(lines[i][x], 14)

    # Maybe add back in later
    #lines.reverse()

    onChatMessage('Loaded...', 'nChat')
    return "nChat"
Ejemplo n.º 32
0
def acMain(ac_version):
    global appWindow, ser, compData
    appWindow=ac.newApp("joeStuff")
    ac.setSize(appWindow,400,400)
    ac.console("addonLoad----OK")    
    ac.console("serialConn---"+str(ser.connect()))
    
    for x in range(0, 4):
        ac.console(names[x]+ " "+ str(values[names[x]]))
        nData = wrData(appWindow,names[x], 0, (x *100) + 40, values[names[x]])
        compData.append(nData)
    ser.sendData([32767, 32767, 32767, 32767, 32767, 32767])
    return "bsComm"
Ejemplo n.º 33
0
def acMain(ac_version):
    # При запуске приложения создаётся небольшое окно и выполняется инициализация.
    global label, leaderboard  #, httpThread
    name = "ACTimingDataSender"
    appWindow = ac.newApp(name)
    ac.setSize(appWindow, 200, 70)
    label = ac.addLabel(appWindow, "Label here")
    ac.setPosition(label, 3, 30)
    postLogMessage("ACTiming HTTP plugin OK")
    leaderboard = Leaderboard()
    postLogMessage("Leaderboard created")
    postLogMessage("Running directory: " + __file__)
    return name  # Возвращается имя приложения - требование AC
Ejemplo n.º 34
0
    def __init__(self, acd: ACD, configs: Config, wheel_index: int) -> None:
        """ Default constructor receive the index of the wheel it will draw info. """
        self.__wheel = WheelPos(wheel_index)
        self.__active = False
        self.__data = Data()
        self.__data_log = []
        self.__info = info
        self.__options = {
            "Camber": configs.get_bool_option("Camber"),
            "Dirt": configs.get_bool_option("Dirt"),
            "Height": configs.get_bool_option("Height"),
            "Load": configs.get_bool_option("Load"),
            "Lock": configs.get_bool_option("Lock"),
            "Logging": configs.get_bool_option("Logging"),
            "Pressure": configs.get_bool_option("Pressure"),
            "Suspension": configs.get_bool_option("Suspension"),
            "Temps": configs.get_bool_option("Temps"),
            "Tire": configs.get_bool_option("Tire"),
            "Wear": configs.get_bool_option("Wear")
        }
        self.__window_id = ac.newApp("Live Telemetry {}".format(
            self.__wheel.name()))
        ac.drawBorder(self.__window_id, 0)
        ac.setBackgroundOpacity(self.__window_id, 0.0)
        ac.setIconPosition(self.__window_id, 0, -10000)
        ac.setTitle(self.__window_id, "")

        position = configs.get_window_position(self.__wheel.name())
        ac.setPosition(self.__window_id, *position)

        size = configs.get_option("Size")
        mult = BoxComponent.resolution_map[size]
        ac.setSize(self.__window_id, 512 * mult, 271 * mult)

        self.__components = []
        self.__components.append(Temps(acd, size, self.__wheel))
        self.__components.append(Dirt(size))
        self.__components.append(Lock(acd, size, self.__wheel))
        self.__components.append(Tire(acd, size, self.__wheel))

        self.__components.append(Camber(size))
        self.__components.append(Suspension(size, self.__wheel))
        self.__components.append(Height(size, self.__wheel, self.__window_id))
        self.__components.append(
            Pressure(acd, size, self.__wheel, self.__window_id))
        self.__components.append(Wear(size, self.__wheel))
        # Needs to be the last to render above all components
        self.__components.append(Load(size, self.__wheel))

        # Only draw after the setup
        self.set_active(configs.is_window_active(self.__wheel.name()))
Ejemplo n.º 35
0
def acMain(ac_version):
    global scorelabel, currentscorelabel
    appWindow = ac.newApp("clubhighscores")
    ac.setSize(appWindow, 200, 200)
    ac.console("Club highsscores active!")
    currentscorelabel = ac.addLabel(appWindow, "")
    ac.setPosition(currentscorelabel, 3, 27)
    #lastlaptimelabel = ac.addLabel(appWindow, "");
    #ac.setPosition(lastlaptimelabel, 3, 50);
    scorelabel = ac.addLabel(appWindow, "No connection to Server")
    ac.setPosition(scorelabel, 3, 50)
    #73
    UpdateScores()
    return "clubhighscores"
Ejemplo n.º 36
0
def acMain(ac_version):
    # DEBUG
    t = threading.Thread(target=pyroserver)
    t.daemon = True
    t.start()

    try:
        hot_app_data.app_id = ac.newApp('hot_app')
        ac.addRenderCallback(hot_app_data.app_id, onRender)

        return hot_app_lib.hot_app_lib.my_hot_app.acMain(ac_version)
    except:
        log_error()
        raise
Ejemplo n.º 37
0
def acMain(ac_version):
  # DEBUG
  t = threading.Thread(target=pyroserver)
  t.daemon = True
  t.start()

  try:
    deltabar_data.app_id = ac.newApp('deltabar')
    ac.addRenderCallback(deltabar_data.app_id, onRender)

    return deltabar_lib.deltabar_lib.deltabar_app.acMain(ac_version)
  except:
    log_error()
    raise
Ejemplo n.º 38
0
def acMain(ac_version):
    global appWindow, sharedMem

    appWindow = ac.newApp("SimulatorController")

    ac.setTitle(appWindow, "SimulatorController")
    ac.setSize(appWindow, 300, 40)

    sharedmem = sharedMem.getsharedmem()
    sharedmem.serverName = ac.getServerName().encode('utf-8')
    sharedmem.acInstallPath = os.path.abspath(os.curdir).encode('utf-8')
    sharedmem.isInternalMemoryModuleLoaded = libInit
    sharedmem.pluginVersion = pluginVersion.encode('utf-8')
    return "SimulatorController"
def acMain(ac_version):  #----------------------------- App window Init

    # Don't forget to put anything you'll need to update later as a global variables
    global appWindow  # <- you'll need to update your window in other functions.

    appWindow = ac.newApp(appName)
    ac.setTitle(appWindow, appName)
    ac.setSize(appWindow, width, height)

    ac.addRenderCallback(
        appWindow,
        appGL)  # -> links this app's window to an OpenGL render function

    return appName
def acMain(ac_version):
  # DEBUG
  t = threading.Thread(target=pyroserver)
  t.daemon = True
  t.start()

  try:
    hot_app_data.app_id = ac.newApp('hot_app')
    ac.addRenderCallback(hot_app_data.app_id, onRender)

    return hot_app_lib.hot_app_lib.my_hot_app.acMain(ac_version)
  except:
    log_error()
    raise
def init():
    """Add the info window/app."""
    global info_telemetry
    window_info = ac.newApp("Info")
    ac.setSize(window_info, 160, 205)
    ac.addRenderCallback(window_info, render_app)

    info_telemetry = TelemetryProvider()
    compound_label = CompoundLabel(info_telemetry)
    optimum_temps_label = OptimumTempsLabel(info_telemetry)
    abs_label = ABSLabel(info_telemetry)
    tc_label = TractionControlLabel(info_telemetry)

    lateral_force_label = LateralForceLabel(info_telemetry)
    transverse_force_label = TransverseForceLabel(info_telemetry)

    drs_image_label = DRSImageLabel(info_telemetry)
    abs_image_label = ABSImageLabel(info_telemetry)
    tc_image_label = TCImageLabel(info_telemetry)

    background_label = BackgroundLabel()

    for label in (compound_label, optimum_temps_label, abs_label, tc_label,
                  lateral_force_label, transverse_force_label, drs_image_label,
                  abs_image_label, tc_image_label, background_label):
        label.window = window_info

    # Prepei na mpei teleytaio gia na fortwnei meta to prasino eikonidio gia na
    # kratietai to diafano...
    car_name = ac.getCarName(0)
    car_upgrade = ''
    if car_name.endswith(('_s1', '_s2', '_s3', '_drift', '_dtm')):
        car_upgrade = car_name.split('_')[-1]
    car_upgrade_img_path = os.path.join(
        APP_DIR, "Images/Info{}.png".format(car_upgrade or 'STD'))
    background_label.bg_texture = car_upgrade_img_path

    image_arrow_left = LeftLateralForceImage(
        info_telemetry, pos_x=131, pos_y=147, width=20, height=20,
        color=(1, 1, 0, 1), filename='arrowLeft.png')
    image_arrow_right = RightLateralForceImage(
        info_telemetry, pos_x=132, pos_y=147, width=20, height=20,
        color=(1, 1, 0, 1), filename='arrowRight.png')
    image_arrow_up = PositiveTransverseForceImage(
        info_telemetry, pos_x=104, pos_y=119, width=20, height=20,
        color=(1, 1, 0, 1), filename='arrowUp.png')
    image_arrow_down = NegativeTransverseForceImage(
        info_telemetry, pos_x=104, pos_y=120, width=20, height=20,
        color=(1, 1, 0, 1), filename='arrowDown.png')
Ejemplo n.º 42
0
def acMain(ac_version):
  global appWindow,sharedMem

  appWindow = ac.newApp("CrewChiefEx")

  ac.setTitle(appWindow, "CrewChiefEx")
  ac.setSize(appWindow, 300, 40)

  ac.log("CrewChief Was Here! damage report ?")
  ac.console("CrewChief Was Here! damage report ?")

  sharedmem = sharedMem.getsharedmem()
  sharedmem.serverName = ac.getServerName().encode('utf-8')

  return "CrewChiefEx"
Ejemplo n.º 43
0
    def __init__(self, name, headerName):    
        self.headerName = headerName
        self.window = ac.newApp(name)

        self.lapNumberLabel = []
        self.timeLabel = []
        self.deltaLabel = []
        self.lastLapDataRefreshed = -1
        self.lastLapViewRefreshed = 0
        self.total = 0
        self.bestLapAc = 0
        self.bestLapTimeSession = 0
        self.bestLapTime = 0
        self.referenceTime = 0
        self.laps = []
        self.bestLapData = []
        self.currentLapData = [(0.0,0.0)]
        self.sfCrossed = 0
        self.session = info.graphics.session
        self.lastSession = 0
        self.lapInvalidated = 0
        self.justCrossedSf = False
        self.position = 0
        self.lastPosition = 0
        self.currentTime = 0
        self.lastCurrentTime = 0
        self.pitExitState = 0
        self.pitExitDeltaOffset = 0
        self.pitExitLap = 0

        self.readBestLap()

        self.currLabelId = lapLabelCount
        self.refLabelId = lapLabelCount+1
        self.totalLabelId = lapLabelCount+2

        for index in range(lapLabelCount+3):
            self.lapNumberLabel.append(ac.addLabel(self.window, "%d." % (index+1)))
            ac.setFontAlignment(self.lapNumberLabel[index], 'left')

            self.timeLabel.append(ac.addLabel(self.window, timeToString(0)))
            ac.setFontAlignment(self.timeLabel[index], 'right')

            self.deltaLabel.append(ac.addLabel(self.window, "-.---"))
            ac.setFontAlignment(self.deltaLabel[index], 'right')

        ac.setText(self.lapNumberLabel[self.currLabelId],  "Curr.")
        ac.setText(self.lapNumberLabel[self.totalLabelId], "Tot.")
Ejemplo n.º 44
0
def acMain(ac_version):
    global l_lapcount, b_benzina


    appWindow = ac.newApp("benza")
    ac.setSize(appWindow, 200, 200)

    ac.log("Benza Start")
    ac.console("Benza is running")

    l_lapcount = ac.addLabel(appWindow, "Laps: 0");
    b_benzina  = ac.addLabel(appWindow, "Fuel: 0");

    ac.setPosition(l_lapcount, 3, 30)

    return "benza"
Ejemplo n.º 45
0
def acMain(ac_version):

	appWindow = ac.newApp("Pedal Circles")
	ac.setSize(appWindow, 412, 250)
	ac.setTitle(appWindow, "")
	# ac.setBackgroundOpacity(appWindow, 0) ~ doesn't change anything
	ac.setIconPosition(appWindow, 0, -10000)
	ac.console("Hello Assetto, this is Pedal Circles")

	brake_display = ac.addLabel(appWindow, "")
	ac.setPosition(brake_display, 3, 25)
	ac.setSize(brake_display, 200, 200)

	gas_display = ac.addLabel(appWindow, "")
	ac.setPosition(gas_display, 207, 25)
	ac.setSize(gas_display, 200, 200) 

	return "brake"
Ejemplo n.º 46
0
def acMain(ac_version):
    try:
        global appHeight, appWidth, appWindow, flLabel, frLabel, rlLabel, rrLabel, upperDistance, distanceFromLeft, tyreWidth, tyreHeight
        distanceFromLeft = tyreWidth * 3
        upperDistance = distanceFromLeft
        appWindow = ac.newApp("Traction Loss")
        appWidth = distanceFromLeft * 2 + tyreWidth * 3
        appHeight = upperDistance * 2 + tyreHeight * 3
        ac.setSize(appWindow, appWidth, appHeight)
        define_tachometer()
        if debug:
            create_debug_labels()

        #ac.drawBorder(appWindow, 0)
        ac.addRenderCallback(appWindow, on_update)

        return "Traction Loss"
    except Exception as e:
        ac.console("TractionLoss: Error in function acMain(): %s" % e)
        ac.log("TractionLoss: Error in function acMain(): %s" % e)
def acMain(ac_version):
	# use global variables
	global appWindow, FL, FR, RL, RR, space
	
	# create the app
	appWindow = ac.newApp("Tyre Temps")
	
	# setup the app window
	ac.setSize(appWindow,160,209)
	ac.drawBorder(appWindow,0)
	ac.setBackgroundOpacity(appWindow,0)
	# make the background a set of tyre outlines
	ac.setBackgroundTexture(appWindow,"apps/python/tyreTemps/tyretempsBackground.png")
	
	# create an object for each tyre
	FL = TyreTempText(appWindow, "FL", 25, 85)
	FR = TyreTempText(appWindow, "FR", 95, 85)
	RL = TyreTempText(appWindow, "RL", 25, 105)
	RR = TyreTempText(appWindow, "RR", 95, 105)
	
	return "Tyre Temps"
Ejemplo n.º 48
0
def acMain(ac_version):
    global tracking

    app = ac.newApp("MhwkRacingAssettoApp")
    ac.setTitle(app, 'MHWK racing')
    ac.setSize(app, 300, 200)
    ac.addOnAppActivatedListener(app, on_app_activated)
    ac.addOnAppDismissedListener(app, on_app_dismissed)

    tracking = track.TrackerManager()
    tracking.track('OnNewSession', track.OnNewSession())
    tracking.track('OnNewLap', track.OnNewLap())
    tracking.track('OnNewSector', track.OnNewSector())

    gateway = LoggingGateway(HttpGateway('racing.mhwk.nl'))

    tracking.listen('OnNewSession', dispatch.StartLapDispatcher(gateway))
    tracking.listen('OnNewLap', dispatch.CompleteLapDispatcher(gateway))
    tracking.listen('OnNewSector', dispatch.CompleteSectorDispatcher(gateway))

    return "MhwkRacingAssettoApp"
Ejemplo n.º 49
0
def acMain(ac_version):
    global appWindow, trackname, tracklength, l_lapcount, l_distance, l_fuel, conn, c

    appWindow = ac.newApp("acOdometer")
    ac.setSize(appWindow, 142, 142)

    l_lapcount = ac.addLabel(appWindow, "Laps: Outlap")
    ac.setPosition(l_lapcount, 3, 30)
    l_distance = ac.addLabel(appWindow, "Kilometers: Outlap")
    ac.setPosition(l_distance, 3, 45)
    l_fuel = ac.addLabel(appWindow, "Fuel used: 0")
    ac.setPosition(l_fuel, 3, 60)

    trackname = ac.getTrackName(0)
    carname = ac.getCarName(0)
    t = int(time.time())
    c.execute("INSERT INTO session('date', 'track', 'car') values (?, ?, ?)", (t, trackname, carname)) # Commited atomically at end of session
    ac.log("*************************** NEW SESSION\n********* " + trackname)
    ac.log("acOdometer loaded, racing {} which has {:.3f} miles per lap".format(trackname, tracklength[trackname]))
    ac.console("acOdometer loaded, racing {} which has {:.3f} kilometers per lap.".format(trackname, tracklength[trackname]))
    return "acOdometer"
def acMain(ac_version):
    global rpm_display, boost_display, gear_display, speed_display, fuel_display
    global min_rpm_spinner_Label, min_rpm_spinner, max_rpm_spinner_Label, max_rpm_spinner, settings_box_Label
    global units_spinner_Label, units_spinner
    global rpm_tag, speed_tag, boost_tag, fuel_tag

    appWindow=ac.newApp("RevHunterSkunkworks")
    ac.setTitle(appWindow, " ")
    ac.setSize(appWindow,windowx,windowy)
    ac.drawBorder(appWindow,0)
    ac.setBackgroundOpacity(appWindow,0)
    ac.addRenderCallback(appWindow, onFormRender)

    rpm_display  = Label(appWindow, "").setSize(0,0).setPosition((2.05*windowx/3),(1.05*windowy/3)).setFontSize(50).setFontAlign("right")
    gear_display = Label(appWindow).setSize(0,0).setPosition((windowx / 2),-50).setFontSize(140).setFontAlign("center")
    speed_display= Label(appWindow, "").setSize(0,0).setPosition((1.25*windowx/3),(1.05*windowy/3)).setFontSize(50).setFontAlign("right")
    fuel_display = Label(appWindow, "").setSize(0,0).setPosition((0.8*windowx/3),(1.25*windowy/3)).setFontSize(35).setFontAlign("right")
    settings_box_Label = Label(appWindow, "").setSize(0,0).setPosition(940,83).setFontSize(15).setFontAlign("left")

    rpm_tag = Label(appWindow, "").setText("RPM").setSize(0,0).setPosition((2.06*windowx/3),(2.1*windowy/3)).setFontSize(15).setFontAlign("left")
    speed_tag=Label(appWindow, "").setText("MPH").setSize(0,0).setPosition((1.26*windowx/3),(2.1*windowy/3)).setFontSize(15).setFontAlign("left")
    fuel_tag = Label(appWindow, "").setText("%FUEL").setSize(0,0).setPosition((0.81*windowx/3),(1.9*windowy/3)).setFontSize(15).setFontAlign("left")

    min_rpm_spinner = ac.addSpinner(appWindow, "Min %RPM")
    spinnerConfig(min_rpm_spinner,0,125,80,20,0,1,100,80,setMinRPM,0)
    max_rpm_spinner = ac.addSpinner(appWindow, "Max %RPM")
    spinnerConfig(max_rpm_spinner,100,125,80,20,90,1,100,97,setMaxRPM,0)

    units_spinner = ac.addSpinner(appWindow, "Units")
    spinnerConfig(units_spinner,200,125,80,20,1,1,2,1,setUnits,0)

    settings_box = ac.addCheckBox(appWindow, "")
    ac.setPosition(settings_box,950,95)
    ac.setSize(settings_box,10,10)

    ac.addOnCheckBoxChanged(settings_box,toggle_settings_visiblity)

    return "RevHunterSkunkworks"
Ejemplo n.º 51
0
 def _create_widget(self):
     self.widget = ac.newApp('ACTracker')
     ac.setSize(self.widget, app_size_x, app_size_y)
     ac.setBackgroundOpacity(self.widget, 0.75)
Ejemplo n.º 52
0
    def __init__(self, name, headerName, fontSize, showHeader):
        self.headerName = headerName
        self.window = ac.newApp(name)
        if showHeader == 1:
            ac.setTitle(self.window, "")
            ac.setIconPosition(self.window, -10000, -10000)
            self.firstSpacing = 0
        else:
            ac.setTitle(self.window, headerName)
            self.firstSpacing = firstSpacing

        self.fontSize = fontSize

        widthLeft       = fontSize*8
        widthCenter     = fontSize*5
        widthRight      = fontSize*5
        self.width      = widthLeft + widthCenter + widthRight + 2*spacing
        height          = self.firstSpacing + (fontSize*1.5 + spacing)*20

        ac.setSize(self.window, self.width, height)

        self.leftLabel = []
        self.centerLabel = []
        self.changeButton = []
        self.plusButton = []
        self.minusButton = []

        for index in range(20):
            self.leftLabel.append(ac.addLabel(self.window, ""))
            ac.setFontSize(self.leftLabel[index], fontSize)
            ac.setPosition(self.leftLabel[index], spacing, self.firstSpacing + index*(fontSize*1.5+spacing))
            ac.setSize(self.leftLabel[index], widthLeft, fontSize+spacing)
            ac.setFontAlignment(self.leftLabel[index], 'left')

            self.centerLabel.append(ac.addLabel(self.window, ""))
            ac.setFontSize(self.centerLabel[index], fontSize)
            ac.setPosition(self.centerLabel[index], spacing + widthLeft, self.firstSpacing + index*(fontSize*1.5+spacing))
            ac.setSize(self.centerLabel[index], widthCenter, fontSize+spacing)
            ac.setFontAlignment(self.centerLabel[index], 'left')

            self.changeButton.append(ac.addButton(self.window, "Change"))
            ac.setFontSize(self.changeButton[index], self.fontSize)
            ac.setPosition(self.changeButton[index], spacing + widthLeft + widthCenter, self.firstSpacing + index*(fontSize*1.5+spacing))
            ac.setSize(self.changeButton[index], fontSize*4, fontSize*1.5)

            self.plusButton.append(ac.addButton(self.window, "+"))
            ac.setFontSize(self.plusButton[index], self.fontSize)
            ac.setPosition(self.plusButton[index], spacing + widthLeft + widthCenter, self.firstSpacing + index*(fontSize*1.5+spacing))
            ac.setSize(self.plusButton[index], fontSize*1.5, fontSize*1.5)

            self.minusButton.append(ac.addButton(self.window, "-"))
            ac.setFontSize(self.minusButton[index], self.fontSize)
            ac.setPosition(self.minusButton[index], spacing + widthLeft + widthCenter + fontSize*2.5, self.firstSpacing + index*(fontSize*1.5+spacing))
            ac.setSize(self.minusButton[index], fontSize*1.5, fontSize*1.5)
            
        rowIndex = 0

        ac.setText(self.leftLabel[rowIndex], "Show header:")
        ac.addOnClickedListener(self.changeButton[rowIndex], toggleHeader)
        ac.setVisible(self.plusButton[rowIndex], 0)
        ac.setVisible(self.minusButton[rowIndex], 0)
        self.showHeaderId = rowIndex

        rowIndex += 1

        ac.setText(self.leftLabel[rowIndex], "Font size:")
        ac.setVisible(self.changeButton[rowIndex], 0)
        ac.addOnClickedListener(self.plusButton[rowIndex], fontSizePlus)
        ac.addOnClickedListener(self.minusButton[rowIndex], fontSizeMinus)
        self.fontSizeId = rowIndex

        rowIndex += 1

        ac.setText(self.leftLabel[rowIndex], "Opacity:")
        ac.setVisible(self.changeButton[rowIndex], 0)
        ac.addOnClickedListener(self.plusButton[rowIndex], opacityPlus)
        ac.addOnClickedListener(self.minusButton[rowIndex], opacityMinus)
        self.opacityId = rowIndex

        rowIndex += 1

        ac.setText(self.leftLabel[rowIndex], "Show border:")
        ac.addOnClickedListener(self.changeButton[rowIndex], toggleBorder)
        ac.setVisible(self.plusButton[rowIndex], 0)
        ac.setVisible(self.minusButton[rowIndex], 0)
        self.showBorderId = rowIndex

        rowIndex += 1

        ac.setVisible(self.changeButton[rowIndex], 0)
        ac.setVisible(self.plusButton[rowIndex], 0)
        ac.setVisible(self.minusButton[rowIndex], 0)

        rowIndex += 1

        ac.setText(self.leftLabel[rowIndex], "Lap count:")
        ac.setVisible(self.changeButton[rowIndex], 0)
        ac.addOnClickedListener(self.plusButton[rowIndex], lapCountPlus)
        ac.addOnClickedListener(self.minusButton[rowIndex], lapCountMinus)
        self.lapCountId = rowIndex

        rowIndex += 1

        ac.setText(self.leftLabel[rowIndex], "Show delta:")
        ac.addOnClickedListener(self.changeButton[rowIndex], toggleDelta)
        ac.setVisible(self.plusButton[rowIndex], 0)
        ac.setVisible(self.minusButton[rowIndex], 0)
        self.showDeltaId = rowIndex

        rowIndex += 1

        ac.setText(self.leftLabel[rowIndex], "Delta color:")
        ac.addOnClickedListener(self.changeButton[rowIndex], toggleColor)
        ac.setVisible(self.plusButton[rowIndex], 0)
        ac.setVisible(self.minusButton[rowIndex], 0)
        self.deltaColorId = rowIndex

        rowIndex += 1

        ac.setText(self.leftLabel[rowIndex], "Red at:")
        ac.setVisible(self.changeButton[rowIndex], 0)
        ac.addOnClickedListener(self.plusButton[rowIndex], redAtPlus)
        ac.addOnClickedListener(self.minusButton[rowIndex], redAtMinus)
        self.redAtId = rowIndex

        rowIndex += 1

        ac.setText(self.leftLabel[rowIndex], "Green at:")
        ac.setVisible(self.changeButton[rowIndex], 0)
        ac.addOnClickedListener(self.plusButton[rowIndex], greenAtPlus)
        ac.addOnClickedListener(self.minusButton[rowIndex], greenAtMinus)
        self.greenAtId = rowIndex

        rowIndex += 1

        ac.setText(self.leftLabel[rowIndex], "Show curr.:")
        ac.addOnClickedListener(self.changeButton[rowIndex], toggleCurrent)
        ac.setVisible(self.plusButton[rowIndex], 0)
        ac.setVisible(self.minusButton[rowIndex], 0)
        self.showCurrentId = rowIndex

        rowIndex += 1

        ac.setText(self.leftLabel[rowIndex], "Reference:")
        ac.addOnClickedListener(self.changeButton[rowIndex], toggleRefSource)
        ac.setVisible(self.plusButton[rowIndex], 0)
        ac.setVisible(self.minusButton[rowIndex], 0)
        self.referenceId = rowIndex

        rowIndex += 1
        
        ac.setText(self.leftLabel[rowIndex], "Show ref.:")
        ac.addOnClickedListener(self.changeButton[rowIndex], toggleRef)
        ac.setVisible(self.plusButton[rowIndex], 0)
        ac.setVisible(self.minusButton[rowIndex], 0)
        self.showReferenceId = rowIndex

        rowIndex += 1

        ac.setText(self.leftLabel[rowIndex], "Show total:")
        ac.addOnClickedListener(self.changeButton[rowIndex], toggleTotal)
        ac.setVisible(self.plusButton[rowIndex], 0)
        ac.setVisible(self.minusButton[rowIndex], 0)
        self.showTotalId = rowIndex

        rowIndex += 1
        
        ac.setVisible(self.changeButton[rowIndex], 0)
        ac.setVisible(self.plusButton[rowIndex], 0)
        ac.setVisible(self.minusButton[rowIndex], 0)

        rowIndex += 1

        ac.setText(self.leftLabel[rowIndex], "Refresh every:")
        ac.setVisible(self.changeButton[rowIndex], 0)
        ac.addOnClickedListener(self.plusButton[rowIndex], refreshPlus)
        ac.addOnClickedListener(self.minusButton[rowIndex], refreshMinus)
        self.refreshId = rowIndex

        rowIndex += 1

        ac.setText(self.leftLabel[rowIndex], "Log sessions:")
        ac.addOnClickedListener(self.changeButton[rowIndex], toggleLogLaps)
        ac.setVisible(self.plusButton[rowIndex], 0)
        ac.setVisible(self.minusButton[rowIndex], 0)
        self.logLapsId = rowIndex

        rowIndex += 1

        ac.setText(self.leftLabel[rowIndex], "Remember best:")
        ac.addOnClickedListener(self.changeButton[rowIndex], toggleLogBest)
        ac.setVisible(self.plusButton[rowIndex], 0)
        ac.setVisible(self.minusButton[rowIndex], 0)
        self.logBestId = rowIndex

        rowIndex += 1

        ac.setText(self.leftLabel[rowIndex], "Best lap:")
        ac.addOnClickedListener(self.changeButton[rowIndex], resetBestLap)
        ac.setText(self.changeButton[rowIndex], "Reset")
        ac.setVisible(self.plusButton[rowIndex], 0)
        ac.setVisible(self.minusButton[rowIndex], 0)
        self.resetBestLapId = rowIndex

        rowIndex += 1

        ac.setText(self.leftLabel[rowIndex], "Lock best:")
        ac.addOnClickedListener(self.changeButton[rowIndex], toggleLockBest)
        ac.setVisible(self.plusButton[rowIndex], 0)
        ac.setVisible(self.minusButton[rowIndex], 0)
        self.lockBestId = rowIndex
def acMain(ac_version):
    appWindow = ac.newApp("pitstop_on_track")
    ac.setSize(appWindow, 300, 300)
    return "pitstop_on_track"
Ejemplo n.º 54
0
 def _create_widget(self):
     self.widget = ac.newApp('Racing Line')
     ac.setSize(self.widget, app_size_x, app_size_y)
     ac.addRenderCallback(self.widget, onFormRender)
Ejemplo n.º 55
0
    # This is not called as often, every 16 ticks
    def updateRaceInfo(self):
        t = threading.Thread(target=self.sendInfo)
        t.start()

    def sendInfo(self):
        now = datetime.datetime.now()
        if not eqByMargin(2, self.latestPos, getCoords()) or (now - self.latestUpdate).seconds > 2:
            self.latestPos = getCoords()
            self.latestUpdate = now
            laps = ac.getCarState(0, acsys.CS.LapCount) + 1
            speed = ac.getCarState(0, acsys.CS.SpeedMS)
            rpm = ac.getCarState(0, acsys.CS.RPM)
            gear = ac.getCarState(0, acsys.CS.Gear)
            on_gas = ac.getCarState(0, acsys.CS.Gas)
            on_brake = ac.getCarState(0, acsys.CS.Brake)
            on_clutch = ac.getCarState(0, acsys.CS.Clutch)
            steer_rot = ac.getCarState(0, acsys.CS.Steer)
            cur_lap_time_ms = ac.getCarState(0, acsys.CS.LapTime)
            performance_meter = ac.getCarState(0, acsys.CS.PerformanceMeter)

            best_lap = ac.getCarState(0, acsys.CS.BestLap)
            last_lap = ac.getCarState(0, acsys.CS.LastLap)

            self.session.setLapNr(laps, last_lap, best_lap)
            self.session.setPosInfo(getCoords(), speed, rpm, gear,
                                    on_gas, on_brake, on_clutch, steer_rot,
                                    cur_lap_time_ms, performance_meter)

ot_app = App(ac.newApp('openTracker'))
Ejemplo n.º 56
0
 def __init__(self, name="defaultAppWindow", width=100, height=100):
     self.app = ac.newApp(name)
     ac.drawBorder(self.app, 0)
     ac.setBackgroundOpacity(self.app, 0)
     self.setSize(width, height)
Ejemplo n.º 57
0
def acMain(ac_version):
    global Status
    global appWindow, FuelSelection, FuelLabel, NoChange, Option1
    global Option2, Option3, Option4, Option5, Body, Engine, Suspension, Fill, FuelOption, NotificationLabel, StatusLabel, Status
    global Preset1, Preset2, Preset3, Preset4
    #
    appWindow = ac.newApp("BoxRadio")
    ac.setSize(appWindow, 180 * UiSize, 220 * UiSize)
    ac.setTitle(appWindow, "BoxRadio")
    ac.setBackgroundOpacity(appWindow, 0.5)
    ac.drawBorder(appWindow, 0)
    #
    FuelSelection = ac.addSpinner(appWindow, "")
    ac.setPosition(FuelSelection, 10 * UiSize, 99 * UiSize)
    ac.setSize(FuelSelection, 80 * UiSize, 18 * UiSize)
    ac.setFontColor(FuelSelection, 1, 1, 1, 1)
    ac.setFontSize(FuelSelection, 12 * UiSize)
    ac.setRange(FuelSelection, 0, int(FuelMax))
    ac.setStep(FuelSelection, 1)
    ac.addOnValueChangeListener(FuelSelection, FuelEvent)
    #
    if FuelOption == True:
        FuelLabel = ac.addLabel(appWindow, "Fuel Add")
        ac.setPosition(FuelLabel, 10 * UiSize, 80 * UiSize)
        ac.setFontColor(FuelLabel, 1, 1, 1, 1)
        ac.setFontSize(FuelLabel, 13 * UiSize)
    else:
        FuelLabel = ac.addLabel(appWindow, "Fuel Total")
        ac.setPosition(FuelLabel, 10 * UiSize, 80 * UiSize)
        ac.setFontColor(FuelLabel, 1, 1, 1, 1)
        ac.setFontSize(FuelLabel, 13 * UiSize)
    #
    Fill = ac.addButton(appWindow, "")
    ac.setBackgroundOpacity(Fill, 0)
    ac.drawBorder(Fill, 0)
    ac.setSize(Fill, 20 * UiSize, 20 * UiSize)
    ac.setPosition(Fill, 95 * UiSize, 98 * UiSize)
    ac.setBackgroundTexture(Fill, "apps/python/BoxRadio/img/fuel_fill_OFF.png")
    ac.addOnClickedListener(Fill, FillEvent)
    #
    NoChange = ac.addButton(appWindow, "")
    ac.setBackgroundOpacity(NoChange, 0)
    ac.drawBorder(NoChange, 0)
    ac.setSize(NoChange, 25 * UiSize, 25 * UiSize)
    ac.setPosition(NoChange, 125 * UiSize, 27 * UiSize)
    ac.setBackgroundTexture(NoChange, "content/gui/pitstop/tyre_no_change_ON.png")
    ac.addOnClickedListener(NoChange, NoChangeEvent)
    #
    Nochangelabel = ac.addLabel(appWindow, "No")
    ac.setPosition(Nochangelabel, 153 * UiSize, 31 * UiSize)
    ac.setFontColor(Nochangelabel, 1, 1, 1, 1)
    ac.setFontSize(Nochangelabel, 12 * UiSize)
    #
    Option1 = ac.addButton(appWindow, "")
    ac.setBackgroundOpacity(Option1, 0)
    ac.drawBorder(Option1, 0)
    ac.setSize(Option1, 25 * UiSize, 25 * UiSize)
    ac.setPosition(Option1, 125 * UiSize, 52 * UiSize)
    ac.setBackgroundTexture(Option1, "content/gui/pitstop/tyre_1_OFF.png")
    ac.addOnClickedListener(Option1, Option1Event)
    if OptionLabel[1] == '':
        ac.setVisible(Option1, 0)
    #
    Option1label = ac.addLabel(appWindow, OptionLabel[1].upper())
    ac.setPosition(Option1label, 153 * UiSize, 56 * UiSize)
    ac.setFontColor(Option1label, 1, 1, 1, 1)
    ac.setFontSize(Option1label, 13 * UiSize)
    #
    Option2 = ac.addButton(appWindow, "")
    ac.setBackgroundOpacity(Option2, 0)
    ac.drawBorder(Option2, 0)
    ac.setSize(Option2, 25 * UiSize, 25 * UiSize)
    ac.setPosition(Option2, 125 * UiSize, 77 * UiSize)
    ac.setBackgroundTexture(Option2, "content/gui/pitstop/tyre_2_OFF.png")
    ac.addOnClickedListener(Option2, Option2Event)
    if OptionLabel[2] == '':
        ac.setVisible(Option2, 0)
    #
    Option2label = ac.addLabel(appWindow, OptionLabel[2].upper())
    ac.setPosition(Option2label, 153 * UiSize, 81 * UiSize)
    ac.setFontColor(Option2label, 1, 1, 1, 1)
    ac.setFontSize(Option2label, 13 * UiSize)
    #
    Option3 = ac.addButton(appWindow, "")
    ac.setBackgroundOpacity(Option3, 0)
    ac.drawBorder(Option3, 0)
    ac.setSize(Option3, 25 * UiSize, 25 * UiSize)
    ac.setPosition(Option3, 125 * UiSize, 102 * UiSize)
    ac.setBackgroundTexture(Option3, "content/gui/pitstop/tyre_3_OFF.png")
    ac.addOnClickedListener(Option3, Option3Event)
    if OptionLabel[3] == '':
        ac.setVisible(Option3, 0)
    #
    Option3label = ac.addLabel(appWindow, OptionLabel[3].upper())
    ac.setPosition(Option3label, 153 * UiSize, 106 * UiSize)
    ac.setFontColor(Option3label, 1, 1, 1, 1)
    ac.setFontSize(Option3label, 13 * UiSize)
    #
    Option4 = ac.addButton(appWindow, "")
    ac.setBackgroundOpacity(Option4, 0)
    ac.drawBorder(Option4, 0)
    ac.setSize(Option4, 25 * UiSize, 25 * UiSize)
    ac.setPosition(Option4, 125 * UiSize, 127 * UiSize)
    ac.setBackgroundTexture(Option4, "content/gui/pitstop/tyre_4_OFF.png")
    ac.addOnClickedListener(Option4, Option4Event)
    if OptionLabel[4] == '':
        ac.setVisible(Option4, 0)
    #
    Option4label = ac.addLabel(appWindow, OptionLabel[4].upper())
    ac.setPosition(Option4label, 153 * UiSize, 131 * UiSize)
    ac.setFontColor(Option4label, 1, 1, 1, 1)
    ac.setFontSize(Option4label, 13 * UiSize)
    #
    Option5 = ac.addButton(appWindow, "")
    ac.setBackgroundOpacity(Option5, 0)
    ac.drawBorder(Option5, 0)
    ac.setSize(Option5, 25 * UiSize, 25 * UiSize)
    ac.setPosition(Option5, 125 * UiSize, 152 * UiSize)
    ac.setBackgroundTexture(Option5, "content/gui/pitstop/tyre_5_OFF.png")
    ac.addOnClickedListener(Option5, Option5Event)
    if OptionLabel[5] == '':
        ac.setVisible(Option5, 0)
    #
    Option5label = ac.addLabel(appWindow, OptionLabel[5].upper())
    ac.setPosition(Option5label, 153 * UiSize, 156 * UiSize)
    ac.setFontColor(Option5label, 1, 1, 1, 1)
    ac.setFontSize(Option5label, 13 * UiSize)
    #
    Suspension = ac.addButton(appWindow, "")
    ac.setBackgroundOpacity(Suspension, 0)
    ac.drawBorder(Suspension, 0)
    ac.setSize(Suspension, 30 * UiSize, 30 * UiSize)
    ac.setPosition(Suspension, 10 * UiSize, 136 * UiSize)
    ac.setBackgroundTexture(Suspension, "content/gui/pitstop/repair_sus_OFF.png")
    ac.addOnClickedListener(Suspension, SuspensionEvent)
    #
    Body = ac.addButton(appWindow, "")
    ac.setBackgroundOpacity(Body, 0)
    ac.drawBorder(Body, 0)
    ac.setSize(Body, 30 * UiSize, 30 * UiSize)
    ac.setPosition(Body, 48 * UiSize, 136 * UiSize)
    ac.setBackgroundTexture(Body, "content/gui/pitstop/repair_body_OFF.png")
    ac.addOnClickedListener(Body, BodyEvent)
    #
    Engine = ac.addButton(appWindow, "")
    ac.setBackgroundOpacity(Engine, 0)
    ac.drawBorder(Engine, 0)
    ac.setSize(Engine, 30 * UiSize, 30 * UiSize)
    ac.setPosition(Engine, 85 * UiSize, 136 * UiSize)
    ac.setBackgroundTexture(Engine, "content/gui/pitstop/repair_engine_OFF.png")
    ac.addOnClickedListener(Engine, EngineEvent)
    #
    Preset1 = ac.addCheckBox(appWindow, "")
    ac.setPosition(Preset1, 10 * UiSize, 50 * UiSize)
    ac.setSize(Preset1, 20 * UiSize, 20 * UiSize)
    ac.drawBorder(Preset1, 1)
    ac.addOnCheckBoxChanged(Preset1, Preset1Event)
    #
    Preset2 = ac.addCheckBox(appWindow, "")
    ac.setPosition(Preset2, 37 * UiSize, 50 * UiSize)
    ac.setSize(Preset2, 20 * UiSize, 20 * UiSize)
    ac.drawBorder(Preset2, 1)
    ac.addOnCheckBoxChanged(Preset2, Preset2Event)
    #
    Preset3 = ac.addCheckBox(appWindow, "")
    ac.setPosition(Preset3, 65 * UiSize, 50 * UiSize)
    ac.setSize(Preset3, 20 * UiSize, 20 * UiSize)
    ac.drawBorder(Preset3, 1)
    ac.addOnCheckBoxChanged(Preset3, Preset3Event)
    #
    Preset4 = ac.addCheckBox(appWindow, "")
    ac.setPosition(Preset4, 93 * UiSize, 50 * UiSize)
    ac.setSize(Preset4, 20 * UiSize, 20 * UiSize)
    ac.drawBorder(Preset4, 1)
    ac.addOnCheckBoxChanged(Preset4, Preset4Event)
    #
    PresetLabel = ac.addLabel(appWindow, "Preset")
    ac.setPosition(PresetLabel, 10 * UiSize, 30 * UiSize)
    ac.setFontColor(PresetLabel, 1, 1, 1, 1)
    ac.setFontSize(PresetLabel, 13 * UiSize)
    #
    Preset1Label = ac.addLabel(appWindow, "1")
    ac.setPosition(Preset1Label, 16 * UiSize, 50 * UiSize)
    ac.setFontColor(Preset1Label, 0, 0, 0, 1)
    ac.setFontSize(Preset1Label, 15 * UiSize)
    #
    Preset2Label = ac.addLabel(appWindow, "2")
    ac.setPosition(Preset2Label, 43 * UiSize, 50 * UiSize)
    ac.setFontColor(Preset2Label, 0, 0, 0, 1)
    ac.setFontSize(Preset2Label, 15 * UiSize)
    #
    Preset3Label = ac.addLabel(appWindow, "3")
    ac.setPosition(Preset3Label, 71 * UiSize, 50 * UiSize)
    ac.setFontColor(Preset3Label, 0, 0, 0, 1)
    ac.setFontSize(Preset3Label, 15 * UiSize)
    #
    Preset4Label = ac.addLabel(appWindow, "4")
    ac.setPosition(Preset4Label, 99 * UiSize, 50 * UiSize)
    ac.setFontColor(Preset4Label, 0, 0, 0, 1)
    ac.setFontSize(Preset4Label, 15 * UiSize)
    #
    StatusLabel = ac.addLabel(appWindow, Status)
    ac.setPosition(StatusLabel, 10 * UiSize, 175 * UiSize)
    ac.setFontColor(StatusLabel, 1, 1, 1, 1)
    ac.setFontSize(StatusLabel, 10 * UiSize)
    #
    NotificationLabel = ac.addLabel(appWindow, Notify)
    ac.setPosition(NotificationLabel, 10 * UiSize, 195 * UiSize)
    ac.setFontColor(NotificationLabel, 1, 1, 1, 1)
    ac.setFontSize(NotificationLabel, 9 * UiSize)
    #
    return "BoxRadio"