Skip to content

Commit

Permalink
Added debug setting
Browse files Browse the repository at this point in the history
  • Loading branch information
schwiti6190 committed Dec 29, 2021
1 parent 84927b3 commit aa887d2
Show file tree
Hide file tree
Showing 19 changed files with 91 additions and 87 deletions.
14 changes: 0 additions & 14 deletions config/CourseGeneratorSettingsSetup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,5 @@
<Text>up_down_rows</Text>
</Texts>
</Setting>
<Setting classType="AIParameterSettingList" name="returnToFirstPoint">
<Values>
<Value name="DEACTIVATED">1</Value>
<Value name="RETURN_TO_START">2</Value>
<Value name="RELEASE_DRIVER">3</Value>
<Value name="RETURN_TO_START_AND_RELEASE_DRIVER">4</Value>
</Values>
<Texts>
<Text prefix="false">CP_activated</Text>
<Text prefix="false">CP_deactivated</Text>
<Text>releaseDriver</Text>
<Text>returnToStartAndReleaseDriver</Text>
</Texts>
</Setting>
</SettingSubTitle>
</Settings>
5 changes: 5 additions & 0 deletions config/VehicleSettingsSetup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,9 @@
<!--Reverse Speed-->
<Setting classType="AIParameterSpeedSetting" name="reverseSpeed" min="2" max="25" default="5" unit="1"/>
</SettingSubTitle>

<SettingSubTitle title="debug">
<!--Debug active -->
<Setting classType="AIParameterBooleanSetting" name="debugActive"/>
</SettingSubTitle>
</Settings>
8 changes: 7 additions & 1 deletion scripts/CpUtil.lua
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,20 @@ end
-- CpUtil.debugVehicle( CpDebug.DBG_TURN, vehicle, "fill level is %.1f, mode = %d", fillLevel, mode )
---@param channel number
function CpUtil.debugVehicle(channel, vehicle, ...)
if CpDebug and CpDebug:isChannelActive(channel) then
local rootVehicle = vehicle and vehicle.rootVehicle
local active = rootVehicle == nil or rootVehicle.getCpSettings == nil or CpUtil.isVehicleDebugActive(rootVehicle)
if CpDebug and active and CpDebug:isChannelActive(channel) then
local updateLoopIndex = g_updateLoopIndex and g_updateLoopIndex or 0
local timestamp = getDate( ":%S")
channel = channel or 0
print(string.format('%s [dbg%d lp%d] %s: %s', timestamp, channel, updateLoopIndex, CpUtil.getName(vehicle), string.format( ... )))
end
end

function CpUtil.isVehicleDebugActive(vehicle)
return vehicle:getCpSettings() and vehicle:getCpSettings().debugActive and vehicle:getCpSettings().debugActive:getValue()
end

function CpUtil.info(...)
local updateLoopIndex = g_updateLoopIndex and g_updateLoopIndex or 0
local timestamp = getDate( ":%S")
Expand Down
9 changes: 5 additions & 4 deletions translations/translation_br.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<text name="CP_vehicle_setting_subTitle_seeder" text="Configuração Semeadeira "/>
<text name="CP_vehicle_setting_subTitle_multitool" text="Configuração Multi implementos"/>
<text name="CP_vehicle_setting_subTitle_speed" text="Velocidades"/>

<text name="CP_vehicle_setting_subTitle_debug" text="Debug settings"/>
<!--Settings-->
<text name="CP_vehicle_setting_showCourse_title" text="Mostrar rotas"/>
<text name="CP_vehicle_setting_showCourse_tooltip" text="Mostrar rota atual do veículo"/>
Expand Down Expand Up @@ -124,6 +124,10 @@
<text name="CP_vehicle_setting_reverseSpeed_title" text="Marcha a ré"/>
<text name="CP_vehicle_setting_reverseSpeed_tooltip" text="Velocidade máxima em marcha ré"/>

<text name="CP_vehicle_setting_debugActive_title" text="Vehicle debug"/>
<text name="CP_vehicle_setting_debugActive_tooltip" text="Enables/disables debug for this vehicle."/>


<!-- Vehicle course generator settings -->
<text name="CP_vehicle_courseGeneratorSetting_title" text="Configuração do gerador de rota de (%s)"/>
<text name="CP_vehicle_courseGeneratorSetting_subTitle_basic" text="Configuração do gerador de rota de (%s)"/>
Expand Down Expand Up @@ -163,9 +167,6 @@
<text name="CP_vehicle_courseGeneratorSetting_startOnHeadland_up_down_rows" text="Cabeceira" />


<text name="CP_vehicle_courseGeneratorSetting_returnToFirstPoint_title" text="Parar no final"/>
<text name="CP_vehicle_courseGeneratorSetting_returnToFirstPoint_tooltip" text="Parar no final"/>

<!-- GlobalSettings -->
<text name="CP_global_setting_title" text="Configurações global"/>
<text name="CP_global_setting_subTitle_general" text="Configurações Basicas"/>
Expand Down
9 changes: 5 additions & 4 deletions translations/translation_cs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<text name="CP_vehicle_setting_subTitle_seeder" text="Seeder settings"/>
<text name="CP_vehicle_setting_subTitle_multitool" text="Multitool settings"/>
<text name="CP_vehicle_setting_subTitle_speed" text="Speeds"/>

<text name="CP_vehicle_setting_subTitle_debug" text="Debug settings"/>
<!--Settings-->
<text name="CP_vehicle_setting_showCourse_title" text="Show course"/>
<text name="CP_vehicle_setting_showCourse_tooltip" text="Show the current course of the vehicle"/>
Expand Down Expand Up @@ -123,6 +123,10 @@
<text name="CP_vehicle_setting_reverseSpeed_title" text="Reverse"/>
<text name="CP_vehicle_setting_reverseSpeed_tooltip" text="Maximum speed while reversing"/>

<text name="CP_vehicle_setting_debugActive_title" text="Vehicle debug"/>
<text name="CP_vehicle_setting_debugActive_tooltip" text="Enables/disables debug for this vehicle."/>


<!-- Vehicle course generator settings -->
<text name="CP_vehicle_courseGeneratorSetting_title" text="Course generator settings of (%s)"/>
<text name="CP_vehicle_courseGeneratorSetting_subTitle_basic" text="Course generator settings of (%s)"/>
Expand Down Expand Up @@ -162,9 +166,6 @@
<text name="CP_vehicle_courseGeneratorSetting_startOnHeadland_up_down_rows" text="Headland" />


<text name="CP_vehicle_courseGeneratorSetting_returnToFirstPoint_title" text="Stopping at the end"/>
<text name="CP_vehicle_courseGeneratorSetting_returnToFirstPoint_tooltip" text="Stopping at the end"/>

<!-- GlobalSettings -->
<text name="CP_global_setting_title" text="Global settings"/>
<text name="CP_global_setting_subTitle_general" text="Basic settings"/>
Expand Down
10 changes: 5 additions & 5 deletions translations/translation_cz.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<text name="CP_vehicle_setting_subTitle_seeder" text="Nastavení secího stroje"/>
<text name="CP_vehicle_setting_subTitle_multitool" text="Nastavení pro více strojů"/>
<text name="CP_vehicle_setting_subTitle_speed" text="Rychlosti"/>

<text name="CP_vehicle_setting_subTitle_debug" text="Debug settings"/>
<!--Settings-->
<text name="CP_vehicle_setting_showCourse_title" text="Ukázat trasu"/>
<text name="CP_vehicle_setting_showCourse_tooltip" text="Ukázat aktuální trasu vozidla"/>
Expand Down Expand Up @@ -123,6 +123,10 @@
<text name="CP_vehicle_setting_reverseSpeed_title" text="Couvání"/>
<text name="CP_vehicle_setting_reverseSpeed_tooltip" text="Maximální rychlost při couvání"/>

<text name="CP_vehicle_setting_debugActive_title" text="Vehicle debug"/>
<text name="CP_vehicle_setting_debugActive_tooltip" text="Enables/disables debug for this vehicle."/>


<!-- Vehicle course generator settings -->
<text name="CP_vehicle_courseGeneratorSetting_title" text="Nastavení generátoru kurzů (%s)"/>
<text name="CP_vehicle_courseGeneratorSetting_subTitle_basic" text="Nastavení generátoru kurzů (%s)"/>
Expand Down Expand Up @@ -161,10 +165,6 @@
<text name="CP_vehicle_courseGeneratorSetting_startOnHeadland_on_headland" text="Souvrati" />
<text name="CP_vehicle_courseGeneratorSetting_startOnHeadland_up_down_rows" text="Řádku" />


<text name="CP_vehicle_courseGeneratorSetting_returnToFirstPoint_title" text="Zastavení na konci"/>
<text name="CP_vehicle_courseGeneratorSetting_returnToFirstPoint_tooltip" text="Zastavení na konci"/>

<!-- GlobalSettings -->
<text name="CP_global_setting_title" text="Globální nastavení"/>
<text name="CP_global_setting_subTitle_general" text="Základní nastavení"/>
Expand Down
10 changes: 5 additions & 5 deletions translations/translation_de.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<text name="CP_vehicle_setting_subTitle_seeder" text="Einstellungen für Saatmaschine"/>
<text name="CP_vehicle_setting_subTitle_multitool" text="Multitooleinstellungen"/>
<text name="CP_vehicle_setting_subTitle_speed" text="Geschwindigkeiten"/>

<text name="CP_vehicle_setting_subTitle_debug" text="Debug settings"/>
<!--Settings-->
<text name="CP_vehicle_setting_showCourse_title" text="Zeige Kurs"/>
<text name="CP_vehicle_setting_showCourse_tooltip" text="Zeigt den Kurs des aktuell gewählten Fahrzeugs."/>
Expand Down Expand Up @@ -123,6 +123,10 @@
<text name="CP_vehicle_setting_reverseSpeed_title" text="Rückwärts"/>
<text name="CP_vehicle_setting_reverseSpeed_tooltip" text="Maximale Geschwindigkeit beim rückwärts fahren."/>

<text name="CP_vehicle_setting_debugActive_title" text="Vehicle debug"/>
<text name="CP_vehicle_setting_debugActive_tooltip" text="Enables/disables debug for this vehicle."/>


<!-- Vehicle course generator settings -->
<text name="CP_vehicle_courseGeneratorSetting_title" text="Kursgenerator Einstellungen von (%s)"/>
<text name="CP_vehicle_courseGeneratorSetting_subTitle_basic" text="Kursgenerator Einstellungen von (%s)"/>
Expand Down Expand Up @@ -161,10 +165,6 @@
<text name="CP_vehicle_courseGeneratorSetting_startOnHeadland_on_headland" text="Vorgewende" />
<text name="CP_vehicle_courseGeneratorSetting_startOnHeadland_up_down_rows" text="Bahnen" />


<text name="CP_vehicle_courseGeneratorSetting_returnToFirstPoint_title" text="Stop am Endpunkt"/>
<text name="CP_vehicle_courseGeneratorSetting_returnToFirstPoint_tooltip" text="Stop am Endpunkt"/>

<!-- GlobalSettings -->
<text name="CP_global_setting_title" text="Globale Einstellungen"/>
<text name="CP_global_setting_subTitle_general" text="Grundeinstellungen"/>
Expand Down
10 changes: 5 additions & 5 deletions translations/translation_en.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<text name="CP_vehicle_setting_subTitle_seeder" text="Seeder settings"/>
<text name="CP_vehicle_setting_subTitle_multitool" text="Multitool settings"/>
<text name="CP_vehicle_setting_subTitle_speed" text="Speeds"/>

<text name="CP_vehicle_setting_subTitle_debug" text="Debug settings"/>
<!--Settings-->
<text name="CP_vehicle_setting_showCourse_title" text="Show course"/>
<text name="CP_vehicle_setting_showCourse_tooltip" text="Show the current course of the vehicle"/>
Expand Down Expand Up @@ -123,6 +123,10 @@
<text name="CP_vehicle_setting_reverseSpeed_title" text="Reverse"/>
<text name="CP_vehicle_setting_reverseSpeed_tooltip" text="Maximum speed while reversing"/>

<text name="CP_vehicle_setting_debugActive_title" text="Vehicle debug"/>
<text name="CP_vehicle_setting_debugActive_tooltip" text="Enables/disables debug for this vehicle."/>


<!-- Vehicle course generator settings -->
<text name="CP_vehicle_courseGeneratorSetting_title" text="Course generator settings of (%s)"/>
<text name="CP_vehicle_courseGeneratorSetting_subTitle_basic" text="Course generator settings of (%s)"/>
Expand Down Expand Up @@ -161,10 +165,6 @@
<text name="CP_vehicle_courseGeneratorSetting_startOnHeadland_on_headland" text="headland" />
<text name="CP_vehicle_courseGeneratorSetting_startOnHeadland_up_down_rows" text="center" />


