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

Sorting 2 #104

Closed
edd-cgfan opened this issue Jul 25, 2023 · 6 comments
Closed

Sorting 2 #104

edd-cgfan opened this issue Jul 25, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@edd-cgfan
Copy link

Hi Clem,

By chance, under special DX conditions, I wanted to know how to sort each transmitter site by distance:

10B-rbb-TII-km-Sorting-problem-ascending

10B-rbb-TII-km-Sorting-problem-descending

What one would expect is this for the ascending case:
10B-rbb-TII-km-Sorting-ok

This is another sorting problem:
It is the km column of the TII tab.
It is not an issue of QIRX, it is an issue of the control (WPF DataGrid?) because the default sorting algorithm of the control doesn't sort numerically.

Here is a link to a raw file containing this case:
10B-rbb-raw-file

You can check it if you change the OwnPosition line in the qirx4.config file to:
<OwnPosition Latitude="52.131489" Longitude="11.633654" />

Maybe you can think about a custom sorting for the km columns when you work on the other sorting problem (#102).

Regards,
cgfan

@softsyst
Copy link
Owner

Hi cgfan,

Your problem is well-known. The column sorting is a nasty issue, however in another way as the one you described. What you need is almost no effort. It has been "sloppy" programming by whoever created that code...
The WPF data grid handles it automatically in the correct way if you give it the correct data type. I gave it a string, so it sorted as a string...
I made a quick test and gave it a numerical type (double) as datatype, and this is the result from your file (thanks for it btw), with the "km_abs" column showing the correct sorting:

image

Then, where's the "nasty" problem?
The problem is that you do not know which column is sorted, and in which way (ascending, descending). The "correct" and expected solution is to show some indication on the sorted column.
The xaml provides this also, but (and this is the nasty part) only in the following way:

image

This really looks not nice at all.
As soon as you change the default background color, i.e. the one shown here, the sorting indication is gone. It comes back only if you write a template with many lines of code.
Whoever decided this at MS, ....

In any case, the correct sorting will be included in the next version. The sorting indication would be a separate issue.

BTW, this issue might affect also other tables, which I will investigate.

Regards,
Clem

@softsyst softsyst added the bug Something isn't working label Jul 25, 2023
@softsyst
Copy link
Owner

softsyst commented Sep 1, 2023

Should work in 4.1.1

@edd-cgfan
Copy link
Author

Hi Clem,

Thanks for the new version and your efforts solving this sorting problem.
It works well.
I like the way how you show which column is sorted in which direction.

However, I found one thing: After the first start of the receiver and not having touched any column header:
Please see the images:
Initial-sorting-5C

At the following one it seems to be sorted right, but the the arrow for indication of the sorting isn't the right one:
Initial-sorting-5C-3
(After looking at the image again, I see that the sorting does not seem to be correct: 0.024 and 0.025)

Nevertheless, my suggestion:
Just omit the arrow and show it only after one has clicked on the column if that is easy to implement.

Regards,
cgfan

@softsyst
Copy link
Owner

softsyst commented Sep 3, 2023

Hi cgfan,

many thanks for this quick test. The behavior was (half) intended, as that table was not considered to need a permanent update of the sorting. However, in a dynamic environment this would be at least confusing.

Therefore, I put an updated new version 4.1.2 into the "Download" which should fix this. I also considered your comment about showing the sorting triangle only after first user action.

The "History" page got a remark about the new version, nothing else.

Clem

@edd-cgfan
Copy link
Author

Hello Clem,

Thanks for 4.1.2.
Table sorting looks very good now:
Works perfectly.

Regards,
cgfan

@softsyst
Copy link
Owner

softsyst commented Sep 4, 2023

Thanks for feedback. I close this.

Clem

@softsyst softsyst closed this as completed Sep 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants