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.lRepeatableSequenceLength):
' 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... :-(