<text name="CP_vehicle_courseGeneratorSetting_returnToFirstPoint_title" text="Stopping at the end"/>
<text name="CP_vehicle_courseGeneratorSetting_returnToFirstPoint_tooltip" text="Stopping at the end"/>

<!-- GlobalSettings -->
<text name="CP_global_setting_title" text="Global settings"/>
<text name="CP_global_setting_subTitle_general" text="Basic settings"/>
Expand Down
10 changes: 5 additions & 5 deletions translations/translation_es.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<text name="CP_vehicle_setting_subTitle_seeder" text="Configuración sembradora"/>
<text name="CP_vehicle_setting_subTitle_multitool" text="Configuración multi-aperos"/>
<text name="CP_vehicle_setting_subTitle_speed" text="Velocidades"/>

<text name="CP_vehicle_setting_subTitle_debug" text="Debug settings"/>
<!--Settings-->
<text name="CP_vehicle_setting_showCourse_title" text="Mostrar ruta"/>
<text name="CP_vehicle_setting_showCourse_tooltip" text="Muestra la ruta actual del vehículo"/>
Expand Down Expand Up @@ -123,6 +123,10 @@
<text name="CP_vehicle_setting_reverseSpeed_title" text="Marcha atrás"/>
<text name="CP_vehicle_setting_reverseSpeed_tooltip" text="Velocidad en marcha a trás"/>

<text name="CP_vehicle_setting_debugActive_title" text="Vehicle debug"/>
<text name="CP_vehicle_setting_debugActive_tooltip" text="Enables/disables debug for this vehicle."/>


<!-- Vehicle course generator settings -->
<text name="CP_vehicle_courseGeneratorSetting_title" text="Configuración del generador de rutas de (%s)"/>
<text name="CP_vehicle_courseGeneratorSetting_subTitle_basic" text="Configuración del generador de rutas de (%s)"/>
Expand Down Expand Up @@ -161,10 +165,6 @@
<text name="CP_vehicle_courseGeneratorSetting_startOnHeadland_on_headland" text="Cabecera" />
<text name="CP_vehicle_courseGeneratorSetting_startOnHeadland_up_down_rows" text="Cabecera" />


<text name="CP_vehicle_courseGeneratorSetting_returnToFirstPoint_title" text="Vuelta a punto inicial"/>
<text name="CP_vehicle_courseGeneratorSetting_returnToFirstPoint_tooltip" text="Vuelta a punto inicial"/>

<!-- GlobalSettings -->
<text name="CP_global_setting_title" text="Ajustes Globales"/>
<text name="CP_global_setting_subTitle_general" text="Ajustes Globales"/>
Expand Down
9 changes: 5 additions & 4 deletions translations/translation_fr.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<text name="CP_vehicle_setting_subTitle_seeder" text="Paramètres semoir"/>
<text name="CP_vehicle_setting_subTitle_multitool" text="Paramètres outils multiples"/>
<text name="CP_vehicle_setting_subTitle_speed" text="Vitesses"/>

<text name="CP_vehicle_setting_subTitle_debug" text="Debug settings"/>
<!--Settings-->
<text name="CP_vehicle_setting_showCourse_title" text="Afficher la course"/>
<text name="CP_vehicle_setting_showCourse_tooltip" text="Affiche la course actuelle du véhicule."/>
Expand Down Expand Up @@ -123,6 +123,10 @@
<text name="CP_vehicle_setting_reverseSpeed_title" text="Arrière"/>
<text name="CP_vehicle_setting_reverseSpeed_tooltip" text="Vitesse max lors des marches arrières."/>

<text name="CP_vehicle_setting_debugActive_title" text="Vehicle debug"/>
<text name="CP_vehicle_setting_debugActive_tooltip" text="Enables/disables debug for this vehicle."/>


<!-- Vehicle course generator settings -->
<text name="CP_vehicle_courseGeneratorSetting_title" text="Paramètres du générateur pour la course (%s)"/>
<text name="CP_vehicle_courseGeneratorSetting_subTitle_basic" text="Paramètres du générateur pour la course (%s)"/>
Expand Down Expand Up @@ -164,9 +168,6 @@
<text name="CP_vehicle_courseGeneratorSetting_startOnHeadland_up_down_rows" text="Rangées" />


<text name="CP_vehicle_courseGeneratorSetting_returnToFirstPoint_title" text="Retour au premier point"/>
<text name="CP_vehicle_courseGeneratorSetting_returnToFirstPoint_tooltip" text="Retourne au premier point à la fin de la course."/>

