maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   [Annouce] HealthCheck - Hardware/System checker for the N900 (https://talk.maemo.org/showthread.php?t=45453)

doksng 2010-06-11 07:27

Re: [Annouce] HealthCheck - Hardware/System checker for the N900
 
NICE:D:D:D:D:D This is amazing.
Are you no longer sticking with the green theme?

I was wondering if it is possible to make the signal strength measurement on the comms tab to be dynamic so that it varies with signal level changes.

Would it be possible to have a widget version
Thanks

Quote:

Originally Posted by noobmonkey (Post 707774)
Just wanted to get some opinions. Did a quick mockup of a possible new design.

The idea is as follows:
  • Main Menu
  • Each information screen displays as before but in a stackable window, with a lister, but less per page, so easier to find information
  • Each test loads up in it's own stackable window.

First draft of menu below:
http://www.greg-roberts.com/healthcheck1.png
(Ignore the title - just a label until i do something fancy)


noobmonkey 2010-06-11 07:31

Re: [Annouce] HealthCheck - Hardware/System checker for the N900
 
Quote:

Originally Posted by doksng (Post 709961)
NICE:D:D:D:D:D This is amazing.
Are you no longer sticking with the green theme?

I was wondering if it is possible to make the signal strength measurement on the comms tab to be dynamic so that it varies with signal level changes.

Would it be possible to have a widget version
Thanks

I'm not purposely moving away from the green theme, was just doing a mock-up for opinions :)
Going to start working on something this week, still not wholly decided!

Hmmmmm, i have to admit i am trying to complete threading etc, to allow the values to auto update, but for now i might need to stick with a 'Click to update' if that is ok?

Hmmmm widget-wise, it is probably worth using queenbee/DSE (Not sure those two can do everything though?)

doksng 2010-06-11 07:52

Re: [Annouce] HealthCheck - Hardware/System checker for the N900
 
it is okay for now but would love to see the signal changes as you move around.
Installed Quenbee but it is not that quite easy to use.

noobmonkey 2010-06-11 08:51

Re: [Annouce] HealthCheck - Hardware/System checker for the N900
 
good point. i spose my plans to improve are as follows:
Improve ui
add multi threading or similar function to allow updating
add further tests
add translations

The UI part will be developed over the next two weeks, and will be pretty much a full re-code as well.
But if anyone has useful tips for threading in pyqt, please let me know!

Venemo 2010-06-11 09:02

Re: [Annouce] HealthCheck - Hardware/System checker for the N900
 
Quote:

Originally Posted by noobmonkey (Post 710055)
But if anyone has useful tips for threading in pyqt, please let me know!


Well, of course we have!

The easiest way is using QThreadPool with a custom QRunnable implementation.

Your QRunnable's run() method would check the necessary values and refresh the UI.

The main UI window should have a QTimer and on a predefined interval (on the QTimer's timeout signal), it would create a new instance of your own QRunnable and make the thread pool execute it.

Note that the thread pool has a static "global instance", so you don't have to create an instance of it, just access the global instance and make that do things for you.

noobmonkey 2010-06-11 09:06

Re: [Annouce] HealthCheck - Hardware/System checker for the N900
 
Quote:

Originally Posted by Venemo (Post 710063)
Well, of course we have!

The easiest way is using QThreadPool with a custom QRunnable implementation.

Your QRunnable's run() method would check the necessary values and refresh the UI.

The main UI window should have a QTimer and on a predefined interval, it would create a new instance of your own QRunnable and make the thread pool execute it.

Note that the thread pool has a static "global instance", so you don't have to create an instance of that, just access the global instance and make that do things for you.

Ahaaaaaaa - thats actually the first explanation that i have understood! :) hehehe

I did see THP did something here, that looked similar to threading / updating - but may not be suitable.

Will see if i can get some basic versions running, assuming it all works, i can't see it being too difficult to do it for all updatable values :)

Venemo 2010-06-11 09:08

Re: [Annouce] HealthCheck - Hardware/System checker for the N900
 
Quote:

Originally Posted by noobmonkey (Post 710071)
Ahaaaaaaa - thats actually the first explanation that i have understood! :) hehehe

Thanks! :)

Quote:

Originally Posted by noobmonkey (Post 710071)
I did see THP did something here, that looked similar to threading / updating - but may not be suitable.

Well, I don't know a thing about Python, so I'm not sure.

Quote:

Originally Posted by noobmonkey (Post 710071)
Will see if i can get some basic versions running, assuming it all works, i can't see it being too difficult to do it for all updatable values :)

You just have to do a single QRunnable implementation for yourself that updates all the values.
No need to do it separately for all the updatable values.

(As this is not a quad core monster processor, there is no point in launching that many threads at once. The usual good practice is to keep one thread for the UI, and do all the other stuff that would otherwise slow it down in separate threads.)

noobmonkey 2010-06-11 09:13

Re: [Annouce] HealthCheck - Hardware/System checker for the N900
 
Quote:

Originally Posted by Venemo (Post 710074)
Thanks! :)



Well, I don't know a thing about Python, so I'm not sure.



You just have to do a single QRunnable implementation for yourself that updates all the values.
No need to do it separately for all the updatable values.

(As this is not a quad core monster processor, there is no point in launching that many threads at once. The usual good practice is to keep one thread for the UI, and do all the other stuff that would otherwise slow it down in separate threads.)

The Qrunnable idea is interesting, as now all of my values (Ate least in system) are retrieved via functions
ie
Code:

a = gn_functions.getaValue()
 self.listWidget.currentItem().setText("Value Name \t\t\t" + a)

So in theory i should be able to just put those calls into that qrunnable idea/format....

Venemo 2010-06-11 09:34

Re: [Annouce] HealthCheck - Hardware/System checker for the N900
 
Quote:

Originally Posted by noobmonkey (Post 710084)
The Qrunnable idea is interesting, as now all of my values (Ate least in system) are retrieved via functions
ie
Code:

a = gn_functions.getaValue()
 self.listWidget.currentItem().setText("Value Name \t\t\t" + a)

So in theory i should be able to just put those calls into that qrunnable idea/format....

The only thing you should take care of is the communication between QRunnable and the UI.

I would do it the following way:
- Create a method in the UI that calls those functions you're talking about
- Then, create a class that derives from QRunnable (Let's call it Updater) and has a reference to the UI class, and in its run() method calls the method that you created above
- Create a QTimer in the UI class and in its timeout(), create a new instance of the Updater class you created above, and make the global instance of QThreadPool execute it.

It couldn't be more straightforward. :)
I would gladly post code examples, but I don't know a thing about Python :( , and I'm not sure whether my C++ example would be of any use to you. :p

noobmonkey 2010-06-11 09:37

Re: [Annouce] HealthCheck - Hardware/System checker for the N900
 
Quote:

I would do it the following way:
- Create a method in the UI that calls those functions you're talking about
Done!

Quote:

Then, create a class that derives from QRunnable (Let's call it Updater) and has a reference to the UI class, and in its run() method calls the method that you created above
Ok, sounds easy!

Quote:

- Create a QTimer in the UI class and in its timeout(), create a new instance of the Updater class you created above, and make the global instance of QThreadPool execute it.
:)

Quote:

I would gladly post code examples, but I don't know a thing about Python :( , and I'm not sure whether my C++ example would be of any use to you. :p
Any examples will help - i'm getting used to translating examples from GTK and c++! :)


All times are GMT. The time now is 19:07.

vBulletin® Version 3.8.8