JP1 Remotes Forum Index JP1 Remotes


FAQFAQ SearchSearch 7 days of topics7 Days MemberlistMemberlist UsergroupsUsergroups RegisterRegister
ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in

RM/RMIR v2.09 available
Goto page Previous  1, 2
 
Post new topic   Reply to topic    JP1 Remotes Forum Index -> JP1 - Software
View previous topic :: View next topic  
Author Message
Barf
Expert


Joined: 24 Oct 2008
Posts: 1402
Location: Munich, Germany

                    
PostPosted: Wed Mar 18, 2020 9:09 am    Post subject: Reply with quote

Graham. thanx for the fixes. It works!! Very Happy


Enclosed is a fix that makes the "Auto assign" feature slightly more creative (more things match). Patch against current SVN, i.e. revision 1675.
Code:


Index: com/hifiremote/jp1/DeviceUpgrade.java
===================================================================
--- com/hifiremote/jp1/DeviceUpgrade.java       (revision 1675)
+++ com/hifiremote/jp1/DeviceUpgrade.java       (working copy)
@@ -3894,8 +3894,7 @@
           Button b = buttons[ i ];
           if ( assignments.getAssignment( b ) == null )
           {
-            if ( b.getName().equalsIgnoreCase( func.getName() )
-                || b.getStandardName().equalsIgnoreCase( func.getName() ) )
+           if ( func.matchingName(b) )
             {
               assignments.assign( b, func );
               break;
Index: com/hifiremote/jp1/Function.java
===================================================================
--- com/hifiremote/jp1/Function.java    (revision 1675)
+++ com/hifiremote/jp1/Function.java    (working copy)
@@ -386,4 +386,41 @@
   /** Default value used in upgrade when index==null */
   public static final int defaultGID = 0;
 
+  boolean matchingName(Button b) {
+    return matchingName(b.getName()) || matchingName(b.getStandardName());
+  }
+
+  private boolean matchingName(String candidate) {
+    String nameLower = name.toLowerCase();
+    String candidateLower = candidate.toLowerCase();
+    return name.equals(candidateLower) || canonicalize(nameLower).equals(canonicalize(candidateLower));
+  }
+
+  private static String[][] substitutes = {
+    {"key_", ""}, // Lirc
+    {"cursor", ""},
+    {"arrow", ""},
+    {"toggle", ""},
+    {"return", "exit"},
+    {"-", "down"},
+    {"\\+", "up"},
+    {">", "play"},
+    {"<", "reverse"},
+    {"\\|\\|", "pause"},
+    {"fwd", "forward"},
+    {"volume", "vol"},
+    {"channel", "ch"},
+    {"\\s+", ""}
+  };
+
+  private String canonicalize(String str) {
+    String work = str;
+    for (String[] substitute : substitutes) {
+      String from = substitute[0];
+      String to = substitute[1];
+      work = work.replaceAll(from, to);
+    }
+
+    return work;
+  }
 }

Back to top
View user's profile Send private message Send e-mail Visit poster's website
mathdon
Expert


Joined: 22 Jul 2008
Posts: 4515
Location: Cambridge, UK

                    
PostPosted: Wed Mar 18, 2020 12:25 pm    Post subject: Reply with quote

Bengt, thanks for the patch. It will be in the next upload to the SVN.
_________________
Graham
Back to top
View user's profile Send private message
mathdon
Expert


Joined: 22 Jul 2008
Posts: 4515
Location: Cambridge, UK

                    
PostPosted: Fri Mar 20, 2020 9:44 am    Post subject: Reply with quote

I have now posted development build 2 of RMIR v2.10 in the RMIR Development Folder on SourceForge. In addition to the RF support included in build 1 and described in an earlier post, this build provides enhanced identification of the various NEC protocols in the Learned Signals tab of RMIR and improvements to the range of executors that can be used in the automated conversion of learned signals to device upgrades. See this thread for more details.
_________________
Graham
Back to top
View user's profile Send private message
mathdon
Expert


Joined: 22 Jul 2008
Posts: 4515
Location: Cambridge, UK

                    
PostPosted: Wed Mar 25, 2020 8:21 am    Post subject: Reply with quote

RMIR v2.10 has now been officially released, and supersedes version 2.09 and the development builds of version 2.10. See this announcement for details.
_________________
Graham
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic       JP1 Remotes Forum Index -> JP1 - Software All times are GMT - 5 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

Powered by phpBB © 2001, 2005 phpBB Group
Top 7 Advantages of Playing Online Slots The Evolution of Remote Control