Jump to content


Photo

Improved Satfinder

satfinder

  • Please log in to reply
40 replies to this topic

#1 pingflood

  • Member
  • 23 posts

+3
Neutral

Posted 8 February 2013 - 06:08

Hey Guys,

sorry if here isn't the proper channel to suggest some changes for your system plugins.

I had worked a little on the Satfinder plugin, and added some few improvements.

Besides some minor cosmetics changes in the code, the main new feature is that now you can start scanning the transponder directly from the Satfinder.
This way you can find a satellite, fine tune it and scan the current TP all from the same screen.
In order to do this, you just need to press "OK". ;)

Also, I've tweaked a few things on the Satfinder skin (check the attached image).

I've corrected some background colors, borders and positions.
I think the font size and widget positions is more favorable to look at the distance (specially when you are finetuning your dishes).

Inside the package you can find the updated Satfinder plugin.py and skin.xml


I hope you like it and maybe add it to OpenPLi. :)

Best regards

Attached Files



Re: Improved Satfinder #2 littlesat

  • PLi® Core member
  • 56,223 posts

+691
Excellent

Posted 8 February 2013 - 08:06

Is it possible that you create diffs or patches... so we can see easily what you changed?

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: Improved Satfinder #3 Erik Slagter

  • PLi® Core member
  • 46,951 posts

+541
Excellent

Posted 8 February 2013 - 09:15

Yeah, unfortunately the Satfinder plugin is part of the enigma source (on sf), so you can't do a fork like with other plugins hosted on github, so, please, post patches. And please post then both inline (for review and discussion) (code block) and as attachment (for applying).

* Wavefrontier T90 with 28E/23E/19E/13E via SCR switches 2 x 2 x 6 user bands
I don't read PM -> if you have something to ask or to report, do it in the forum so others can benefit. I don't take freelance jobs.
Ik lees geen PM -> als je iets te vragen of te melden hebt, doe het op het forum, zodat anderen er ook wat aan hebben.


Re: Improved Satfinder #4 pingflood

  • Member
  • 23 posts

+3
Neutral

Posted 8 February 2013 - 14:45

Hi guys,

thanks for your attention.

I just remember to say that the skin suggestion is compatible both with current Satfinder and this new patched.

Also, you don't need to patch the skin to use this patched version.

Here follows the patch. I don't know if the default diff options generate your preferred format for patches. If don't, please tell me what flags do you prefer.
Since there's the same code in raw attached, I'll comment the code pasted here inline, so it will make it clear to understand.


All the changes on the following block:
- First of all, a cosmetic change: I moved the __init__ to the top of the class.
- Added a text for self["introduction"]
- Added the key actions used here (block with self["actions"] = ActionMap(["SetupActions"])
- Moved some common code that should run on screen show to a separated function and added the onShow listener self.onShow.append(self.__onShow). This function will be seen later.

17a18,43
>  def __init__(self, session, feid):
>   self.initcomplete = False
>   self.feid = feid
>   self.oldref = None
>   self.frontendData = None
>   service = session and session.nav.getCurrentService()
>   feinfo = service and service.frontendInfo()
>   self.frontendData = feinfo and feinfo.getAll(True)
>   del feinfo
>   del service
>
>   ScanSetup.__init__(self, session)
>
>   self["introduction"].setText(_("Press OK to scan"))
>   self["Frontend"] = FrontendStatus(frontend_source = lambda : self.frontend, update_interval = 100)
>
>   self["actions"] = ActionMap(["SetupActions"],
>   {
>	"ok": self.keyGoScan,
>	"cancel": self.keyCancel,
>   }, -3)
>
>   self.initcomplete = True
>   self.onClose.append(self.__onClose)
>   self.onShow.append(self.__onShow)
>


- This block (besides continuing organizing the code), will define the __onShow function.
It contains all the "if not self.openFrontend()" block removed from __init__, and added a retune in the end, to make sure it will tune on the current transponder and set the self.transponder variable, that will be seen later.

34,44c60
<  def __init__(self, session, feid):
<   self.initcomplete = False
<   self.feid = feid
<   self.oldref = None
<   self.frontendData = None
<   service = session and session.nav.getCurrentService()
<   feinfo = service and service.frontendInfo()
<   self.frontendData = feinfo and feinfo.getAll(True)
<   del feinfo
<   del service
<
---
>  def __onShow(self):
46,47c62,63
<	self.oldref = session.nav.getCurrentlyPlayingServiceReference()
<	session.nav.stopService() # try to disable foreground service
---
>	self.oldref = self.session.nav.getCurrentlyPlayingServiceReference()
>	self.session.nav.stopService() # try to disable foreground service
49,51c65,67
<	 if session.pipshown: # try to disable pip
<	  session.pipshown = False
<	  del session.pip
---
>	 if self.session.pipshown: # try to disable pip
>	  self.session.pipshown = False
>	  del self.session.pip
54,55d69
<
<   ScanSetup.__init__(self, session)
57,60c71
<   self["introduction"].setText("")
<   self["Frontend"] = FrontendStatus(frontend_source = lambda : self.frontend, update_interval = 100)
<   self.initcomplete = True
<   self.onClose.append(self.__onClose)
---
>   self.retune(None)


- Cosmetic changes: The following block will just fix the item order, and will make the predefined transponder easier to read.

71,72d81
<   self.typeOfTuningEntry = getConfigListEntry(_('Tune'), self.tuning_type)
<   self.list.append(self.typeOfTuningEntry)
74a84,85
>   self.typeOfTuningEntry = getConfigListEntry(_('Tune'), self.tuning_type)
>   self.list.append(self.typeOfTuningEntry)
87,88d97
<	self.list.append(getConfigListEntry(_('Inversion'), self.scan_sat.inversion))
<	self.list.append(getConfigListEntry(_('Symbol rate'), self.scan_sat.symbolrate))
89a99,100
>	self.list.append(getConfigListEntry(_('Symbol rate'), self.scan_sat.symbolrate))
>	self.list.append(getConfigListEntry(_('Inversion'), self.scan_sat.inversion))
204c215,216
<	 e = str(x[1]) + "," + str(x[2]) + "," + pol + "," + fec
---
>	 e = "%d %s %d %s" % ((x[1] / 1000), pol, (x[2] / 1000), fec)
>


- The following block will remove the keyGo function (that overrides a function on ScanSetup.py) and define a keyGoScan function.

The keyGoScan will:
- Set current frontend as None and delete self.raw_channel, to make sure it will not interfere on ScanSetup later.
- Call updateSatList from ScanSetup, to set some variables.
- The line on self.scan_satselection is a little workaround to make ScanSetup recognize the selected satellite. This is due to different variable types and names for the same thing, on both ScanSetup and Satfinder.
- The setValue block below will fill the scan_sat values with the current transponder information. This will also apply the values of the predefined TP data over the manual TP, when you try to scan it.
- Then call the keyGo from ScanSetup.


212,213c224,242
<  def keyGo(self):
<   self.retune(self.tuning_type)
---
>  def keyGoScan(self):
>   self.frontend = None
>   del self.raw_channel
>
>   self.updateSatList()
>
>   self.scan_satselection = [ self.tuning_sat ]
>
>   self.scan_sat.frequency.setValue(self.transponder[0])
>   self.scan_sat.symbolrate.setValue(self.transponder[1])
>   self.scan_sat.polarization.setValue(self.transponder[2])
>   self.scan_sat.fec.setValue(self.transponder[3])
>   self.scan_sat.inversion.setValue(self.transponder[4])
>   self.scan_sat.system.setValue(self.transponder[6])
>   self.scan_sat.modulation.setValue(self.transponder[7])
>   self.scan_sat.rolloff.setValue(self.transponder[8])
>   self.scan_sat.pilot.setValue(self.transponder[9])
>
>   self.keyGo()


- The two following block will set the self.transponder in tune() function. This values are used in the keyGoScan, that are set for later scanning on ScanSetup.
- The last line just internationalize the description, addind _("") around it.


233a263
>	 self.transponder = transponder
288c318
<   return PluginDescriptor(name=_("Satfinder"), description="Helps setting up your dish", where = PluginDescriptor.WHERE_MENU, needsRestart = False, fnc=SatfinderStart)
---
>   return PluginDescriptor(name=_("Satfinder"), description=_("Helps setting up your dish"), where = PluginDescriptor.WHERE_MENU, needsRestart = False, fnc=SatfinderStart)

That's it..
I hope you liked it and it could be useful for someone else.

If you want to ask anything about it, I'll be glad to answer and clear it.

Best regards

Attached Files



Re: Improved Satfinder #5 Erik Slagter

  • PLi® Core member
  • 46,951 posts

+541
Excellent

Posted 8 February 2013 - 15:25

Very nice. I think either pieterg, MiLo or Littlesat should a have look at this for approval.

One little hint, if you're going to do this more often, please use the -u option with diff, it produces patches that are more easily readable and can be applied using the "patch" command.

* Wavefrontier T90 with 28E/23E/19E/13E via SCR switches 2 x 2 x 6 user bands
I don't read PM -> if you have something to ask or to report, do it in the forum so others can benefit. I don't take freelance jobs.
Ik lees geen PM -> als je iets te vragen of te melden hebt, doe het op het forum, zodat anderen er ook wat aan hebben.


Re: Improved Satfinder #6 pingflood

  • Member
  • 23 posts

+3
Neutral

Posted 8 February 2013 - 15:36

Hi,

glad you liked it. :)

Since I can't update the other post anymore, here follows the patch generated with diff -u.

Regards

Attached Files



Re: Improved Satfinder #7 Dimitrij

  • PLi® Core member
  • 9,985 posts

+337
Excellent

Posted 8 February 2013 - 16:43

SimpleSatScan-аutor vlamo

GigaBlue UHD Quad 4K /Lunix3-4K/Solo 4K


Re: Improved Satfinder #8 Erik Slagter

  • PLi® Core member
  • 46,951 posts

+541
Excellent

Posted 8 February 2013 - 17:00

What do you mean?

* Wavefrontier T90 with 28E/23E/19E/13E via SCR switches 2 x 2 x 6 user bands
I don't read PM -> if you have something to ask or to report, do it in the forum so others can benefit. I don't take freelance jobs.
Ik lees geen PM -> als je iets te vragen of te melden hebt, doe het op het forum, zodat anderen er ook wat aan hebben.


Re: Improved Satfinder #9 Dimitrij

  • PLi® Core member
  • 9,985 posts

+337
Excellent

Posted 8 February 2013 - 17:10

What do you mean?

pingflood know what I mean ...

GigaBlue UHD Quad 4K /Lunix3-4K/Solo 4K


Re: Improved Satfinder #10 Erik Slagter

  • PLi® Core member
  • 46,951 posts

+541
Excellent

Posted 8 February 2013 - 17:12

You mean it's not original work?

* Wavefrontier T90 with 28E/23E/19E/13E via SCR switches 2 x 2 x 6 user bands
I don't read PM -> if you have something to ask or to report, do it in the forum so others can benefit. I don't take freelance jobs.
Ik lees geen PM -> als je iets te vragen of te melden hebt, doe het op het forum, zodat anderen er ook wat aan hebben.


Re: Improved Satfinder #11 pingflood

  • Member
  • 23 posts

+3
Neutral

Posted 8 February 2013 - 18:01


What do you mean?

pingflood know what I mean ...


If you are accusing me on copying your work, that's a really serious accusation.

I didn't knew the plugin you referred to until now, and if you compare both codes, you will see that they are different, using different approaches. I'm sorry if both can do similar things.

If you inspect it better, you can see that the commom part on both codes came from orignal Satfinder and ScanSetup. The rest is different (check it by yourself).

Off course, Satfinder and ScanSetup aren't my job, but I'm proposing a patch, and if you check the code I submited here you will not find any mention to my name. I don't care about credits, I just want to have some good tools to play on my stb.

