Jump to content


Photo

%f ,%d phyton code


  • Please log in to reply
33 replies to this topic

Re: %f ,%d phyton code #21 jpuigs

  • Senior Member
  • 1,143 posts

+32
Good

Posted 30 September 2014 - 23:14

Thanks for the answer!

Is it possible to remove "auto" mode? From wich files? My utopia :)

When we go to the main channel list (by typing down arrow) the widget show 0 Mhz. Could you delete?

 

To remove 0 Mhz. try this one:  Attached File  ServiceName2.py   22.71KB   16 downloads


Edited by jpuigs, 30 September 2014 - 23:17.

Enigma is getting old....

 

Spoiler

Re: %f ,%d phyton code #22 littlesat

  • PLi® Core member
  • 57,120 posts

+698
Excellent

Posted 1 October 2014 - 09:09

The issue with the auto auto auto is that you cannot get these parameters the tuner is not tuned... So I should consider not to display this in such detail... To remove auto from lamedb is not a good idea as when done you offer you auto capebilities of your tuner.

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


Re: %f ,%d phyton code #23 dax

  • Senior Member
  • 228 posts

0
Neutral

Posted 1 October 2014 - 12:21

 

To remove 0 Mhz. try this one:  attachicon.gifServiceName2.py

 

 

Thanks, it works! I' ve made by myself a little cosmetics: 'MHz' instead of 'Mhz.' and 'H/V' instead of 'Hor./Vert.'

 

The issue with the auto auto auto is that you cannot get these parameters the tuner is not tuned... So I should consider not to display this in such detail... To remove auto from lamedb is not a good idea as when done you offer you auto capebilities of your tuner.

Thanks. I think the "issue" is before, when i (you, all) do a scan: the terrestrial.xml file is not "advised" for each possible combination of parameters so this cause the lamedb file with auto auto auto.

<!-- transponder parameters:
    bandwidth: 0 = 8 MHz, 1 = 7 MHz, 2 = 6 MHz, 3 = Auto (unsupported, default)
    constellation: 0 = QPSK, 1 = 16-QAM (default), 2 = 64-QAM, 3 = Auto
    code_rate_{lp,hp}: 0 = 1/2, 1 = 2/3, 2 = 3/4, 3 = 5/6, 4 = 7/8, 5 = Auto (default), 6 = None
    guard_interval: 0 = 1/32, 1 = 1/16, 2 = 1/8, 3 = 1/4, 4 = Auto (default)
    transmission_mode: 0 = 2K, 1 = 8K, 2 = Auto (default)
    hierarchy_information: 0 = None, 1 = 1, 2 = 2, 3 = 4, 4 = Auto (default)
    inversion: 0 = Off, 1 = On, 2 = Auto (default)
-->
<terrestrial name="Europe, Middle East, Africa: DVB-T Frequencies" flags="5">
		<transponder centre_frequency="474000000" bandwidth="0" constellation="3"/>

If i'm wrong please correct me, otherwise, if i'm right, i can make a terrestrial.xml file that contains every combinations of bandwidth, fec, etc for each frequency like

<transponder centre_frequency="474000000" bandwidth="0" constellation="0" code_rate_hp="0" transmission_mode="0"/>

Probabily this involve a very low scan process...

So my simply question is: is it possible to educate enigma to show the detailed parameters for tuned dtt channels?

Sorry for my possible nonsense , broadcast is my job but i'm not skilling about coding :)
 



Re: %f ,%d phyton code #24 jpuigs

  • Senior Member
  • 1,143 posts

+32
Good

Posted 1 October 2014 - 18:58

Under the channel selector isn't a good idea.... possibly when a better place could be found it can be considered...

 

Why ?

I've reduced list size to have enough space to place it.

Where would you place it ?


Enigma is getting old....

 

Spoiler

Re: %f ,%d phyton code #25 littlesat

  • PLi® Core member
  • 57,120 posts

+698
Excellent

Posted 1 October 2014 - 19:00

Because I switched to PLi-HD-fullnight skin... exactly 20 services in the list... and the place is not good... my meaning... and I would recommend when adapted not to put to many details in it...


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


Re: %f ,%d phyton code #26 jpuigs

  • Senior Member
  • 1,143 posts

+32
Good

Posted 1 October 2014 - 19:09

So you don't want to lose 20 services height list ?

It's then difficult to adapt it....


Enigma is getting old....

 

Spoiler

Re: %f ,%d phyton code #27 littlesat

  • PLi® Core member
  • 57,120 posts

+698
Excellent

Posted 1 October 2014 - 19:15

When I have time I can find a method...


Edited by littlesat, 1 October 2014 - 19:16.

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


