#!/bin/bash -e
cd "$(dirname "$0")"
# set -m
# ulimit -Sv 4000000
source "./venv/Scripts/activate" || source "./venv/bin/activate"
export QT_DEBUG_PLUGINS=0
export QML_IMPORT_TRACE=0
export QT_MESSAGE_PATTERN="[%{type}] %{appname} %{pid}.%{threadid}.%{qthreadptr} (%{file}:%{line} in %{function}) - %{backtrace [depth=9999] [separator='|']} - %{message}"
export QMAKE_LFLAGS+=-rdynamic
export QT_FATAL_WARNINGS=0
export QT_NO_DEBUG_OUTPUT=1
export QT_NO_INFO_OUTPUT=1
export QT_NO_WARNING_OUTPUT=0
# export QT_QPA_PLATFORM=${XDG_SESSION_TYPE}
python -B -u "./src/main.py" \
--auto-accept-test-admin-permission \
--auto-login-admin \
--auto-select \
--debugger-workaround \
--no-edgetpu \
--no-gpu \
--panel \
--sim-camera \
--sim-modbus \
--sim-os-label-printer \
--sim-serial \
--style windows \
$* 2> >(sed $'s/.*/\e[31m&\e[m/' >&2) # &
# --about \
# --archive \
# --auto-login-user \
# --autotests-archive \
# --camera-edits \
# --enable-saving-tecna-recipes \
# --fail-vision \
# --full-screen \
# --interact \
# --maximized \
# --no-autotest \
# --no-gui \
# --no-tflite \
# --recipes-management \
# --save-tecna-recipes \
# --sim-archiver \
# --sim-autotest \
# --sim-vision \
# --steps-management \
# --test \
# --test-barcodes \
# --test-connector \
# --test-leak \
# --test-resistance \
# --test-screws \
# --users-management \
# sudo renice -n -10 $!
# fg
