Files
qt-migration-legatus/qt6-after/qt6-migrated-legatus/Lts/Tests/DatabaseInitialisation/test_scenario_participant_positions.py
T
torsten 15f7add351 Migrate Lts/Tests module to Qt6 with Python 3 port
- Ported all Python scripts from Python 2 to Python 3
- Created db-manage.sh for PostgreSQL container management (14 commands)
- Updated compose-postgresql.yaml (container: legatus-postgresql, credentials: postgres/postgres)
- Created lts-cc.conf template for database configuration
- Added CMakeLists.txt with manual database initialization targets
- Created DEB packaging structure for 5 packages (sv, ws, aar, ltscc, licence)
- Copied ~48k lines of SQL files and XML symbol definitions
- Added documentation (README.md, README.python3.md, MIGRATION_REPORT)

Validation:
- PostgreSQL container starts successfully
- Database initialization tested (guez_pro created)
- Group 2 build: 97% tests passed (654/677)
2026-11-20 17:28:17 +01:00

48 lines
1.4 KiB
Python
Executable File

#!/usr/bin/python
from test_scenario_definitions import *
import time
def generate_participant_positions():
start_time = int(time.time()) * 1000
stmts = []
data_lat = 0.925926;
data_lon = 0.155215;
for i in range(0, 25):
data_lat += 0.000002
start_time += 100
stmt = 'INSERT INTO ex_42.rec_participant_position ( participant_id, participant_type_id, party_id, pos_lon, pos_lat, pos_z, sample_time ) VALUES ( %s, %s, 2, %s, %s, 0, %s )' % (PPM1_participant_id[i], PPM1_type_id[i], data_lon, data_lat, start_time )
stmt += ';'
stmts.append(stmt)
for i in range(0, 25):
data_lon += 0.000005
start_time += 100
stmt = 'INSERT INTO ex_42.rec_participant_position ( participant_id, participant_type_id, party_id, pos_lon, pos_lat, pos_z, sample_time ) VALUES ( %s, %s, 2, %s, %s, 0, %s )' % (PPM1_participant_id[i], PPM1_type_id[i], data_lon, data_lat, start_time )
stmt += ';'
stmts.append(stmt)
data_lat = 0.929926;
data_lon = 0.156215;
for i in range(26, 33):
data_lat += 0.000002
start_time += 100
stmt = 'INSERT INTO ex_42.rec_participant_position ( participant_id, participant_type_id, party_id, pos_lon, pos_lat, pos_z, sample_time ) VALUES ( %s, %s, 2, %s, %s, 0, %s )' % (PPM1_participant_id[i], PPM1_type_id[i], data_lon, data_lat, start_time )
stmt += ';'
stmts.append(stmt)
return stmts
if __name__ == "__main__":
print '\n'.join(generate_participant_positions())