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

Solved issue #573 (Configuration of label sizes for x,y axes and plot title) #994

Merged
merged 53 commits into from
Jun 2, 2021

Conversation

risehr
Copy link
Contributor

@risehr risehr commented May 24, 2021

Added Fontsize changing options in Sideview options for labels, ticklabels, and title of the sideview plot.

One option for changing size of ticklabels of x and both y axes.
Another option for changing x,y axes labels and plot title.

risehr and others added 30 commits February 18, 2021 11:53
…or and linewidth to this dockwidget (.py extension) file
…and respective linewidth of individual kml files in the listwwidget( added changes to kmloverlay_dockwidget.py)
…dded functionality for not showing color or linewidth when there are no kml files present in the listwidget
…n the color and linewidth is changed. And also previous code's optimization
…h is direct in the main kmloverlay gui, display selected color of kml file right next to the file and the height of the colour block is in correspondence with the linewidth of that specific kml file
… were made to appear directly upon startup of kmloverlaywidget. On clicking kml files it shows linewidth and you can edit from there directly.
… twice because select_linewidth is called when item is clicked and also when valueChanged of spin box. Therefore, a flag is set to call select linewidth only when the value really changes.
makes conftest useable for windows devs , fixes Open-MSS#714 (Open-MSS#715)
…s selected. Made linewidth editor box faster which was slowing down significantly. Made color change much faster. Modified the tests also.
…loverlay_dockwidget.ui and removed the attribute setSteptype
…KML file to the QColorDialog selected color. Shortened range of linewidth from 0.1 to 10
Copy link
Member

@ReimarBauer ReimarBauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the amount of lines in the ui sideview_options.py looks a bit strange

@ReimarBauer
Copy link
Member

sideview_image

@risehr
Copy link
Contributor Author

risehr commented May 24, 2021

I have not altered the ui_sideview_options.py manually. Infact, I have converted it from pyuic5 -x ui_sideview_options.ui -o ui_sideview_options.py. Also, I have designed the ui_sideview_options.ui file from the qt designer.

Copy link
Member

@ReimarBauer ReimarBauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs to be done for topview too