Even I'm being new over here, it doesn't means that I'm new in this hobby world.
Some people knows a part of my work regarding E2 plugins, and those who knows me, also knows that I would never plagiarize others work.

To OpenPLi team: I'm sorry to see this kind of accusation here. Even being just a few lines of code, I spent a lot of time working on this, and when I proposed the patch I did not wanted to bring any trouble here.

If you need any other words about this, I'm available to clear whatever you think still needed.

Best regards

Re: Improved Satfinder #12 Erik Slagter

  • PLi® Core member
  • 46,951 posts

+541
Excellent

Posted 8 February 2013 - 18:09

From the documentation of pingflood on it's code I am inclined to assume this is in fact original code.

I have been working on a blindscan plugin for DVB-S and realised the code ended up very similar to versions of other people, I think that's unavoidable in these situations. Furthermore it's okay to "borrow" other's GPL code, as long as it's mentioned as such.

* Wavefrontier T90 with 28E/23E/19E/13E via SCR switches 2 x 2 x 6 user bands
I don't read PM -> if you have something to ask or to report, do it in the forum so others can benefit. I don't take freelance jobs.
Ik lees geen PM -> als je iets te vragen of te melden hebt, doe het op het forum, zodat anderen er ook wat aan hebben.


Re: Improved Satfinder #13 pingflood

  • Member
  • 23 posts

+3
Neutral

Posted 8 February 2013 - 18:17

Furthermore it's okay to "borrow" other's GPL code, as long as it's mentioned as such.


Just to add little more information: I was using the changes for personal purposes. Since it was working, I decided to share it. I've checked the license under Satfinder plugin before making it public, in order to assure I wasn't breaking any rule.

Again, thanks for your attention, and I'm sorry for any trouble.

Regards

Re: Improved Satfinder #14 Dimitrij

  • PLi® Core member
  • 9,985 posts

+337
Excellent

Posted 8 February 2013 - 18:21

No, I am not accused of anything.
Everything is OK.
Only in the plugin SimpleSatScan there is a bug, closing plugin can cause crash.
The reason is very short interval poll.
This is a warning, your code may be similar problems.

update_interval = 100

Edited by Dima73, 8 February 2013 - 18:25.

GigaBlue UHD Quad 4K /Lunix3-4K/Solo 4K


Re: Improved Satfinder #15 Erik Slagter

  • PLi® Core member
  • 46,951 posts

+541
Excellent

Posted 8 February 2013 - 18:24

I have applied the patch on my own box, I must say, it works quite well. If you have more than one tuner, you can indeed scan using another tuner now and the current service remains active.

Just two little remarks:
- I think there should be a little text somewhere mentioning that pressing OK will start a scan
- when you actually start the scan, the current service is stopped, this might be a limitation of the scan component, I don't know.

* Wavefrontier T90 with 28E/23E/19E/13E via SCR switches 2 x 2 x 6 user bands
I don't read PM -> if you have something to ask or to report, do it in the forum so others can benefit. I don't take freelance jobs.
Ik lees geen PM -> als je iets te vragen of te melden hebt, doe het op het forum, zodat anderen er ook wat aan hebben.


Re: Improved Satfinder #16 pingflood

  • Member
  • 23 posts

+3
Neutral

Posted 8 February 2013 - 18:38

I have applied the patch on my own box, I must say, it works quite well. If you have more than one tuner, you can indeed scan using another tuner now and the current service remains active.


Glad to know it's working with two tuners. I have only one tuner for stb over here, and I've tested it using vtuner. I was afraid it could have problems with more than one tuner physically attached.

Just two little remarks:
- I think there should be a little text somewhere mentioning that pressing OK will start a scan


It is present on the skin mod I've proposed on the first post.
Check the screenshot (I know the text is in portuguese, but is easy to find: is the text on the bottom :P ).


- when you actually start the scan, the current service is stopped, this might be a limitation of the scan component, I don't know.


Maybe it is related with the self.frontend = None and del self.raw_channel. I had to use like this in order to make ScanSetup works. So far, I couldn't find another way to make it work without messing with ScanSetup (something I really don't want to do). The way ScanSetup is coded make it hard even to monkeypatch it.

But maybe with further inspection I can figure some workaround to do this..

Best regards

Re: Improved Satfinder #17 pingflood

  • Member
  • 23 posts

+3
Neutral

Posted 8 February 2013 - 18:42

Only in the plugin SimpleSatScan there is a bug, closing plugin can cause crash.
The reason is very short interval poll.
This is a warning, your code may be similar problems.

update_interval = 100


Well, that's from the original Satfinder, and since it is working from the beginning, I'll not mess with it.
If this causes any bug, then we should inspect why and try to fix it.

Regards

Re: Improved Satfinder #18 Erik Slagter

  • PLi® Core member
  • 46,951 posts

+541
Excellent

Posted 8 February 2013 - 18:55

I've never seen problems with it, it may be related to certain hardware/drivers. It's not something to be worked around in a piece of generic code.

* Wavefrontier T90 with 28E/23E/19E/13E via SCR switches 2 x 2 x 6 user bands
I don't read PM -> if you have something to ask or to report, do it in the forum so others can benefit. I don't take freelance jobs.
Ik lees geen PM -> als je iets te vragen of te melden hebt, doe het op het forum, zodat anderen er ook wat aan hebben.


Re: Improved Satfinder #19 Erik Slagter

  • PLi® Core member
  • 46,951 posts

+541
Excellent

Posted 8 February 2013 - 21:45


Just two little remarks:
- I think there should be a little text somewhere mentioning that pressing OK will start a scan


It is present on the skin mod I've proposed on the first post.
Check the screenshot (I know the text is in portuguese, but is easy to find: is the text on the bottom :P ).


We'd like it to work on boxes that don't have special skin extensions. It shouldn't be too hard I think, to add a green button called something like "scan" and bind the OK button to it, can you do that?

* Wavefrontier T90 with 28E/23E/19E/13E via SCR switches 2 x 2 x 6 user bands
I don't read PM -> if you have something to ask or to report, do it in the forum so others can benefit. I don't take freelance jobs.
Ik lees geen PM -> als je iets te vragen of te melden hebt, doe het op het forum, zodat anderen er ook wat aan hebben.


Re: Improved Satfinder #20 pingflood

  • Member
  • 23 posts

+3
Neutral

Posted 9 February 2013 - 00:05

We'd like it to work on boxes that don't have special skin extensions. It shouldn't be too hard I think, to add a green button called something like "scan" and bind the OK button to it, can you do that?


Well, I can't change the skin on on the fly, adding or moving any of the widgets (I wish I could..), unleast I was creating a new screen embeded on the plugin. But I don't think it is a good idea, because this isn't really necessary.

I haven't added anything new to the skin, I just moved and tweaked the position, color and size of the widgets.
As it is, it should work even with classic default skin, since it doesn't use any skin extension (try it with default skin and you will understand better what I mean). Have in mind that the proposed skin changes and the scan patch works independently one of another.

Since you don't want to patch the current PLi-HD skin with the revamped version (as you really don't need to), you just need to "unhide" the introduction widget in that screen.

Change it from (on your current skin, at satfinder screen)
<widget name="introduction" position="0,0" size="0,0" />

To the desired size and position. E.g., like the one used on my proposed skin:

<widget name="introduction" position="145,643" size="1000,26" zPosition="1" font="Regular;20" halign="center" />

I can't see any easier way to achieve this without cluttering with unecessary workarounds.

And if you think is better to have a colored button on the screen besides using the default "press ok to scan" message, then we will need to add a new widget to the skin, and this will certainly cause problems to other skins that aren't updated to reflect this change.

As it is, if you don't update the skin or uses a skin with the "introduction" widget hidden, the only thing that will happen is that you will not see the message "press ok to scan".

I hope I could made what I mean clear.. Since English isn't my primary language, I know I make a lot of mistakes and sometimes is hard to clearly explain what I mean.. :P

Best regards



Also tagged with one or more of these keywords: satfinder

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users