Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: webcams σε μπουκετο η μεσω plugin

  1. #11
    deepbluesky's Avatar
    Join Date
    May 2013
    Location
    Stuttgart (48.79N/9.19E)
    Age
    49
    Posts
    460
    Rep Power
    0

    Απ: webcams σε μπουκετο η μεσω plugin

    Προφανως καπου κανω κατι λαθος διοτι δεν μου το εμφανιζει.

    Καταρχην εφτιαξα φακελο /usr/lib/enigma2/python/Plugins/Extensions/PictureCamera οχι με mkdir αλλα μεσω ftp του Total Commander αλλα αυτο δεν εχει καμια σημασια.
    Δημιουργησα επισης το 0 byte αρχειο __init__.pyo καθως ολα τα υπολοιπα Extensions στο OpenATV τετοιο εχουν και κανενα __init__.py.
    Επειτα πηρα τον κωδικα οπως τον εφτιαξες και το αποθηκευσα σε αρχειο με ονομα PictureCamera.pyo εντος του φακελου του plugin.
    Τελος εκανα reboot ομως μπαινοντας στα Plugins μου εμφανιζει το εξης:



    Δηλαδη απ' οτι καταλαβαινω το OpenATV 5.3 δεν βρησκει το plugin η κατι δεν του αρεσει ομως τι;

    Επειδη ειναι η 1η φορα που ασχολουμαι μ' αυτο το θεμα ζητω την κατανοηση σας.

  2. #12

    athoik's Avatar
    Join Date
    Sep 2012
    Location
    Earth
    Posts
    10,759
    Rep Power
    5927763

    Απ: webcams σε μπουκετο η μεσω plugin

    Βάλε τα py αρχεία, τα pyo δημιουργουνται από τα py.

    O λόγος που δεν υπάρχουν τα py γενικότερα στα image, ειναι για τον χώρο.

    Επίσης μπορεί να χρειαστείς το πακέτο python-requests (opkg install ..)
    Member SatDreamGr Projects

    Wavefield T90: 0.8W - 1.9E - 4.8E - 13E - 16E - 19.2E - 23E - 26E - 33E - 39E - 42E - 45E on EMP Centauri DiseqC 16/1
    Unamed: 13E Quattro - 9E Quattro on IKUSI MS-0916

  3. #13
    deepbluesky's Avatar
    Join Date
    May 2013
    Location
    Stuttgart (48.79N/9.19E)
    Age
    49
    Posts
    460
    Rep Power
    0

    Απ: webcams σε μπουκετο η μεσω plugin

    Ωραια τωρα μου ξεκιναει το plugin χωρις σφαλμα (χωρις να εγκαταστησω το python-requests) και δειχνει την εικονα αλλα ως εκει. Με Exit δεν μπορω να βγω. Μαλλον λειπει ο κωδικας.
    Επομενως η μονη λυση να βγω ειναι μεσω telnet init 2 και init 3.
    Πως μπορει να λυθει αυτο;

  4. #14

    athoik's Avatar
    Join Date
    Sep 2012
    Location
    Earth
    Posts
    10,759
    Rep Power
    5927763

    Απ: webcams σε μπουκετο η μεσω plugin

    Κοίτα εδώ το self.close: https://github.com/athoik/GreekStrea.../plugin.py#L63
    Member SatDreamGr Projects

    Wavefield T90: 0.8W - 1.9E - 4.8E - 13E - 16E - 19.2E - 23E - 26E - 33E - 39E - 42E - 45E on EMP Centauri DiseqC 16/1
    Unamed: 13E Quattro - 9E Quattro on IKUSI MS-0916

  5. #15

    devilcosta's Avatar
    Join Date
    Dec 2010
    Location
    Εδώ
    Posts
    9,710
    Rep Power
    2556267

    Απ: webcams σε μπουκετο η μεσω plugin

    Δοκίμασε με αυτό να βγαίνεις σαν αρχή με exit και μετά προσθέτεις και αλλα κουμπιά


    Code:
    import os
    import requests
    # Plugin definition
    from Screens.Screen import Screen
    from Plugins.Plugin import PluginDescriptor
    from enigma import ePicLoad, eTimer
    from Components.AVSwitch import AVSwitch
    from Components.Label import Label
    from Components.Pixmap import Pixmap
    from Screens.Screen import Screen
    from Tools.BoundFunction import boundFunction
    from Components.MenuList import MenuList
    from Components.ActionMap import ActionMap, NumberActionMap
    
    class PictureCameraStart(Screen):
    	skin = """<screen position="center,center" size="800,600">
    			<widget name="title" position="10,0" size="790,60" halign="center" font="Regular;24" />
    			<widget name="menu" position="10,60" size="790,530" halign="center" transparent="1" alphatest="on" />		
    		</screen>"""
    
    	def __init__(self, session):
    		Screen.__init__(self, session)
    		self.session = session		
    		self['title'] = Label("TEST PIC")
    		menu = []
    		menu.append((_("TEST "),"pic1"))		
            	self["menu"] = MenuList(menu)
            	self["actions"] = ActionMap(["WizardActions", "DirectionActions"],{"ok": self.go,"back": self.close,}, -1)		
    		
        	def go(self):
        		if self["menu"].l.getCurrentSelection() is not None:
            		choice = self["menu"].l.getCurrentSelection()[1]
    			if choice == "pic1":
    				self.session.open(PictureCamera)
    
    class PictureCamera(Screen):
    	skin = """<screen position="center,center" size="800,600">
    			<widget name="title" position="10,0" size="790,60" halign="center" font="Regular;24" />
    			<widget name="pic" position="10,60" size="790,530" halign="center" transparent="1" alphatest="on" />			
    		</screen>"""
    
    	def __init__(self, session):
    		Screen.__init__(self, session)
    		self.session = session		
    		self['pic'] = Pixmap()
    		self['title'] = Label("TEST PIC")
    		self.cameraTimer = eTimer()
    		self.cameraTimer.timeout.callback.append(self.download)
    		self.cameraTimer.start(1)
    		self["actions"] = ActionMap(["WizardActions", "DirectionActions"],{"back": self.close,}, -1)		
    
    	def download(self):
    		print "[Camera] download"
    		self.cameraTimer.stop()
    		r = requests.get("http://www.meteovolos.gr/skiathos.jpg")
    		if r.status_code == 200:
    			open("/tmp/camera.jpg", "wb").write(r.content)
    			self.downloadFinished(None)
    
    	def downloadFinished(self, result):
    		image = '/tmp/camera.jpg'
    		if os.path.exists(image):
    			sc = AVSwitch().getFramebufferScale()
    			self.picloads = ePicLoad()
    			self.picloads.PictureData.get().append(self.FinishDecode)
    			self.picloads.setPara((
    				self['pic'].instance.size().width(),
    				self['pic'].instance.size().height(),
    				sc[0], sc[1], False, 1, '#00000000'))
    			self.picloads.startDecode(image)
    			self.cameraTimer.start(60*1000)
    
    	def FinishDecode(self, picInfo = None):
    		ptr = self.picloads.getData()
    		if ptr:
    			self["pic"].instance.setPixmap(ptr.__deref__())
    			del self.picloads
    			os.remove('/tmp/camera.jpg')
    
    def main(session,**kwargs):
        try:
         	session.open(PictureCameraStart)
        except:
            print "[Picture Camera] Pluginexecution failed"
    
    def Plugins(**kwargs):
    	return [PluginDescriptor(name=_("Picture Camera"),
    		description=_("Picture Camera"),
    		icon="picam.png",
    		where=PluginDescriptor.WHERE_PLUGINMENU,
    		fnc=main)]
    Member SatDreamGr Projects.
    ....................................
    Orbital Position = 5W - 3E - 9E - 13E - 19E.
    ....................................
    Satellite Receivers = Edision OS Mio 4K -- Edision OS Nino+ -- Edision OS Mini -- Edision OS Mega -- Medi@link IXUSS ZERO -- Dm 7020HD -- Vu+ Solo 2 -- Octagon SF4008 Triple 4K.
    ....................................
    Module = CI+ Fransat.
    ....................................
    Tuner Card = TBS5925.
    ....................................
    Images = SatDreamGr.

  6. #16

    devilcosta's Avatar
    Join Date
    Dec 2010
    Location
    Εδώ
    Posts
    9,710
    Rep Power
    2556267

    Απ: webcams σε μπουκετο η μεσω plugin

    Member SatDreamGr Projects.
    ....................................
    Orbital Position = 5W - 3E - 9E - 13E - 19E.
    ....................................
    Satellite Receivers = Edision OS Mio 4K -- Edision OS Nino+ -- Edision OS Mini -- Edision OS Mega -- Medi@link IXUSS ZERO -- Dm 7020HD -- Vu+ Solo 2 -- Octagon SF4008 Triple 4K.
    ....................................
    Module = CI+ Fransat.
    ....................................
    Tuner Card = TBS5925.
    ....................................
    Images = SatDreamGr.

Page 2 of 2 FirstFirst 12

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 21
    Last Post: 15-06-20, 18:49
  2. VU+Plugin MSN weather service opensource plugin
    By mehmetkarahanlı in forum Enigma2 Plugins ΟΕ 2.0
    Replies: 0
    Last Post: 08-06-18, 17:48

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •