sot / timelines

Commanded states timelines
3 stars 0 forks source link

WIP: port to work on Ska3 #26

Closed taldcroft closed 11 months ago

taldcroft commented 2 years ago

Description

This is a WIP to port basic timelines functionality to work in Ska3. Some points of note:

Testing

So far:

cp $SKA/data/cmd_states/cmd_states.db3 ./
cp -p $SKA/data/timelines/sum_files_sqlite3.touch ./
./parse_cmd_load_gen.pl --server ./cmd_states.db3 --touch_file ./sum_files_sqlite3.touch --verbose
./update_load_seg_db.py --server ./cmd_states.db3 --verbose

The first time I ran this it did a lot more processing than I expected given that the production version basically in a static situation (no loads changed/updated recently).

ska3-kady$ ./update_load_seg_db.py --server ./cmd_states.db3 --verbose
Connecting to sqlite server ./cmd_states.db3
LOAD_SEG DEBUG: Updating from /proj/sot/ska3/flight/data/arc/iFOT_events/load_segment/2021:299:10:31:00.000.rdb
Running: ('SELECT max(id) AS max_id FROM timelines',)
LOAD_SEG INFO: Updating Loads for range 2021:279:02:52:54.460 to 2021:305:01:39:10.961
Running: ('SELECT max(id) AS max_id FROM load_segments',)
Running: ("select * from load_segments\n                               where datestart >= '2021:279:02:52:54.460'\n                               order by datestart, load_scs",)
LOAD_SEG INFO: Mismatch on these entries:
('CL294:0801', 2021, '2021:294:08:44:14.702', '2021:296:10:41:57.000', 128, 0)
(426104749, 'CL294:0801', 2021, '2021:294:08:44:14.702', '2021:297:14:00:51.886', 128, 0)
Running: ("select * from load_segments where datestart >= '2021:305:01:39:10.961'",)
Running: ('SELECT * from timelines where load_segment_id = 426104749',)
TIMELINES DEBUG:  DELETE from cmd_fltpars
                   WHERE timeline_id = 426104880 
Running: (' DELETE from cmd_fltpars\n                   WHERE timeline_id = 426104880 ',)
TIMELINES DEBUG:  DELETE from cmd_intpars
                   WHERE timeline_id = 426104880 
Running: (' DELETE from cmd_intpars\n                   WHERE timeline_id = 426104880 ',)
TIMELINES DEBUG:  DELETE from cmds
                   WHERE timeline_id = 426104880 
Running: (' DELETE from cmds\n                   WHERE timeline_id = 426104880 ',)
TIMELINES DEBUG: DELETE FROM timelines
              WHERE id = 426104880
              AND fixed_by_hand = 0 
Running: ('DELETE FROM timelines\n              WHERE id = 426104880\n              AND fixed_by_hand = 0 ',)
...
A bunch more like that.
taldcroft commented 11 months ago

Timelines will be dropped.