Commit graph

1165 commits

Author SHA1 Message Date
Filippo Gentile
77dcb5d0de IBackgroundChecker: new helper class for checkers
BackgroundResultWidget: result widget implementation
2023-02-18 18:58:26 +01:00
Filippo Gentile
9383f4a922 SingleDepthTreeModelHelper: new tree model helper class 2023-02-18 18:58:26 +01:00
Filippo Gentile
a352eafdbb TaskProgressEvent: new generic progress event 2023-02-18 18:58:26 +01:00
Filippo Gentile
b2a8e04faf translations: fix Italian translation typo 2023-02-18 18:56:11 +01:00
Filippo Gentile
66442b13cb StopModel: fix warnings printing and segment errors
Fix not updating out gate if only segment changed but not the gate
itself. This scenario happens when database is corrupted (maybe because
segment changed track number while jobs where already set on it)
2023-02-18 18:55:34 +01:00
Filippo Gentile
706d9dadb4 Fix unused headers in editstopdialog.cpp and stopdelegate.cpp 2023-02-18 18:48:09 +01:00
Filippo Gentile
de54030785 StopModel: allow skipping travel time recalculation
- Now EditStopDialog and StopDelegate check for SHIFT pressed on save.
- Added tooltips to StopEditor and EditStopDialog Ok button
2023-02-18 18:46:37 +01:00
Filippo Gentile
0c04121867 StationEditDialog: refresh row count on connection import
When importing track connections from SVG, recalculate model row count,
so the view gets update automatically.
2023-01-10 16:51:58 +01:00
Filippo Gentile
017005e1a9 RSProxyModel: fix Italian translation 2023-01-06 15:24:17 +01:00
Filippo Gentile
8667ea96fe StationSVGHelper: raise track connection limit
Big stations easily exceed 100 track connections.
This meant that some of them were not displayed.
1000 seems more reasonable limit.
2023-01-06 14:47:18 +01:00
Filippo Gentile
3672395be5 LineSegmentsModel: fix comment typo 2023-01-06 14:46:11 +01:00
Filippo Gentile
a53c8948fe StationSVGHelper: do not show arrival if stop really is a departure
If stop's in_gate connection is NULL, do not try to match it,
which would lead to incorrect path being highlighted
2023-01-06 14:45:54 +01:00
Filippo Gentile
0273501500 StationSVGPlanDlg: force zoom change on reload 2023-01-06 14:45:47 +01:00
gfgit
b951cedbc9
Merge pull request #57 from gfgit/feature/import_from_svg
Feature: Import SVG station connections
2023-01-06 14:40:18 +01:00
Filippo Gentile
f352555266 StationSVGHelper: raise track connection limit
Big stations easily exceed 100 track connections.
This meant that some of them were not displayed.
500 seems more reasonable limit.
2022-12-10 10:58:24 +01:00
Filippo Gentile
f0ca606bf2 StationEditDialog: add button to import track connections
This tells StationSVGHelper to import track connection from SVG plan
2022-12-06 23:03:15 +01:00
Filippo Gentile
af337e3065 StationSVGHelper: import track connections from SVG
New Feature:
Import station track connections to gates from a station plan SVG.

NOTE: SVG must contain special data regardin tracks
2022-12-06 23:02:21 +01:00
Filippo Gentile
214f08dc3e RsErrorTreeModel: fix sibling() and add some comments 2022-11-01 16:43:31 +01:00
Filippo Gentile
fca21eeae6 RsErrWorker: pass by reference 2022-11-01 16:43:04 +01:00
Filippo Gentile
cb20814a69 StopModel: suggest track when fail to set next segment 2022-11-01 16:10:51 +01:00
Filippo Gentile
43658c227a ViewManager: fix JobsManager not closed on session close
This could cause crashed do to SQL query run after database was closed.
And also would let cached data persist when switching session.
2022-10-27 23:52:53 +02:00
Filippo Gentile
3df21ef200 ViewManager: react to delete all jobs
When deleting all session's jobs we do not emit signals for every single
job, so we need to manually reload things.

Close jobs views of rollingstock, shift and stations because they would
be empty.
2022-10-27 23:48:26 +02:00
Filippo Gentile
5e94d9b603 ShiftGraphScene: react to delete all jobs
When deleting all session's jobs we do not emit shift jobs changed for
every single job, so we need to manually reload things.
2022-10-27 23:46:35 +02:00
Filippo Gentile
a3db250463 StationSVGPlanDlg: new clearJobs_internal() function
clearJobs() needs to update() SSPViewer view in order to show changes.

Since we call it also from reloadJobs(), instead of having 2 calls to
update view, we split in public and internal function.
2022-10-27 23:37:29 +02:00
Filippo Gentile
98cd6f2702 ShiftGraphEditor: remove unused includes 2022-10-27 23:18:38 +02:00
Filippo Gentile
58523ed724 LineGraphManager: react to delete all jobs
When deleting all session's jobs we do not emit station plan changed for
every single stop, so we need to manually reload things.
2022-10-27 22:54:36 +02:00
Filippo Gentile
04a148b9ba JobsHelper: use suggested jobId passed
Add Doxygen comment
2022-10-27 22:31:30 +02:00
gfgit
cfc705a009
Merge pull request #53 from gfgit/delay_linegraph_reload
Delay LineGraphScene reload