Re: %f ,%d phyton code #28 jpuigs

  • Senior Member
  • 1,143 posts

+32
Good

Posted 2 October 2014 - 00:52

Do you like it in that way ?  (Channel list font reduced, but still 20 services height)

 

PLi-HD-fullnight skin

 

Attached File  pli-hd-full-chlist.jpg   79.11KB   4 downloads


Edited by jpuigs, 2 October 2014 - 00:54.

Enigma is getting old....

 

Spoiler

Re: %f ,%d phyton code #29 littlesat

  • PLi® Core member
  • 57,120 posts

+698
Excellent

Posted 2 October 2014 - 19:27

Just a quick an dirty suggestion from my side..... 

 

1. remove dvb-t/stream/dvb-c/sat location...

 

2. Move the info a bit closer to eachother to make some space below the next EPG info...

 

Attached Files


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


Re: %f ,%d phyton code #30 jpuigs

  • Senior Member
  • 1,143 posts

+32
Good

Posted 2 October 2014 - 23:32

Channel list size, back to default values.

 

Info located where you've suggested.

I prefer not to remove dvb-t/s/s2/c/.... because if you have mixed fav. lists, it may be helpfull.

Everybody may edit py file to suit their needs.

 

 

Extended event description fixed.

<convert type="EventName">FullDescription</convert>

doesn't work on my box.  If i change to

<convert type="EventName">ExtendedDescription</convert>

It works.

 

Attached File  pli-hd-full-chlist2.jpg   122.67KB   4 downloads


Edited by jpuigs, 2 October 2014 - 23:33.

Enigma is getting old....

 

Spoiler

Re: %f ,%d phyton code #31 tension

  • Senior Member
  • 119 posts

+4
Neutral

Posted 2 November 2014 - 23:18

Tp info in channel selector, useful for checking services in userbouquets.... Perhaps better as a configurable gui option, even if needs enigma restart to take completely effect

(channel selector height reduction).

 

shot2.jpg

 

shot1.jpg

 

skin PLi HD:

--- ~/usr/share/enigma2/PLi-HD/skin.xml
+++ ~/usr/share/enigma2/PLi-HD/skin.xml
@@ -256,6 +256,15 @@
       <convert type="EventName">FullDescription</convert>
     </widget>
     <widget source="ServiceEvent" render="NextEpgInfo" position="85,590" size="435,26" transparent="1" foregroundColor="secondFG" noWrap="1" font="Regular;22"/>
+    <widget source="ServiceEvent" render="Label" position="550,585" size="620,26" transparent="1" foregroundColor="green" backgroundColor="secondBG" noWrap="1" font="Regular;24" borderWidth="2" zPosition="1">
+      <convert type="TransponderInfo"/>
+    </widget>
+	<applet type="onLayoutFinish">
+from enigma import eSize
+from Components.config import config
+if config.usage.tspinfo_in_channelselection.value:
+	self[&quot;list&quot;].instance.resize(eSize(690, 450))
+	</applet> 
   </screen>
 
   <!-- Slim Channel Selection - I still not found were this is used -->

transponder info converter:

From b91239f422ad43f5cf1d452ce15005e6a25f6d7b Mon Sep 17 00:00:00 2001
From: tension <tension9000@yahoo.it>
Date: Wed, 15 Oct 2014 14:42:47 +0200
Subject: [PATCH 3/4] Add label for transponderparameters info in channel
 selector

Add label for transponderparameters info in channel selector
---
 lib/python/Components/Converter/Makefile.am        |  2 +-
 lib/python/Components/Converter/TransponderInfo.py | 79 ++++++++++++++++++++++
 2 files changed, 80 insertions(+), 1 deletion(-)
 create mode 100644 lib/python/Components/Converter/TransponderInfo.py

diff --git a/lib/python/Components/Converter/Makefile.am b/lib/python/Components/Converter/Makefile.am
index be73645..ed21a87 100644
--- a/lib/python/Components/Converter/Makefile.am
+++ b/lib/python/Components/Converter/Makefile.am
@@ -5,6 +5,6 @@ install_PYTHON = \
 	Poll.py RemainingToText.py StringList.py ServiceName.py FrontendInfo.py ServiceInfo.py \
 	ConditionalShowHide.py ServicePosition.py ValueRange.py RdsInfo.py Streaming.py \
 	StaticMultiList.py ServiceTime.py MovieInfo.py MenuEntryCompare.py StringListSelection.py \
-	ServiceOrbitalPosition.py CryptoInfo.py TextCase.py \
+	ServiceOrbitalPosition.py TransponderInfo.py CryptoInfo.py TextCase.py \
 	ValueBitTest.py TunerInfo.py ConfigEntryTest.py TemplatedMultiContent.py ProgressToText.py \
 	Combine.py SensorToText.py ValueToPixmap.py PliExtraInfo.py genre.py ChannelNumbers.py
