diff options
author | <philippe colliot> | 2014-06-01 18:47:17 +0200 |
---|---|---|
committer | <philippe colliot> | 2014-06-01 18:47:17 +0200 |
commit | 8083201f87755b9ae0a6ec8c0d1795ff73d5f0e2 (patch) | |
tree | a122d33f5fe4f0a98d26ae82ff5988cce51dd270 /test | |
parent | bc01aa9ae44644ce113f75081597b2949dd8d8e2 (diff) | |
download | navigation-8083201f87755b9ae0a6ec8c0d1795ff73d5f0e2.tar.gz |
Refine the test with a test dashboard and update the scenarios
Diffstat (limited to 'test')
20 files changed, 261 insertions, 435 deletions
diff --git a/test/resource/start-with-guidance-step2.log b/test/resource/high-tank-level.log index d1d8991..3bf08e1 100644 --- a/test/resource/start-with-guidance-step2.log +++ b/test/resource/high-tank-level.log @@ -14,7 +14,9 @@ 0,0$GVSNSVER,2,0,0 0,0$GVVEHVER,0,0,0 200,0$GVGNSP,200,46.201839,6.146647,0,0X03 -200,0$GVSNSVEHSP,200,90.00,0X01 -200,0$GVVEHENGSPEED,200,2000,0X01 -200,0$GVVEHFUELLEVEL,200,30,0X01 -200,0$GVVEHFUELCONS,200,300,0X01 +200,0$GVSNSVEHSP,90,0.00,0X01 +200,0$GVGNSC,200,11.111111,0,27.000000,0X05 +200,0$GVVEHENGSPEED,2000,0X01 +200,0$GVVEHFUELLEVEL,30,0X01 +200,0$GVVEHFUELCONS,300,0X01 +200,0$GVVEHTOTALODO,10000,0x01 diff --git a/test/resource/initialization-step2.log b/test/resource/initialization-step2.log deleted file mode 100644 index 26dbb6b..0000000 --- a/test/resource/initialization-step2.log +++ /dev/null @@ -1,20 +0,0 @@ -#SPDX-License-Identifier: CC-BY-SA-4.0 -#Log file for the FSA simulator -#GNS version 2.0.0 -#SNS version 2.0.0 -#VEH version 0.0.0 (alpha) -#localization geneve cologny -#vehicle speed 0 km/h -#engine speed 800 RPM -#ignition key ON (Not Applicable) -#fuel level 30 l -#fuel consumption 0.36 l/h so 20 µl/200 ms -#step 200 ms -0,0$GVGNSVER,2,0,0 -0,0$GVSNSVER,2,0,0 -0,0$GVVEHVER,0,0,0 -200,0$GVGNSP,200,46.201839,6.146647,0,0X03 -200,0$GVSNSVEHSP,200,0.00,0X01 -200,0$GVVEHENGSPEED,200,800,0X01 -200,0$GVVEHFUELLEVEL,200,30,0X01 -200,0$GVVEHFUELCONS,200,20,0X01 diff --git a/test/resource/enter-a-destination.log b/test/resource/initialization.log index 26dbb6b..45534ec 100644 --- a/test/resource/enter-a-destination.log +++ b/test/resource/initialization.log @@ -15,6 +15,8 @@ 0,0$GVVEHVER,0,0,0 200,0$GVGNSP,200,46.201839,6.146647,0,0X03 200,0$GVSNSVEHSP,200,0.00,0X01 -200,0$GVVEHENGSPEED,200,800,0X01 -200,0$GVVEHFUELLEVEL,200,30,0X01 -200,0$GVVEHFUELCONS,200,20,0X01 +200,0$GVGNSC,200,11.111111,0,27.000000,0X05 +200,0$GVVEHENGSPEED,800,0X01 +200,0$GVVEHFUELLEVEL,30,0X01 +200,0$GVVEHFUELCONS,20,0X01 +200,0$GVVEHTOTALODO,10000,0x01 diff --git a/test/resource/fuel-level-low.log b/test/resource/low-tank-level.log index 3231f28..5498d8d 100644 --- a/test/resource/fuel-level-low.log +++ b/test/resource/low-tank-level.log @@ -14,7 +14,8 @@ 0,0$GVSNSVER,2,0,0 0,0$GVVEHVER,0,0,0 200,0$GVGNSP,200,46.201839,6.146647,0,0X03 -200,0$GVSNSVEHSP,200,90.00,0X01 -200,0$GVVEHENGSPEED,200,2000,0X01 -200,0$GVVEHFUELLEVEL,200,15,0X01 -200,0$GVVEHFUELCONS,200,300,0X01 +200,0$GVSNSVEHSP,200,90,0X01 +200,0$GVGNSC,200,11.111111,0,27.000000,0X05 +200,0$GVVEHENGSPEED,2000,0X01 +200,0$GVVEHFUELLEVEL,15,0X01 +200,0$GVVEHFUELCONS,300,0X01 diff --git a/test/resource/start-with-guidance-step1.log b/test/resource/start-with-guidance-step1.log deleted file mode 100644 index 198a63c..0000000 --- a/test/resource/start-with-guidance-step1.log +++ /dev/null @@ -1,20 +0,0 @@ -#SPDX-License-Identifier: CC-BY-SA-4.0 -#Log file for the FSA simulator -#GNS version 2.0.0 -#SNS version 2.0.0 -#VEH version 0.0.0 (alpha) -#localization geneve cologny -#vehicle speed 40 km/h -#engine speed 1500 RPM -#ignition key ON (Not Applicable) -#fuel level 30 l -#fuel consumption 1.2 l/h so 166 µl/200 ms (3 l/100) -#step 200 ms -0,0$GVGNSVER,2,0,0 -0,0$GVSNSVER,2,0,0 -0,0$GVVEHVER,0,0,0 -200,0$GVGNSP,200,46.201839,6.146647,0,0X03 -200,0$GVSNSVEHSP,200,40.00,0X01 -200,0$GVVEHENGSPEED,200,1500,0X01 -200,0$GVVEHFUELLEVEL,200,30,0X01 -200,0$GVVEHFUELCONS,200,166,0X01 diff --git a/test/resource/start-without-guidance-step1.log b/test/resource/start-without-guidance-step1.log deleted file mode 100644 index 198a63c..0000000 --- a/test/resource/start-without-guidance-step1.log +++ /dev/null @@ -1,20 +0,0 @@ -#SPDX-License-Identifier: CC-BY-SA-4.0 -#Log file for the FSA simulator -#GNS version 2.0.0 -#SNS version 2.0.0 -#VEH version 0.0.0 (alpha) -#localization geneve cologny -#vehicle speed 40 km/h -#engine speed 1500 RPM -#ignition key ON (Not Applicable) -#fuel level 30 l -#fuel consumption 1.2 l/h so 166 µl/200 ms (3 l/100) -#step 200 ms -0,0$GVGNSVER,2,0,0 -0,0$GVSNSVER,2,0,0 -0,0$GVVEHVER,0,0,0 -200,0$GVGNSP,200,46.201839,6.146647,0,0X03 -200,0$GVSNSVEHSP,200,40.00,0X01 -200,0$GVVEHENGSPEED,200,1500,0X01 -200,0$GVVEHFUELLEVEL,200,30,0X01 -200,0$GVVEHFUELCONS,200,166,0X01 diff --git a/test/resource/start-without-guidance-step2.log b/test/resource/start-without-guidance-step2.log deleted file mode 100644 index d1d8991..0000000 --- a/test/resource/start-without-guidance-step2.log +++ /dev/null @@ -1,20 +0,0 @@ -#SPDX-License-Identifier: CC-BY-SA-4.0 -#Log file for the FSA simulator -#GNS version 2.0.0 -#SNS version 2.0.0 -#VEH version 0.0.0 (alpha) -#localization geneve cologny -#vehicle speed 90 km/h -#engine speed 2000 RPM -#ignition key ON (Not Applicable) -#fuel level 30 l -#fuel consumption 5.4 l/h so 300 µl/200 ms (6 l/100) -#step 200 ms -0,0$GVGNSVER,2,0,0 -0,0$GVSNSVER,2,0,0 -0,0$GVVEHVER,0,0,0 -200,0$GVGNSP,200,46.201839,6.146647,0,0X03 -200,0$GVSNSVEHSP,200,90.00,0X01 -200,0$GVVEHENGSPEED,200,2000,0X01 -200,0$GVVEHFUELLEVEL,200,30,0X01 -200,0$GVVEHFUELCONS,200,300,0X01 diff --git a/test/resource/initialization-step1.log b/test/resource/start.log index 1237ad4..675b8b9 100644 --- a/test/resource/initialization-step1.log +++ b/test/resource/start.log @@ -15,6 +15,7 @@ 0,0$GVVEHVER,0,0,0 200,0$GVGNSP,200,46.201839,6.146647,0,0X03 200,0$GVSNSVEHSP,200,0.00,0X01 -200,0$GVVEHENGSPEED,200,0,0X01 -200,0$GVVEHFUELLEVEL,200,30,0X01 -200,0$GVVEHFUELCONS,200,0,0X01 +200,0$GVGNSC,200,11.111111,0,27.000000,0X05 +200,0$GVVEHENGSPEED,0,0X01 +200,0$GVVEHFUELLEVEL,30,0X01 +200,0$GVVEHFUELCONS,0,0X01 diff --git a/test/resource/trip_1000km_10l.log b/test/resource/trip_1000km_10l.log deleted file mode 100644 index ce11726..0000000 --- a/test/resource/trip_1000km_10l.log +++ /dev/null @@ -1,10 +0,0 @@ -#SPDX-License-Identifier: CC-BY-SA-4.0 -#Log file for the FSA simulator -#GNS version 2.0.0 -#SNS version 2.0.0 -#VEH version 0.0.0 (alpha) -#localization geneve cologny -#fuel level 10 l -#odometer 1000km -200,0$GVVEHFUELLEVEL,10,0X01 -200,0$GVVEHTOTALODO,10000,0x01 diff --git a/test/resource/trip_1020km_9l.log b/test/resource/trip_1020km_9l.log deleted file mode 100644 index b24a10f..0000000 --- a/test/resource/trip_1020km_9l.log +++ /dev/null @@ -1,10 +0,0 @@ -#SPDX-License-Identifier: CC-BY-SA-4.0 -#Log file for the FSA simulator -#GNS version 2.0.0 -#SNS version 2.0.0 -#VEH version 0.0.0 (alpha) -#localization geneve cologny -#fuel level 10 l -#odometer 1000km -200,0$GVVEHFUELLEVEL,9,0X01 -200,0$GVVEHTOTALODO,10200,0x01 diff --git a/test/resource/trip_1050km_8l.log b/test/resource/trip_1050km_8l.log deleted file mode 100644 index d01cf23..0000000 --- a/test/resource/trip_1050km_8l.log +++ /dev/null @@ -1,10 +0,0 @@ -#SPDX-License-Identifier: CC-BY-SA-4.0 -#Log file for the FSA simulator -#GNS version 2.0.0 -#SNS version 2.0.0 -#VEH version 0.0.0 (alpha) -#localization geneve cologny -#fuel level 10 l -#odometer 1000km -200,0$GVVEHFUELLEVEL,8,0X01 -200,0$GVVEHTOTALODO,10500,0x01 diff --git a/test/script/FSA-simulation-scenarios.png b/test/script/FSA-simulation-scenarios.png Binary files differdeleted file mode 100644 index 0259c41..0000000 --- a/test/script/FSA-simulation-scenarios.png +++ /dev/null diff --git a/test/script/README b/test/script/README new file mode 100644 index 0000000..3e49173 --- /dev/null +++ b/test/script/README @@ -0,0 +1,29 @@ +Release date of the file: 1-06-2014 +Status: to be completed + +This test bench is based on Python pygame and use python enum class. +If necessary please do: +sudo apt-get install python-pip python-pygame +pip install enum + +To test: + +Launch the application without the log replayer: +./run -R + +Launch the test dashboard (keyboard interface) +python simulation-dashboard.py + +Steps: +'i' launches initialization.log +'s' launches start.log +'h' launches high-tank-level.log +'l' launches low-tank-level.log +'x' exits the dashboard (or close the window) + + +Known issues: + +ambd process sometimes not killed, so check it +./kill_all to kill all the process but still issue with ambd ? + diff --git a/test/script/dashboard.png b/test/script/dashboard.png Binary files differnew file mode 100644 index 0000000..20f9907 --- /dev/null +++ b/test/script/dashboard.png diff --git a/test/script/enter-a-destination.py b/test/script/enter-a-destination.py deleted file mode 100644 index aaa366d..0000000 --- a/test/script/enter-a-destination.py +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/python - -""" -************************************************************************** -* @licence app begin@ -* SPDX-License-Identifier: MPL-2.0 -* -* \copyright Copyright (C) 2014, PCA Peugeot Citroen -* -* \file enter-a-destination.py -* -* \brief This script is part of the FSA scenario. -* -* \author Philippe Colliot <philippe.colliot@mpsa.com> -* -* \version 1.0 -* -* This Source Code Form is subject to the terms of the -* Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with -# this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -* List of changes: -* <date>, <name>, <description of change> -* -* @licence end@ - -************************************************************************** -""" -import configTests -import sys -import gobject - -from threading import Timer -from configTests import * - -PERIODICITY = 200 #in ms -END = 20*1000/PERIODICITY #20 s - -def steps(): - global step - if step < END: - if step == 0: - print 'step 1' - launch("enter-a-destination.log") - step = step + 1 - return True - else: - print '----End scenario: Enter a destination----' - loop.quit() - -print '----Start scenario: Enter a destination----' - -# start -step = 0 -gobject.timeout_add(PERIODICITY,steps) -loop = gobject.MainLoop() -loop.run() - diff --git a/test/script/fuel-level-low.py b/test/script/fuel-level-low.py deleted file mode 100644 index 18420e9..0000000 --- a/test/script/fuel-level-low.py +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/python - -""" -************************************************************************** -* @licence app begin@ -* SPDX-License-Identifier: MPL-2.0 -* -* \copyright Copyright (C) 2014, PCA Peugeot Citroen -* -* \file fuel-level-low.py -* -* \brief This script is part of the FSA scenario. -* -* \author Philippe Colliot <philippe.colliot@mpsa.com> -* -* \version 1.0 -* -* This Source Code Form is subject to the terms of the -* Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with -# this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -* List of changes: -* <date>, <name>, <description of change> -* -* @licence end@ - -************************************************************************** -""" -import configTests -import sys -import gobject - -from threading import Timer -from configTests import * - -PERIODICITY = 200 #in ms -END = 20*1000/PERIODICITY #20 s - -def steps(): - global step - if step < END: - if step == 0: - print 'step 1' - launch("fuel-level-low.log") - step = step + 1 - return True - else: - print '----End scenario: Fuel level low----' - loop.quit() - -print '----Start scenario: Fuel level low----' - -# start -step = 0 -gobject.timeout_add(PERIODICITY,steps) -loop = gobject.MainLoop() -loop.run() - diff --git a/test/script/initialization.py b/test/script/initialization.py deleted file mode 100644 index 9fbdff2..0000000 --- a/test/script/initialization.py +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/python - -""" -************************************************************************** -* @licence app begin@ -* SPDX-License-Identifier: MPL-2.0 -* -* \copyright Copyright (C) 2014, PCA Peugeot Citroen -* -* \file initialization.py -* -* \brief This script is part of the FSA scenario. -* -* \author Philippe Colliot <philippe.colliot@mpsa.com> -* -* \version 1.0 -* -* This Source Code Form is subject to the terms of the -* Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with -# this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -* List of changes: -* <date>, <name>, <description of change> -* -* @licence end@ - -************************************************************************** -""" -import configTests -import sys -import gobject - -from threading import Timer -from configTests import * - -PERIODICITY = 200 #in ms -END_STEP_1 = 1*1000/PERIODICITY #1 s -END_STEP_2 = 20*1000/PERIODICITY #20 s - -def steps(): - global step - if step < END_STEP_1: - if step == 0: - print 'step 1' - launch("initialization-step1.log") - step = step + 1 - return True - elif step < END_STEP_2: - if step == END_STEP_1: - print 'step 2' - launch("initialization-step2.log") - step = step + 1 - return True - else: - print '----End scenario: Initialization----' - loop.quit() - -print '----Start scenario: Initialization----' - -# start -step = 0 -gobject.timeout_add(PERIODICITY,steps) -loop = gobject.MainLoop() -loop.run() - diff --git a/test/script/simulation-dashboard.py b/test/script/simulation-dashboard.py new file mode 100644 index 0000000..b24f3ed --- /dev/null +++ b/test/script/simulation-dashboard.py @@ -0,0 +1,212 @@ +#!/usr/bin/python + +""" +************************************************************************** +* @licence app begin@ +* SPDX-License-Identifier: MPL-2.0 +* +* \copyright Copyright (C) 2014, PCA Peugeot Citroen +* +* \file simulation-dashboard.py +* +* \brief This script is part of the FSA scenario. +* +* \author Philippe Colliot <philippe.colliot@mpsa.com> +* +* \version 1.0 +* +* This Source Code Form is subject to the terms of the +* Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with +# this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +* List of changes: +* <date>, <name>, <description of change> +* +* @licence end@ + +************************************************************************** +""" +import sys,tty,termios,select,pygame,gobject,time,dbus,re + +from pygame.locals import * +from threading import Timer +from configTests import * +from enum import Enum + +class Step(Enum): + START = 0 + INITIALIZATION = 1 + HIGH_TANK_LEVEL = 2 + LOW_TANK_LEVEL = 3 + END = 4 + +class Genivi(Enum): + ENHANCEDPOSITIONSERVICE_LATITUDE = 0x0020 + ENHANCEDPOSITIONSERVICE_LONGITUDE = 0x0021 + ENHANCEDPOSITIONSERVICE_ALTITUDE = 0x0022 + +# Define some colors +BLACK = ( 0, 0, 0) +WHITE = ( 255, 255, 255) +BLUE = ( 0, 0, 255) +GREEN = ( 0, 255, 0) +RED = ( 255, 0, 0) +YELLOW = ( 255, 222, 0) + +# Define some constants +PI = 3.141592653 +PERIODICITY = 200 #in ms +CONVERSION = (3.6/PERIODICITY) + +# Item location on the screen +STATUS_LOCATION = (100,10) +STEP_LOCATION = (150,68) +ENGINE_SPEED_LOCATION = (150,118) +FUEL_LEVEL_LOCATION = (150,175) +FUEL_INSTANT_CONSUMPTION_LOCATION = (150,238) +LATITUDE_LOCATION = (64,287) +LONGITUDE_LOCATION = (185,287) + +def extractAmbValue(string): + try: + value = re.search(r"dbus\.UInt16(.+?)variant",string).group(1) + except AttributeError: + value = '' + return value[1:-2] + +def display(string,location,fontColor,fontBackground): + text = font.render(string, True, fontColor, fontBackground) + textRect = text.get_rect() + textRect.topleft = location + screen.blit(text, textRect) + +def displayStatus(string): + display(string,STATUS_LOCATION,WHITE,BLUE) + +def displayStep(string): + display(string,STEP_LOCATION,YELLOW,BLACK) + +def displayEngineSpeed(string): + display(string,ENGINE_SPEED_LOCATION,YELLOW,BLACK) + +def displayFuelLevel(string): + display(string,FUEL_LEVEL_LOCATION,YELLOW,BLACK) + +def displayFuelInstant(string): + display(string,FUEL_INSTANT_CONSUMPTION_LOCATION,YELLOW,BLACK) + +def displayLatitude(string): + display(string,LATITUDE_LOCATION,YELLOW,BLACK) + +def displayLongitude(string): + display(string,LONGITUDE_LOCATION,YELLOW,BLACK) + +def refresh(): + pygame.display.update() + + +def steps(): + global step + + for event in pygame.event.get(): + if event.type == QUIT: + sys.exit(0) + + # get the keyboard input + pygame.event.pump() + keys = pygame.key.get_pressed() + if keys[K_i]: + step=Step.INITIALIZATION + elif keys[K_h]: + step=Step.HIGH_TANK_LEVEL + elif keys[K_l]: + step=Step.LOW_TANK_LEVEL + elif keys[K_x]: + step=Step.END + + # manage the logreplayer depending on the step + if step==Step.START: + displayStep( str(step) ) + launch("start.log") + elif step==Step.INITIALIZATION: + displayStep( str(step) ) + launch("initialization.log") + elif step==Step.HIGH_TANK_LEVEL: + displayStep( str(step) ) + launch("high-tank-level.log") + elif step==Step.LOW_TANK_LEVEL: + displayStep( str(step) ) + launch("low-tank-level.log") + elif step==Step.END: + displayStatus( 'End simulation ' ) + loop.quit() + else: + displayStatus( 'error' ) + pygame.quit() + loop.quit() + + # get the values on amb + engineSpeed = ambEngineSpeedInterface.GetEngineSpeed() + displayEngineSpeed(str(int(engineSpeed[0]))) + fuelLevel = ambFuelInterface.GetLevel() + displayFuelLevel(str(int(fuelLevel[0]))) + fuelInstCons = ambFuelInterface.GetInstantConsumption() + displayFuelInstant(str(int(fuelInstCons[0])*CONVERSION)) + + # get the geolocation + geoLocation = enhancedPositionInterface.GetData(dbus.Array([Genivi.ENHANCEDPOSITIONSERVICE_LATITUDE,Genivi.ENHANCEDPOSITIONSERVICE_LONGITUDE,Genivi.ENHANCEDPOSITIONSERVICE_ALTITUDE])) + latitude=float(geoLocation[dbus.UInt16(Genivi.ENHANCEDPOSITIONSERVICE_LATITUDE)]) + displayLatitude(str(latitude)) + longitude=float(geoLocation[dbus.UInt16(Genivi.ENHANCEDPOSITIONSERVICE_LONGITUDE)]) + displayLongitude(str(longitude)) + + # refresh screen + refresh() + + return True + +# Initialize the game engine +pygame.init() + +# Initialize the screen +background = pygame.image.load("dashboard.png") +backgroundRect = background.get_rect() +size = (width, height) = background.get_size() +screen = pygame.display.set_mode( size ) +pygame.display.set_caption('Simulation dashboard') +screen.blit(background,backgroundRect) +font = pygame.font.SysFont('Calibri', 25, True, False) + +# Connect on the bus +dbusConnectionBus = dbus.SessionBus() + +# Automotive message broker +ambObject = dbusConnectionBus.get_object("org.automotive.message.broker", "/") +ambInterface = dbus.Interface(ambObject, "org.automotive.Manager") + +# Get the object path to retrieve Engine Speed +engineSpeedPath = ambInterface.FindObject("EngineSpeed"); +ambEngineSpeed = dbusConnectionBus.get_object("org.automotive.message.broker", engineSpeedPath[0]) +ambEngineSpeedInterface = dbus.Interface(ambEngineSpeed, "org.automotive.EngineSpeed") + +# Get the object path to retrieve Fuel Level and Instant consumption +fuelPath = ambInterface.FindObject("Fuel"); +ambFuel = dbusConnectionBus.get_object("org.automotive.message.broker", fuelPath[0]) +ambFuelInterface = dbus.Interface(ambFuel, "org.automotive.Fuel") + +# Enhanced position +enhancedPositionObject = dbusConnectionBus.get_object("org.genivi.positioning.EnhancedPosition", "/position") +enhancedPositionInterface = dbus.Interface(enhancedPositionObject, "org.genivi.positioning.EnhancedPosition") + +displayStatus( 'Start simulation' ) + +refresh() + +# start +step = Step.START +gobject.timeout_add(PERIODICITY,steps) +loop = gobject.MainLoop() +loop.run() + + + diff --git a/test/script/start-with-guidance.py b/test/script/start-with-guidance.py deleted file mode 100644 index cc5e73a..0000000 --- a/test/script/start-with-guidance.py +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/python - -""" -************************************************************************** -* @licence app begin@ -* SPDX-License-Identifier: MPL-2.0 -* -* \copyright Copyright (C) 2014, PCA Peugeot Citroen -* -* \file start-with-guidance.py -* -* \brief This script is part of the FSA scenario. -* -* \author Philippe Colliot <philippe.colliot@mpsa.com> -* -* \version 1.0 -* -* This Source Code Form is subject to the terms of the -* Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with -# this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -* List of changes: -* <date>, <name>, <description of change> -* -* @licence end@ - -************************************************************************** -""" -import configTests -import sys -import gobject - -from threading import Timer -from configTests import * - -PERIODICITY = 200 #in ms -END_STEP_1 = 1*1000/PERIODICITY #1 s -END_STEP_2 = 2*1000/PERIODICITY #2 s - -def steps(): - global step - if step < END_STEP_1: - if step == 0: - print 'step 1' - launch("start-with-guidance-step1.log") - step = step + 1 - return True - elif step < END_STEP_2: - if step == END_STEP_1: - print 'step 2' - launch("start-with-guidance-step2.log") - step = step + 1 - return True - else: - print '----End scenario: Start with guidance----' - loop.quit() - -print '----Start scenario: Start with guidance----' - -# start -step = 0 -gobject.timeout_add(PERIODICITY,steps) -loop = gobject.MainLoop() -loop.run() - diff --git a/test/script/start-without-guidance.py b/test/script/start-without-guidance.py deleted file mode 100644 index 55af1e4..0000000 --- a/test/script/start-without-guidance.py +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/python - -""" -************************************************************************** -* @licence app begin@ -* SPDX-License-Identifier: MPL-2.0 -* -* \copyright Copyright (C) 2014, PCA Peugeot Citroen -* -* \file start-without-guidance.py -* -* \brief This script is part of the FSA scenario. -* -* \author Philippe Colliot <philippe.colliot@mpsa.com> -* -* \version 1.0 -* -* This Source Code Form is subject to the terms of the -* Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with -# this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -* List of changes: -* <date>, <name>, <description of change> -* -* @licence end@ - -************************************************************************** -""" -import configTests -import sys -import gobject - -from threading import Timer -from configTests import * - -PERIODICITY = 200 #in ms -END_STEP_1 = 1*1000/PERIODICITY #1 s -END_STEP_2 = 2*1000/PERIODICITY #2 s - -def steps(): - global step - if step < END_STEP_1: - if step == 0: - print 'step 1' - launch("start-without-guidance-step1.log") - step = step + 1 - return True - elif step < END_STEP_2: - if step == END_STEP_1: - print 'step 2' - launch("start-without-guidance-step2.log") - step = step + 1 - return True - else: - print '----End scenario: Start without guidance----' - loop.quit() - -print '----Start scenario: Start without guidance----' - -# start -step = 0 -gobject.timeout_add(PERIODICITY,steps) -loop = gobject.MainLoop() -loop.run() - |