Commit graph

1149 commits

Author SHA1 Message Date
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
Filippo Gentile
9727d68493 SplitRailwaySegmentDlg: make taller and better align buttons 2022-07-18 18:23:24 +02:00
Filippo Gentile
6bb011d96b Doxygen: fix ref not parsed well 2022-07-17 19:54:02 +02:00
Filippo Gentile
b7e1f7284a SplitRailwaySegmentDlg: allow to edit first segment, fix connections
Allow to edit both halves of original segment.
Fix segment onnections not remembered.

Pass 2 RailwaySegmentConnectionModel to RailwaySegmentSplitHelper
2022-07-17 19:53:22 +02:00
Filippo Gentile
dfc856aabe EditRailwaySegmentDlg: allow to save custom connections
Allow to pass a RailwaySegmentConnection model so if manually apply is
true, caller can store segment connections and applying them later
togheter with other changes made by user

Also document constructor and setManuallyApply()
2022-07-17 19:41:17 +02:00
Filippo Gentile
042644c00a RailwaySegmentConnectionsModel: fix default connections
The same logic was repeated 3 times but only first one was correct.
Move the duplicated connection check to insertOrReplace()
2022-07-17 19:13:15 +02:00
Filippo Gentile
0497d6442f Translations: update translations 2022-07-17 11:59:46 +02:00
Filippo Gentile
0c1d9db3bf Merge branch 'feature/german_translation' 2022-07-17 11:46:31 +02:00
Filippo Gentile
cbebaf5204 ViewManager: small optimization for StationSVGPlanDlg 2022-07-17 11:08:05 +02:00
Filippo Gentile
6a3281b4f1 EditRailwaySegmentDlg: reorder functions 2022-07-17 10:24:32 +02:00
Filippo Gentile
5608f0bc28 Merge branch 'feature/layout_split_segment' into master
Merge SplitRailwaySegmentDlg with previous implementation
2022-07-17 10:24:12 +02:00
Filippo Gentile
36bfe821f1 Add initial SplitRailwaySegmentDlg
Created new dialog to split existing railway segments
With help of RailwaySegmentSplitHelper
2022-07-16 18:58:47 +02:00
Filippo Gentile
b1f202c1cd Utils: move GateInfo and SegmentInfo out from RailwaySegmentHelper
Move it to utils:: namespace so it can be forward declared

- EditRailwaySegmentDlg: allow to manually apply changes after closing
dialog:
This is useful for reusing dialog in another dialog such as splitting
segments
2022-07-16 18:43:15 +02:00
Filippo Gentile
38e1248f60 SQLite: fix if clause in models
Affected: RollingstockSQLModel, LinesModel, StationsModel
2022-05-30 22:02:35 +02:00
Filippo Gentile
b8483827ae ViewManager: ask to create Shifts before creating Jobs
JobsHelper: check if there are no shifts
2022-03-08 23:38:38 +01:00
Filippo Gentile
2a3496f0bc Translations: update Italian translation 2022-03-08 15:42:09 +01:00
Filippo Gentile
63335f7613 StationTrackConnectionsModel: better error message 2022-03-08 15:41:55 +01:00