diff --git a/lib/python/Components/Converter/TransponderInfo.py b/lib/python/Components/Converter/TransponderInfo.py
new file mode 100644
index 0000000..845ee24
--- /dev/null
+++ b/lib/python/Components/Converter/TransponderInfo.py
@@ -0,0 +1,79 @@
+# -*- coding: utf-8 -*-
+from Components.Converter.Converter import Converter
+from enigma import iServiceInformation, iPlayableService, iPlayableServicePtr, eServiceCenter
+from ServiceReference import resolveAlternate
+from Tools.Transponder import ConvertToHumanReadable
+
+from Components.Element import cached
+
+def addSeparator(pdata, pname, sep="  "):
+	if pdata:
+		return pdata + sep
+	else:
+		return pname + ": N/A" + sep
+
+class TransponderInfo(Converter, object):
+
+	def __init__(self, type):
+		Converter.__init__(self, type)
+
+	@cached
+	def getText(self):
+		service = self.source.service
+		if isinstance(service, iPlayableServicePtr):
+			info = service and service.info()
+			ref = None
+		else: # reference
+			info = service and self.source.info
+			ref = service
+		if not info:
+			return ""
+		if ref:
+			nref = resolveAlternate(ref)
+			if nref:
+				ref = nref
+				info = eServiceCenter.getInstance().info(ref)
+			transponder_info = info.getInfoObject(ref, iServiceInformation.sTransponderData)
+		else:
+			transponder_info = info.getInfoObject(iServiceInformation.sTransponderData)
+
+		if transponder_info:
+			tunerType = transponder_info["tuner_type"]
+			tpinfo = ConvertToHumanReadable(transponder_info, tunerType)
+			if tunerType == "DVB-T":
+				return addSeparator(tpinfo["system"], "DVB system") + addSeparator("%.1f" % ((transponder_info["frequency"] +500) / 1000000.), "Fr", "/") \
+					+ addSeparator(tpinfo["bandwidth"], "Bw") + addSeparator(tpinfo["constellation"], "Cn") \
+					+ addSeparator(tpinfo["code_rate_lp"], "CrL", "-") + addSeparator(tpinfo["code_rate_hp"], "CrH")
+# other parameters available, but without tuner sint we get only "Auto" value, as for constellation and coderates
+#				transmission = tpinfo["transmission_mode"]
+#				guard = tpinfo["guard_interval"]			
+# 				hierarchy = tpinfo["hierarchy_information"]
+			else:
+				if tunerType == "DVB-S":
+					pos = int(transponder_info["orbital_position"])
+					direction = "E"
+					if pos > 1800:
+						pos = 3600 - pos
+						direction = "W"
+					return addSeparator(tpinfo["system"], "DVB system") + addSeparator("%d.%d%s" % (pos/10, pos%10, direction), "Orb") \
+						+ addSeparator(tpinfo["modulation"], "Mod") + addSeparator(str(int(transponder_info["frequency"] / 1000)), "Fr", " ") \
+						+ addSeparator(tpinfo["polarization_abbreviation"], "Pol") + addSeparator(str(int(transponder_info["symbol_rate"] / 1000)), "Sr") \
+						+ addSeparator(tpinfo["fec_inner"], "Fec")
+				elif tunerType == "DVB-C":
+					return addSeparator(tpinfo["system"], "DVB system") + addSeparator(tpinfo["modulation"], "Mod") \
+					+ addSeparator("%.1f" % ((transponder_info["frequency"] +500) / 1000000.), "Fr") \
+					+ addSeparator(tpinfo["fec_inner"], "Fec") + addSeparator(tpinfo["inversion"], "Inv")
+
+		if ref:
+			refString = ref.toString().lower()
+			if "%3a//" in refString:
+				return _("Stream")
+			if refString.startswith("1:134:"):
+				return _("Alternative")
+		return ""
+
+	text = property(getText)
+
+	def changed(self, what):
+		if what[0] != self.CHANGED_SPECIFIC or what[1] in [iPlayableService.evStart]:
+			Converter.changed(self, what)
-- 
1.9.1

user config control:

From 44ec0a6354e38ca01f5b02524f68a94a072e680a Mon Sep 17 00:00:00 2001
From: tension <tension9000@yahoo.it>
Date: Fri, 17 Oct 2014 15:00:40 +0200
Subject: [PATCH 4/4] Make channel selection tpinfo configurable option

Make channel selection tpinfo configurable option.
Select this option in user interface screen.
---
 data/setup.xml                                     | 1 +
 lib/python/Components/Converter/TransponderInfo.py | 3 +++
 lib/python/Components/UsageConfig.py               | 1 +
 3 files changed, 5 insertions(+)

diff --git a/data/setup.xml b/data/setup.xml
index b195a94..7102524 100644
--- a/data/setup.xml
+++ b/data/setup.xml
@@ -48,6 +48,7 @@
 		<item level="2" text="Enable OK for channel selection" description="When enabled you get the channel selection list via the OK button, the infobar toggle is then transfered to exit button">config.usage.ok_is_channelselection</item>
 		<item level="2" text="Enable volume control with arrow buttons" description="When enabled you can control the volume with the arrow buttons instead of getting the channel selection list">config.usage.volume_instead_of_channelselection</item>
 		<item level="2" text="Enable OK as preview in channel selection" description="When enabled then when you select a new channel in the channel selection the channel selection will not close. It will only close when you select the current playing service. This is a kind of preview mode">config.usage.channelselection_preview</item>
+		<item level="2" text="View transponder info in channel selection" description="When enabled then when you change channel in the channel selection a label shows channel transponder parameters">config.usage.tspinfo_in_channelselection</item>
 		<item level="1" text="Change bouquets in quickzap" description="When enabled, continue to the next bouquet when the last channel of the current bouquet is reached while changing channels.">config.usage.quickzap_bouquet_change</item>
 		<item level="1" text="Hide channel list in radio mode" description="When enabled, the channel selection list will be hidden while listening to a radio channel">config.usage.e1like_radio_mode</item>
 		<item level="1" text="Action on long powerbutton press" description="Configure the function of a long press on the power button.">config.usage.on_long_powerpress</item>
diff --git a/lib/python/Components/Converter/TransponderInfo.py b/lib/python/Components/Converter/TransponderInfo.py
index 845ee24..461c6cc 100644
--- a/lib/python/Components/Converter/TransponderInfo.py
+++ b/lib/python/Components/Converter/TransponderInfo.py
@@ -2,6 +2,7 @@
 from Components.Converter.Converter import Converter
 from enigma import iServiceInformation, iPlayableService, iPlayableServicePtr, eServiceCenter
 from ServiceReference import resolveAlternate
+from Components.config import config
 from Tools.Transponder import ConvertToHumanReadable
 
 from Components.Element import cached
@@ -19,6 +20,8 @@ class TransponderInfo(Converter, object):
 
 	@cached
 	def getText(self):
+		if not config.usage.tspinfo_in_channelselection.value:
+			return ""
 		service = self.source.service
 		if isinstance(service, iPlayableServicePtr):
 			info = service and service.info()
diff --git a/lib/python/Components/UsageConfig.py b/lib/python/Components/UsageConfig.py
index 99fabeb..60a04f5 100644
--- a/lib/python/Components/UsageConfig.py
+++ b/lib/python/Components/UsageConfig.py
@@ -63,6 +63,7 @@ def InitUsageConfig():
 	config.usage.ok_is_channelselection = ConfigYesNo(default = False)
 	config.usage.volume_instead_of_channelselection = ConfigYesNo(default = False)
 	config.usage.channelselection_preview = ConfigYesNo(default = False)
+	config.usage.tspinfo_in_channelselection = ConfigYesNo(default = False)
 	config.usage.show_spinner = ConfigYesNo(default = True)
 	config.usage.enable_tt_caching = ConfigYesNo(default = True)
 	choicelist = []
-- 
1.9.1



Re: %f ,%d phyton code #32 littlesat

  • PLi® Core member
  • 57,120 posts

+698
Excellent

Posted 3 November 2014 - 18:01

Isn't it better to find a more proper location for this info instead for adding a config and do some resizing in the skin?


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


Re: %f ,%d phyton code #33 jpuigs

  • Senior Member
  • 1,143 posts

+32
Good

Posted 4 November 2014 - 19:35

on message #30 I made a screenshot with another location....

Nobody said anything...


Enigma is getting old....

 

Spoiler

Re: %f ,%d phyton code #34 tension

  • Senior Member
  • 119 posts

+4
Neutral

Posted 4 November 2014 - 20:07

Isn't it better to find a more proper location for this info instead for adding a config and do some resizing in the skin?

 

 

on message #30 I made a screenshot with another location....

Nobody said anything...

 

Of course, but I only sporadically use this info, when I add new userbouquets or change settings. So the chance to have it displayed only when used, is clearly convenient.

Ever displayed, is redundant info for me. In that location the check with the selchanged channel it's more immediate for the view facility. Anyway a few skin changes and not

apply third patch, and the config control is lost. Ola Littlesat.


Edited by tension, 4 November 2014 - 20:09.



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users