« Return to Thread: New tool for converting pronto hex codes to lircd.conf

RE: New tool for converting pronto hex codes to lircd.conf

by Olavi Akerman :: Rate this Message:

Reply to Author | View in Thread


Hello

AnalyzeCodes separates the header (first 4 ) and the main pulsesequences
from pronto codes for
futher processing.

CreatePulses converts the pronto type pulse lenghts (which have relative
lengths depending on the IR carrier defined in pronto header) to values
which contains the pulse lengths in microseconds.

To fully understand the logic of calculation I recommend reading up on the
pronto format. For example: http://majority.110mb.com/files/pronto.pdf or
from www.remotecentral.com.

Python tutorial is at http://docs.python.org/tut/tut.html.

Olavi
-----Original Message-----
From: lirc-list-bounces@...
[mailto:lirc-list-bounces@...] On Behalf Of cassioli
Sent: Monday, June 09, 2008 7:58 PM
To: lirc-list@...
Subject: Re: New tool for converting pronto hex codes to lircd.conf


I started porting to RapidQ.
It was quite strightforward, but I need some help as I don't know Python
very well.
What do these functions do?

sub CreatePulses(sItems as string)
'        dPulseWidths=[]               # Table of Pulse widths. Length is
repsented in microseconds
'        for i in sItems:
'            self.dPulseWidths.append(1000000*long(i,16)/self.dIRFrequency)
# Convert pulse widths to uS

'        if
len(self.dPulseWidths)<>2*(self.lOnceSequenceLength+self.lRepeatableSequence
Length):
'            raise "Number of actual codes does not match the header
information!"
end sub

function AnalyzeCode(sCodeName as string , sHexCodes as string) as string
'        sHexTable=sHexCodes.split()
'        sCodeName=sCodeName.rstrip()  # Name of the Code associated with
code sequence
'        self.ProcessPreamble(sHexTable[:4]) # First four sequences make up
Preamble
'        self.CreatePulses(sHexTable[4:])    # The rest are OnceSequence +
RepeatableSequence
'        return self.dPulseWidths[-1]        # Final gap=last off signal
length
end function

I don't know how lists, tables and arrays work in python... :-(
--
View this message in context:
http://www.nabble.com/New-tool-for-converting-pronto-hex-codes-to-lircd.conf
-tp17161702p17737188.html
Sent from the LIRC mailing list archive at Nabble.com.


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php

 « Return to Thread: New tool for converting pronto hex codes to lircd.conf