Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial commit Station Graph #7

Merged
merged 53 commits into from
Jul 19, 2021
Merged

Conversation

gfgit
Copy link
Owner

@gfgit gfgit commented Jul 16, 2021

LineGraphScene: class to hold a graph and its logics
StationGraphObject: represent a single station inside the railway line

Issue #4

LineGraphScene: class to hold a graph and its logics
StationGraphObject: represent a single station inside the railway line
@gfgit gfgit added this to the Migration to new station layout milestone Jul 16, 2021
@gfgit gfgit self-assigned this Jul 16, 2021
gfgit added 27 commits July 16, 2021 23:58
LineGraphScene: class to hold a graph and its logics
StationGraphObject: represent a single station inside the railway line
Implement loading full railway line.
LineGraphViewport: draws station platforms and jobs
StationLabelsHeader: draws station labels on top of graph
HourPanel: shows hour labels on the left
LineGraphWidget: manages the graph logic all in one class.
It's more clear and smaller classes are better
Allow setting model after creating the line edit
Now NoGraph is -1 so in a combobox it gets empty name.
Manages the graph selection and in future maybe zooming
Leftovers of conflict caused by messy commits when I started this branch
Starting from -1 allowed to have empty combobox on NoGraph but this way
when setting another value you cannot go back to NoGraph which is needed
to clear the graph query object for now.
Without finalizing SQL statements (in future will be done automatically
on timer basis) the database canno close correctly.
Always clear previous model when changing type and also clear line edit
when selecting NoGraph
LineGraphScene: allow setting NoGraph
* Re-use names already fetched by scene when possible
* Paint electric platform in blue and embolden throgh tracks
gfgit added 25 commits July 17, 2021 15:10
LineGraphScene: do not reload when requested same object unless forced.
Initial implementation.
All models or part of code which modify railway layout report to
MeetingSession.
Single instance member of ViewManager.
Central place which listens to notifications about railway layout
changes from MeetingSession and decides which graphs needs to be
refreshed.
It is also a central place to clear all graph before closing database.
All scenes must be registered, they get automatially unregistered if
destroyed.
Subclass of QAbstractScrollArea which is a bit more efficient than
having a custom QWidget (formet LineGraphViewport) inside a QScrollArea.
QScrollArea was already subclassed in LineGraphScrollArea to add headers
(HourPanel and StationLabelsHeader).

LineGraphView replaces both LineGraphViewport and LineGraphScrollArea in
a single class and manages headers.
Update viewport instead of the scroll view (self) to prevent glitches on
clearing graph.
No need to manually paint background for now.
Set background to white for a better contrast with the graph and to be
closer to printed output.
LineGraphView is a subclass of QAbstractScrollArea which is a subclass
of QFrame.
QFrame draws a box around widget contents but we cover top and left
borders with our custom headers.
Move the headers away.
Do not calculate size in LineGraphView, do it in scene.
Center station labels on station platforms and leave half stationOffset
on left and right borders of graph to give extra space for last station
label and to separate a bit first station from HourPanel.
Listen settings for changes and update consequently.
Listen setting for changes and reload all scenes
Not working. Needs translating rect argument.
Draw visible hour lines in the background.
Now horizOffset is already included in station xPos
And also half station offset on left to searate first station from
HourPanel.
New database schema diagram generated by SchemaCrawler.
Added diagram with old_* tables excluded for clarity.
I.e. old_stops just mirrors stops so do not put it in diagram.
@gfgit gfgit merged commit 9e27911 into new_station_schema2 Jul 19, 2021
@gfgit gfgit deleted the new_station_graph branch July 19, 2021 22:08
@gfgit gfgit restored the new_station_graph branch July 19, 2021 22:17
@gfgit gfgit deleted the new_station_graph branch July 19, 2021 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant