Write your own Einstein@home screensaver

loloflor
loloflor
Joined: 13 Aug 10
Posts: 2
Credit: 1084
RAC: 0

Hello, This is Flor, a have a

Message 78048 in response to message 77998

Hello, This is Flor, a have a question, can you help me? so, i want to activate the screensaver on my demant, how can i do that? because I want to show it to other people but I don´t want to wait for the inactivity of muy GPU. Thank very much! :)

Bernd Machenschalk
Bernd Machenschalk
Moderator
Administrator
Joined: 15 Oct 04
Posts: 4331
Credit: 251619338
RAC: 36045

What should always work is to

Message 78049 in response to message 78048

What should always work is to open the BOINC Manager window, switch to "Advanced View" (if not already there), select tab "Tasks", select a "running" task and click the "Show graphics" button. This will open the graphics for that task in a window, where you can even manipulate it (drag the sphere with the mouse etc.).

Other possibilities include defining a "hot corner" on Mac OS or using the "Preview" button on e.g. Windows XP screensaver dialog.

BM

BM

Mike Hewson
Mike Hewson
Moderator
Joined: 1 Dec 05
Posts: 6591
Credit: 324258914
RAC: 167891

I'm approaching, by degrees,

I'm approaching, by degrees, an experimental version to release and gain comment upon. My especial question is regards any copyright/licence notice I ought put in the source files. I understand the whole GNU GPL concept. I was wondering how to actually phrase that in code I have either written de novo or derived/altered from earlier efforts ( the downloadable framework code ). I'd like to do this right first time, and so it seems worth discussing here. If I am making too much of the matter please advise. I see three cases :

(A) code unaltered from what E@H has given me.

(B) code I have altered from what E@H has given me.

(C) code I have written de novo but linked to the above. Entirely new classes and whatnot ....

The generic boiler plate from the repository, which heads *.h and *.cpp files, is currently this :

[pre]/***************************************************************************
* Copyright (C) 2004 David Hammer, Eric Myers, Bruce Allen *
* Copyright (C) 2008 Bernd Machenschalk *
* *
* Copyright (C) 2008 by Oliver Bock *
* oliver.bock[AT]aei.mpg.de *
* *
* This file is part of Einstein@Home. *
* *
* Einstein@Home is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published *
* by the Free Software Foundation, version 2 of the License. *
* *
* Einstein@Home is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with Einstein@Home. If not, see . *
* *
***************************************************************************/[/pre]
This you'd leave for case A evidently, but what of B and C? I'm not the least fussed about personal attribution, I just want to remain true & correct to the GPL rules.

For case B, I would guess something like ( with a preference for excluding my email address ) this :

[pre]/***************************************************************************
* Copyright (C) 2004 David Hammer, Eric Myers, Bruce Allen *
* Copyright (C) 2008 Bernd Machenschalk *
* *
* Copyright (C) 2008 by Oliver Bock *
* oliver.bock[AT]aei.mpg.de *
* *
* As altered by Mike Hewson in 2010 *
* *
* This file is part of Einstein@Home. *
* *
* Einstein@Home is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published *
* by the Free Software Foundation, version 2 of the License. *
* *
* Einstein@Home is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with Einstein@Home. If not, see . *
* *
***************************************************************************/[/pre]
Leaving case C perhaps as :

[pre]/**************************************************************************
* Copyright (C) 2010 Mike Hewson *
* *
* This file is part of Einstein@Home. *
* *
* Einstein@Home is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published *
* by the Free Software Foundation, version 2 of the License. *
* *
* Einstein@Home is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with Einstein@Home. If not, see . *
* *
***************************************************************************/[/pre]
As I have sourced various public databases ( for celestial object data ) it's no trouble to include this type of thing, of course suitably permitted by the sources themselves according to their particular instructions. For instance :

[pre]/***************************************************************************
* List of known pulsars, extracted from the ATNF catalogue (v 1.36) *
***************************************************************************/[/pre]
My lack of experience in the matter suggests : 'the only dumb questions are those not asked' ..... :-) :-)

Cheers, Mike.

I have made this letter longer than usual because I lack the time to make it shorter ...

... and my other CPU is a Ryzen 5950X :-) Blaise Pascal

Oliver Behnke
Oliver Behnke
Moderator
Administrator
Joined: 4 Sep 07
Posts: 987
Credit: 25171438
RAC: 2

Hi Mike! This is an easy

Message 78051 in response to message 78050

Hi Mike!

This is an easy one:
a) Leave stuff as it is
b) Just add your copyright notice to the header (as I did mine)
c) As you suggested

Please note that copyright and license are typically two different things. Your copyright is something that comes automatically when you author something new of non-trivial size - it's actually not required to claim it explicitly, the entry is just meant for proper attribution (although these things differ from country to country). The license is something you, as the author, grant to others. If you want to contribute code to Einstein@Home the license you choose has to be GPLv2-compliant (a non-issue in your case). FYI: the copyright, in this case, means that if we want to change a (concerned) file's license, we'd have to ask all authors for their consent. Everything else is regulated by the license.

Cheers,
Oliver

Einstein@Home Project

Mike Hewson
Mike Hewson
Moderator
Joined: 1 Dec 05
Posts: 6591
Credit: 324258914
RAC: 167891

RE: Hi Mike! This is an

Message 78052 in response to message 78051

Quote:

Hi Mike!

This is an easy one:
a) Leave stuff as it is
b) Just add your copyright notice to the header (as I did mine)
c) As you suggested

Please note that copyright and license are typically two different things. Your copyright is something that comes automatically when you author something new of non-trivial size - it's actually not required to claim it explicitly, the entry is just meant for proper attribution (although these things differ from country to country). The license is something you, as the author, grant to others. If you want to contribute code to Einstein@Home the license you choose has to be GPLv2-compliant (a non-issue in your case). FYI: the copyright, in this case, means that if we want to change a (concerned) file's license, we'd have to ask all authors for their consent. Everything else is regulated by the license.


Terrific! As you say, easy. Leave license alone, no problemo. I guess I'll put a copyright in so that people will know who to ask/blame about it ..... :-)

Cheers, Mike.

( edit ) And I can create another email address just for this - partition any spam problem at least.

I have made this letter longer than usual because I lack the time to make it shorter ...

... and my other CPU is a Ryzen 5950X :-) Blaise Pascal

Mike Hewson
Mike Hewson
Moderator
Joined: 1 Dec 05
Posts: 6591
Credit: 324258914
RAC: 167891

Ok, I want to widen the

Ok, I want to widen the (sub)set of key presses allowed to flow through for handling within my ( derived class from ) AbstractGraphicsEngine. As far as I can tell, I would merely need to pop further case(s) into the switch structure within the WindowManager::eventLoop() routine, while also staying within the set of values listed in the AbstractGraphicsEngine::KeyBoardKey enumeration?

For instance, if I want the 'F' key :

[pre]switch (event.key.keysym.sym) {
.
.
.
case SDLK_f:
eventObservers.front()->keyboardPressEvent(AbstractGraphicsEngine::KeyF);
break;
.
.
}[/pre]
and so on mutatis mutandis ...

For that matter ( not urgent, but down the track ) does the SDL as incorporated into this framework easily allow picking up a mouse scroll wheel and button, and flicking them on for handling? :-)

Cheers, Mike.

( edit ) Noting that not all mice have a scroll wheel and button, whereas all target keyboards have an 'F'.

I have made this letter longer than usual because I lack the time to make it shorter ...

... and my other CPU is a Ryzen 5950X :-) Blaise Pascal

Oliver Behnke
Oliver Behnke
Moderator
Administrator
Joined: 4 Sep 07
Posts: 987
Credit: 25171438
RAC: 2

RE: As far as I can tell, I

Message 78054 in response to message 78053

Quote:
As far as I can tell, I would merely need to pop further case(s) into the switch structure within the WindowManager::eventLoop() routine, while also staying within the set of values listed in the AbstractGraphicsEngine::KeyBoardKey enumeration?

Correct! As your class is derived from AbstractGraphicsEngine it's registered as the current observer and will therefore receive the keyboardPressEvent() accordingly.

Quote:

For that matter ( not urgent, but down the track ) does the SDL as incorporated into this framework easily allow picking up a mouse scroll wheel and button, and flicking them on for handling? :-)

Well, AbstractGraphicsEngine already includes mouseButtonEvent() and mouseMoveEvent() and as far as I know the mouse wheel is usually mapped to the 4th and 5th mouse button (at least on Linux). However, I never tested whether SDL propagates them that way as well... Give it a try :-)

Update: SDL provides SDL_BUTTON_X1 and SDL_BUTTON_X2 which might serve that purpose. You may just add suitable event filters to WindowManager::eventLoop() and forward them to AbstractGraphicsEngine::mouseButtonEvent(). Something along these lines:

[pre]
if(event.type == SDL_MOUSEBUTTONDOWN && event.button.button & SDL_BUTTON(SDL_BUTTON_X1)) {
eventObservers.front()->mouseButtonEvent(event.button.x, event.button.y, AbstractGraphicsEngine::MouseWheelUp)
}
[/pre]

The code example above assumes you added MouseWheelUp to the AbstractGraphicsEngine::MouseButton enum.

Cheers,
Oliver

Einstein@Home Project

Mike Hewson
Mike Hewson
Moderator
Joined: 1 Dec 05
Posts: 6591
Credit: 324258914
RAC: 167891

RE: Correct! As your class

Message 78055 in response to message 78054

Quote:
Correct! As your class is derived from AbstractGraphicsEngine it's registered as the current observer and will therefore receive the keyboardPressEvent() accordingly.


Good. I didn't want to break anything. I tried it before your reply anyway and nuffin' blew up. I could even be catching on to this ... :-) :-)

Quote:
Well, AbstractGraphicsEngine already includes mouseButtonEvent() and mouseMoveEvent() and as far as I know the mouse wheel is usually mapped to the 4th and 5th mouse button (at least on Linux). However, I never tested whether SDL propagates them that way as well... Give it a try :-)


Ok, so that would require at least expanding the AbstractGraphicsEngine::MouseButton enumeration, including another case in my event listener [ that I've defined within my derived engine to make concrete the role of AbstractGraphicsEngine::mouseMoveEvent() ], plus some fiddling about with the following ( whoa! yucky nested ... ) portion of WindowManager::eventLoop() :

[pre]else if (event.motion.state & (SDL_BUTTON(1) | SDL_BUTTON(3)) &&
event.type == SDL_MOUSEMOTION) {

if (event.motion.state & SDL_BUTTON(1)) {
// notify our observers (currently exactly one, hence front())
eventObservers.front()->mouseMoveEvent(event.motion.xrel,
event.motion.yrel,
AbstractGraphicsEngine::MouseButtonLeft);
}
else if (event.motion.state & SDL_BUTTON(3)) {
// notify our observers (currently exactly one, hence front())
eventObservers.front()->mouseMoveEvent(
event.motion.xrel,
event.motion.yrel,
AbstractGraphicsEngine::MouseButtonRight);
}
}[/pre]
to slot that case in. Whatever behaviour one attaches to the scroll wheel/button ought be non-essential for the screensaver - cos not everyone will have one.

Hmmm .. I might backburner that one for a rainy day. :-)

Cheers, Mike.

I have made this letter longer than usual because I lack the time to make it shorter ...

... and my other CPU is a Ryzen 5950X :-) Blaise Pascal

Oliver Behnke
Oliver Behnke
Moderator
Administrator
Joined: 4 Sep 07
Posts: 987
Credit: 25171438
RAC: 2

RE: Ok, so that would

Message 78056 in response to message 78055

Quote:

Ok, so that would require at least expanding the AbstractGraphicsEngine::MouseButton enumeration, including another case in my event listener [ that I've defined within my derived engine to make concrete the role of AbstractGraphicsEngine::mouseMoveEvent() ]

Yep, just go ahead and add MouseWheelUp and MouseWheelDown -- after you're sure that I interpreted the SDL events for button 4 and 5 correctly :-)

Quote:

plus some fiddling about with the following ( whoa! yucky nested ... ) portion of WindowManager::eventLoop() :
[...]
to slot that case in.

Well, I would just add your event handler case as another top-level entry, not injecting it into the existing nested filter of mine. The main difference being that you want to filter for event.type == SDL_MOUSEBUTTONDOWN, not SDL_MOUSEMOTION I suppose.

Oliver

Einstein@Home Project

Mike Hewson
Mike Hewson
Moderator
Joined: 1 Dec 05
Posts: 6591
Credit: 324258914
RAC: 167891

RE: Yep, just go ahead and

Message 78057 in response to message 78056

Quote:
Yep, just go ahead and add MouseWheelUp and MouseWheelDown -- after you're sure that I interpreted the SDL events for button 4 and 5 correctly :-)


I'll research that.

Quote:
Well, I would just add your event handler case as another top-level entry, not injecting it into the existing nested filter of mine. The main difference being that you want to filter for event.type == SDL_MOUSEBUTTONDOWN, not SDL_MOUSEMOTION I suppose.


Ah yes. Well spotted! I really did just want the scroll/button regardless of the mouse move ( read the code properly Mike ) .... ;-)

Cheers, Mike.

( edit ) Just read the update to your earlier post. It's all clear now ... :-)

I have made this letter longer than usual because I lack the time to make it shorter ...

... and my other CPU is a Ryzen 5950X :-) Blaise Pascal

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.