Page 1 of 1

RM fails to open KM file

Posted: Mon Sep 25, 2006 4:28 pm
by pH7_jp1
I am having a problem using RM 1.68, RDFs1.25. I can't open any KM .txt file. This zip file: https://www.hifi-remote.com/forums/dload ... le_id=3625 contains one example, but I fail with any of my KM files. The zip file contains the KM file and the rmaster.err file.

Posted: Mon Sep 25, 2006 5:15 pm
by jetskier
I tried to import your KM and some of my old ones save with KM 9.05 and got the same error message. It appears that the import function in RM is broke for files created with KM 9.05. I'm sure Greg will spot this and be able to fix RM accordingly. I opened my old files created with 7.35 from years ago and they worked.

Posted: Mon Sep 25, 2006 5:38 pm
by jetskier
If you open your KM file, the error is in the line

Code: Select all

fFunctions,fNo,fByte2,bButtons,bFunctions,fNotes,Device Combiner,,kFunctions,kBoundDev,kBoundKey,kShift,b$Functions
if you replace it with:

Code: Select all

fFunctions,fEFC,fByte2,bButtons,bFunctions,fNotes,Device Combiner,,kmFunctions,kBoundDev,kBoundKey,kShift,b$-Functions
It imports to RM.

THIS CHANGE IS NOT BACKWARDS COMPATIBLE WITH KM. You'll have to replace that line with the original code to open in KM.

RM needs to be updated for the changes in the functions import (fNo in place of fEFC) with this version of KM. This should get you going until Greg has time to fix.

Posted: Mon Sep 25, 2006 5:53 pm
by gfb107
Looks like there's been a change to the format of saved KM files in v9.05.
This new format isn't consistent with RM's code for importing KM files.
I'll see if I can find the time to make the appropriate changes to RM.

Posted: Mon Sep 25, 2006 5:56 pm
by gfb107
jetskier wrote:RM needs to be updated for the changes in the functions import (fNo in place of fEFC) with this version of KM. This should get you going until Greg has time to fix.
It could be argued that the fix should be made to KM, not RM.

Posted: Mon Sep 25, 2006 5:59 pm
by jetskier
It could be argued that the fix should be made to KM, not RM.
I know. I should have clarified. :)

"Mark needs to tell Greg he changed the file format before releasing a new KM version." :eek:

Thanks

Posted: Mon Sep 25, 2006 6:46 pm
by pH7_jp1
Thanks for the help guys. I really just wanted to migrate this device to RM from KM, to support the COM/SKIP button. Since this would be one way, one time, the workaround will get me going for now. Thanks again.

Posted: Mon Sep 25, 2006 7:51 pm
by mr_d_p_gumby
gfb107 wrote:
jetskier wrote:RM needs to be updated for the changes in the functions import (fNo in place of fEFC) with this version of KM. This should get you going until Greg has time to fix.
It could be argued that the fix should be made to KM, not RM.
Looks like we missed that one in the process of adding the EFC5 coding. The "fNo" is just plain wrong. It should have been one of the following:
fOBC
fEFC3
fEFC5

KM does not actually use that info from the saved file. One possible way around this is for RM to also not use that info. If you look at the 4th row in the saved KM file (row with the setup code), you'll see one item that is either OBC or EFC. That could be used to determine the nature of the codes in the codes column.

Note that "fNo" will sometimes be seen as "fYes". It is accidentally indicating the setting of the Using Extender option on the Setup sheet. I will fix this in the next release of KM.

Posted: Mon Sep 25, 2006 8:07 pm
by gfb107
RM already uses the function type in the 4th row.

During parsing of the KM file, RM has to figure out when it has reached the actual function definitions and button assignments. RM does this by building a couple of search strings that it compares against the beginning of the line.

For upgrades that use OBCs, it used "fFunctions,fOBC," and "Functions,OBC,".
For upgrades that use EFCs, it used "fFunctions,fEFC," and "Functions,EFC,".

This was necessary to support different versions of KM files, without actually coding for specific KM versions.

To fix this, I was going to add a third string "fFunctions,fNo,", but it sounds like I should also add "fFunctions,fYes,".

Or do you have a better way to determine when I have reached the function definitions?

Posted: Mon Sep 25, 2006 11:53 pm
by mr_d_p_gumby
I guess you'd have to have both fNo and fYes in order to work with KM v9.05 files. I have changed it back to fOBC and fEFC for the next version (not quite ready to release yet). You can check the row 4 item to determine if the codes are EFC3 or EFC5, though it'll probably be obvious when you load the actual codes.

The only other thing I can think of would be if you can wildcard that part of the search, and just match the rest of the line. That would still be a reliable way to recognize the function definitions.

(Sorry for causing you the extra work.) :oops:

Posted: Tue Sep 26, 2006 8:00 am
by gfb107
Not a problem. I'll change the code so that it matches part of the line after the fOBC, fEFC, fNO, or fYes,