@@ -488,6 +488,8 @@ def __init__(self, model=None, settings=None, numlabels=None):
self.settings_dict = {"vertical_extent": (1050, 180),
"vertical_axis": "pressure",
"secondary_axis": "no secondary axis",
"plot_title_size": "default",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we maybe should use here the config_loader and add the default value to the configuration. By this anyone can use his sizes from the mss_settings.json

https://github.com/Open-MSS/MSS/blob/develop/mslib/msui/__init__.py

We could add a dictionary here and start with

topview = {"plot_title_size": 10,
                 "axes_label_size": 10}

sideview = {"plot_title_size": 10,
                 "axes_label_size": 10}

the config_loader can access this by

topview_settings=config_loader(dataset="topview")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we maybe should use here the config_loader and add the default value to the configuration. By this anyone can use his sizes from the mss_settings.json

https://github.com/Open-MSS/MSS/blob/develop/mslib/msui/__init__.py

We could add a dictionary here and start with

topview = {"plot_title_size": 10,
                 "axes_label_size": 10}

sideview = {"plot_title_size": 10,
                 "axes_label_size": 10}

the config_loader can access this by

topview_settings=config_loader(dataset="topview")

Yes. I will look into it if I can do it.

self.label_7.setText(_translate("SideViewOptionsDialog", " Axes Label Size "))


if __name__ == "__main__":
Copy link
Member

@ReimarBauer ReimarBauer May 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on a converted ui file we don't have this usually. This may get added because of an option used?

 pyuic5 ui_sideview_options.ui > ../qt5/ui_sideview_options.py

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on a converted ui file we don't have this usually. This may get added because of an option used?

 pyuic5 ui_sideview_options.ui > ../qt5/ui_sideview_options.py

may be...i don't know exactly how that came.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these __main__ lines are never get into a test coverage but likly are counted as lines of the project.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these __main__ lines are never get into a test coverage but likly are counted as lines of the project.

Can/should we delete the __main__ lines manually?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eventually the command has different options on windows. maybe there is a supress option?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have to study about it.

@ReimarBauer
Copy link
Member

I have not altered the ui_sideview_options.py manually. Infact, I have converted it from pyuic5 -x ui_sideview_options.ui -o ui_sideview_options.py. Also, I have designed the ui_sideview_options.ui file from the qt designer.

sorry for my mistake, corrected already my comment

@risehr
Copy link
Contributor Author

risehr commented May 24, 2021

Okay, I will do for the topview also. And will also try to implement "the config loader part" that you said.

Copy link
Member

@ReimarBauer ReimarBauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the pyuic5 converter surprised me with that kind of output. But it is doing this.

Please can you look on setting up a default value in the MissionSupportSystemDefaultConfig and use this by the config_loader.

It works pretty well for sideview. We also need it for topview options.

The ui elements should be seperated from the Performance section into an own section.
Performance is used for aircraft specifications. e.g. weight, fuel.

A new section may be Font sizes?

@risehr
Copy link
Contributor Author

risehr commented May 24, 2021

the pyuic5 converter surprised me with that kind of output. But is is doing this.

Please can you look on setting up a default value in the MissionSupportSystemDefaultConfig and use this by the config_loader.

It works pretty well for sideview. We also need it for topview options.

The ui elements should be seperated from the Performance section into an own section.
Performance is used for aircraft specifications. e.g. weight, fuel.

A new section may be Font sizes?

Yes, I have thought about it to put it in a new section. But I wondered, changing fontsize is increasing the performance of the viewing of flighttrack by the user. That's why! Alright, I will put it in a new section named "Font sizes"

@risehr
Copy link
Contributor Author

risehr commented May 28, 2021

Hello @ReimarBauer I am still on this. Topview also got covered for size configuration. Right now, I am setting the MSSDefaultconfig. Just thought to update you on the work.

@risehr
Copy link
Contributor Author

risehr commented May 29, 2021

Added fontsize configurable options for topview also.
User can now put his default value for fontsize from mss_settings
Gave a separate space for fontsizes in topview and sideview options UI.

Copy link
Member

@ReimarBauer ReimarBauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

recently there was a linearview module added. Please add this feature with an Option button there too.

see other comments

@@ -1269,13 +1319,17 @@ def draw_legend(self, img):
xticks=[], yticks=[],
label="ax2", zorder=0)
self.legax.patch.set_facecolor("None")
# self.legax.set_yticklabels("ax2", fontsize=32, minor=False)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if comments are not needed for explainations, remove them

on all places.
if it is something you want to log ;) use logging.debug()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if comments are not needed for explainations, remove them

on all places.
if it is something you want to log ;) use logging.debug()

Okay Noted.