When we will have multiple line views, updating should be done in event loop to avoid freezing the UI.
- Do batch updates, cumulate all changes to every scene and then update only once (saves time)
- Fix scene not correctly updated in some cases (e.g. changing Job ID without other modifications didn't trigger update)
- LineGraphScene: light update when only station names change but not the rest.
2022-09-11 17:02:49 +02:00
Filippo Gentile
b2bbf975f8 LineGraphManager: set a maximum update time
When maximum is reached, update is stopped and a second one is scheduled
to finish operation later.
2022-09-11 17:01:21 +02:00
Filippo Gentile
79e609b720 StationSVGHelper: store next segment conn and stop type
- Show Transit instead of Departing for transits
- Don't be fooled by departure time, a job is departing only if next
segment connection is set.
2022-09-11 16:49:50 +02:00
Filippo Gentile
78bf2166f9 StationSVGPlanDlg: round time to minutes 2022-09-11 16:16:50 +02:00
Filippo Gentile
8583684780 StopModel: fix uncoupleStillCoupledAtStop()
Do not select also RS which are correctly uncoupled at last stop, so
they are not needlessly updated.
Select rollingstock item which are coupled at last stop, which need to
be uncoupled (or removed by user)
So REPLACE instead of IGNORE for such cases.
2022-09-11 15:35:01 +02:00
Filippo Gentile
e83d8f601e StopModel: update all stations and rollingstock on job info changes
When a Job changes ID or category, we need to inform all stations and
rollingstock items involved on this Job

- JobPathEditor: move emit to StopModel
2022-09-11 15:27:02 +02:00
Filippo Gentile
8e2f7c545b LineGraphManager: add comment and rework onJobChanged() 2022-09-11 15:18:56 +02:00
Filippo Gentile
4360e4b5b1 MeetingSession: distinguish track plan change from job plan change
Renamed stationJobsPlanChanged()
Added   stationTrackPlanChanged()

When only Jobs change there is no need to fully reload graphs.
LineGraphManager: use common implementation to react to this new signal
2022-09-11 14:32:05 +02:00
Filippo Gentile
140d076651 LineGraphManager: use batch update mode
- Renamed stationPlanChanged() to onStationJobPlanChanged()
- Schedule update instad of updating immediatly so we can do cumulative
updates on a single scene
- Added some comments
2022-09-11 14:22:41 +02:00
Filippo Gentile
7728133a95 LineGraphScene: allow to update station names
Update only station names on horizontal header and also graph name for
single station graphs
2022-09-11 13:56:13 +02:00
Filippo Gentile
1438c4b118 LineGraphScene: add PendingUpdate flags
Reset it when loading of graph is complete
2022-09-11 13:36:38 +02:00
Filippo Gentile
774d4497c5 LineGraphManager: add async updates basic infrastructure
This will be needed for batch updates of multiple scenes
2022-09-11 13:07:00 +02:00
Filippo Gentile
eb7b773fc4 StopModel: move clearing of stations and rollingstock to common place
stationsToUpdate and rsToUpdate are now only cleared on loadJobStops()
and endStopsEditing()
2022-09-10 13:07:05 +02:00
Filippo Gentile
42a468a1b5 StopModel: do not skip stops when setting type in a range.
If we skip a stop, arrival of next stops might get shifted wrongly.
Insetead just do not set Transit type on stops which (un)couple
rollingstock items but still shift them as needed.
2022-09-10 13:02:22 +02:00
Filippo Gentile
1bc031cae6 LineGraphManager: unnecessary double check 2022-09-10 13:00:28 +02:00
Filippo Gentile
0a5d02b862 LineGraphScene: remove old TODO comment now resolved
It was done in commit f165928a57
2022-09-10 12:59:59 +02:00
Filippo Gentile
d161b87859 ViewManager: always disable JobPathEditor when it gets cleared
This prevent inconsistend behaviour of empty JobPathEditor (no job
loaded) but enabled widgets which allow user to edit fields.
2022-09-10 12:44:15 +02:00
Filippo Gentile
fede5a826d JobPathEditor: show error when trying to open invalid jobId
Modify StopModel::loadJobStops() to return false for invalid jobs.
Clear JobPathEditor, disable it and show error to user.
This avoids confusing empty job which does not exist, but for which
JobPathEditor would ask user to save changes or delete because it has no
stops.
But the job does not exist so it cannot be removed nor it's changes
saved which would produce further error messages and really confuse the
user about what is happening.
2022-09-10 12:42:53 +02:00
Filippo Gentile
f6148cf0ba EditRailwayConnectionDlg: fix Gate max track limit 2022-07-18 19:08:52 +02:00
Filippo Gentile
f626d9ff8d EditRailwaySegmentDlg: offer default segment name on save
When user forgets to add segment name, on save try to build a default
one and let user decide if it's good otherwise go back and let user
choose a different name
2022-07-18 18:59:43 +02:00
Filippo Gentile
90f6669614 EditRailwaySegmentDlg: explicitly updateTrackConnectionModel()
Update model explicitly when segment is set, so it gets called only once
at end of dialog setup.
Then call it when user changes data rather than also when program
changes data.
2022-07-18 18:42:15 +02:00
Filippo Gentile
76c774554e RailwaySegmentConnectionsModel: print errors on applyChanges()
Turn in to bool, but for now we just return true
2022-07-18 18:34:24 +02:00
Filippo Gentile
0b34512f2f EditRailwayConnectionDlg: prevent getting stuck on error
When database gets corrupted, or there is some bug in program logic,
user would be unable to add a connection and thus unable to close dialog
because railway segment cannot have zero connections.
This is quite frustrating behaviour, expecially for user with low
understanding of program internals
2022-07-18 18:33:32 +02:00