<!-- GlobalSettings -->
<text name="CP_global_setting_title" text="Paramètres globaux"/>
<text name="CP_global_setting_subTitle_general" text="Paramètres généraux"/>
Expand Down
8 changes: 4 additions & 4 deletions translations/translation_hu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<text name="CP_vehicle_setting_subTitle_seeder" text="Seeder settings"/>
<text name="CP_vehicle_setting_subTitle_multitool" text="Multitool settings"/>
<text name="CP_vehicle_setting_subTitle_speed" text="Speeds"/>

<text name="CP_vehicle_setting_subTitle_debug" text="Debug settings"/>
<!--Settings-->
<text name="CP_vehicle_setting_showCourse_title" text="Show course"/>
<text name="CP_vehicle_setting_showCourse_tooltip" text="Show the current course of the vehicle"/>
Expand Down Expand Up @@ -123,6 +123,9 @@
<text name="CP_vehicle_setting_reverseSpeed_title" text="Reverse"/>
<text name="CP_vehicle_setting_reverseSpeed_tooltip" text="Maximum speed while reversing"/>

<text name="CP_vehicle_setting_debugActive_title" text="Vehicle debug"/>
<text name="CP_vehicle_setting_debugActive_tooltip" text="Enables/disables debug for this vehicle."/>

<!-- Vehicle course generator settings -->
<text name="CP_vehicle_courseGeneratorSetting_title" text="Course generator settings of (%s)"/>
<text name="CP_vehicle_courseGeneratorSetting_subTitle_basic" text="Course generator settings of (%s)"/>
Expand Down Expand Up @@ -162,9 +165,6 @@
<text name="CP_vehicle_courseGeneratorSetting_startOnHeadland_up_down_rows" text="Headland" />


<text name="CP_vehicle_courseGeneratorSetting_returnToFirstPoint_title" text="Stopping at the end"/>
<text name="CP_vehicle_courseGeneratorSetting_returnToFirstPoint_tooltip" text="Stopping at the end"/>

<!-- GlobalSettings -->
<text name="CP_global_setting_title" text="Global settings"/>
<text name="CP_global_setting_subTitle_general" text="Basic settings"/>
Expand Down
9 changes: 5 additions & 4 deletions translations/translation_it.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<text name="CP_vehicle_setting_subTitle_seeder" text="Impostazioni seminatrici"/>
<text name="CP_vehicle_setting_subTitle_multitool" text="Impostazioni Multiaccessori"/>
<text name="CP_vehicle_setting_subTitle_speed" text="velocità"/>

<text name="CP_vehicle_setting_subTitle_debug" text="Debug settings"/>
<!--Settings-->
<text name="CP_vehicle_setting_showCourse_title" text="Visualizza porcorso"/>
<text name="CP_vehicle_setting_showCourse_tooltip" text="Mostra il percorso attuale del veicolo"/>
Expand Down Expand Up @@ -123,6 +123,10 @@
<text name="CP_vehicle_setting_reverseSpeed_title" text="Retromarcia"/>
<text name="CP_vehicle_setting_reverseSpeed_tooltip" text="Velocità massima in retromarcia"/>

<text name="CP_vehicle_setting_debugActive_title" text="Vehicle debug"/>
<text name="CP_vehicle_setting_debugActive_tooltip" text="Enables/disables debug for this vehicle."/>


<!-- Vehicle course generator settings -->
<text name="CP_vehicle_courseGeneratorSetting_title" text="Impostazioni del gestore del percorso di (%s)"/>
<text name="CP_vehicle_courseGeneratorSetting_subTitle_basic" text="Impostazioni del gestore del percorso di (%s)"/>
Expand Down Expand Up @@ -162,9 +166,6 @@
<text name="CP_vehicle_courseGeneratorSetting_startOnHeadland_up_down_rows" text="Centro" />


<text name="CP_vehicle_courseGeneratorSetting_returnToFirstPoint_title" text="Ferma alla fine"/>
<text name="CP_vehicle_courseGeneratorSetting_returnToFirstPoint_tooltip" text="Ferma alla fine"/>

<!-- GlobalSettings -->
<text name="CP_global_setting_title" text="Impostazioni generali"/>
<text name="CP_global_setting_subTitle_general" text="Impostazioni di base"/>
Expand Down
Loading

0 comments on commit aa887d2

Please sign in to comment.