@@ -287,3 +340,48 @@ def retranslateUi(self, SideViewOptionsDialog):
self.groupBox_4.setTitle(_translate("SideViewOptionsDialog", "Performance"))
self.cbDrawCeiling.setText(_translate("SideViewOptionsDialog", "draw ceiling altitude"))
self.btCeilingColour.setText(_translate("SideViewOptionsDialog", "colour"))
self.groupBox_5.setTitle(_translate("SideViewOptionsDialog", "Font Sizes"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be name this box title: "Plot Options". Hmm, somehow in topview these are all "Plot Options"

This will be also valid when we add there more features in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be name this box title: "Plot Options". Hmm, somehow in topview these are all "Plot Options"

This will be also valid when we add there more features in the future.

Okay. I will change this to "Plot Options."

@risehr
Copy link
Contributor Author

risehr commented May 31, 2021

recently there was a linearview module added. Please add this feature with an Option button there too.

see other comments

Yeah, I have noticed that before but was not sure to add because there were no previous customizations about anything. But not to worry, I will add the options for this Linearview also.

Copy link
Member

@ReimarBauer ReimarBauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a few small questions added.

used it with the 3 views and it is a good improvement :)

@@ -41,6 +41,7 @@ def test_no_coastsegs(self):
# On land
self.map.ax.set_xlim([2, 3])
self.map.ax.set_ylim([48, 49])
self.map._draw_auto_graticule()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@risehr is this change needed for the test? If so you likly found a bug.

@@ -145,10 +144,8 @@ def __init__(self, identifier=None, CRS=None, BBOX_UNITS=None, PROJECT_NAME=None
self.crs_text = self.ax.figure.text(0, 0, self.crs)

if self.appearance["draw_graticule"]:
try:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joernu76 please look on this change

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ReimarBauer Yes, the test was failing. Hence, it was needed. Both are related. Since, I removed _draw_auto_graticule() from def init() of mpl_map because this is already being called in init() of MPLTopview Class of mpl_qtwidget(since it is necessary to draw graticule with the already changed fontsizes). And hence, since I removed this _draw_auto_graticule() from mpl_map.py, the test also needed to be changed otherwise the test would continue to fail.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, the test is likly now on the"wrong" place, but we can move it later.
We do avoid this when the test is using MPLTopview

@ReimarBauer ReimarBauer requested a review from joernu76 June 2, 2021 11:20
@ReimarBauer ReimarBauer merged commit e516945 into Open-MSS:develop Jun 2, 2021
Marilyth pushed a commit to Marilyth/MSS that referenced this pull request Jun 17, 2021
…and plot title) (Open-MSS#994)

* ui_kmloverlay_dockwidget.ui file changed for showing color and linewidth of individual kml files

* Changed the ui_kmloverlay_dockwidget.py added features of showing color and linewidth to this dockwidget (.py extension) file

* Added functionality and connected slots to show the respective color and respective linewidth of individual kml files in the listwwidget( added changes to kmloverlay_dockwidget.py)

* Modified 'remove_file(self)' function in kmloverlay_dockwidget.py ; added functionality for not showing color or linewidth when there are no kml files present in the listwidget

* Instant changes/reflection to the color label and linewidth label when the color and linewidth is changed. And also previous code's optimization

* Change color option added to main kmloverlay gui, editing of linewidth is direct in the main kmloverlay gui, display selected color of kml file right next to the file and the height of the colour block is in correspondence with the linewidth of that specific kml file

* Discarded obsolete color label display and linewidth label. The icons were made to appear directly upon startup of kmloverlaywidget. On clicking kml files it shows linewidth and you can edit from there directly.

* Optimized the code by setting flag to prevent the same icon being set twice because select_linewidth is called when item is clicked and also when valueChanged of spin box. Therefore, a flag is set to call select linewidth only when the value really changes.

* flake8 test run successfuly without any errors

* Improved functionality for setting color icons while adding files and tried the tests again

* Modified test_kmloverlay_dockwidget.py test file and removed brackets from if() in kmloverlay_dockwidget.py

* changes in test_wms_control/py for flake8 test to pass

* Added features for hiding of linewidth & color options until a file is selected. Made linewidth editor box faster which was slowing down significantly. Made color change much faster. Modified the tests also.

* Installed qt==5.9.7 and changed ui_kmloverlay_dockwidget.py and ui_kmloverlay_dockwidget.ui and removed the attribute setSteptype

* Made Change Color button transparent. Added the current color of the KML file to the QColorDialog selected color. Shortened range of linewidth from 0.1 to 10

* Added .coverage to gitignore

* Solved the issue Open-MSS#736 [Dock-widgets in TableView prevent TableView from closing upon application exit] - closing of tableview window when main MSS window is closed. Previously it used to stick around. But now it closes with MSS main window.

* Made the code more understandable for solved issue Open-MSS#736

* Updating Merge Conflict

* Synced with OpenMSS:develop

* Added options in sideview to change the fontsize of x and y(both y) axes ticklabels and labels along with the plot title.

* Rectified previous mistakes in gitignore file

* Added fontsize configuration options for topview and added datasets for default size in MSSdefaultConfig so that user can put his default value.

* Added plot options for LinearView, SideView, Topview and added default settings for users for those plot options.

* Modified code to pass the tests.

Co-authored-by: ReimarBauer <rb.proj@gmail.com>
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.

Plot x-axis, y-axis, title, and color bar label sizes should be configurable.
2 participants