|
JP1 Remotes
|
View previous topic :: View next topic |
Author |
Message |
Barf Expert
Joined: 24 Oct 2008 Posts: 1414 Location: Munich, Germany |
Posted: Wed Jul 22, 2020 2:32 pm Post subject: JP1 remote emulator: concept based on RM |
|
|
Some of you may have used the Philips Pronto, an early touchscreen remote. It could be configured with the Windows program ProntoEdit. One of the many nice features was the inclusion of the Pronto Emulator, which created a windows, shaped as the remote, reacting to button presses with the mouse. Assuming that a Pronto remote was connected with a serial cable, pressing a button fired up the associated action in the emulator. In the case this action was the sending of an IR signal, the program sent a command over the serial line to the remote to send the corresponding signal. This way, the remote configuration could be tested and tried (and learned to the user's brain!) without flashing it to the remote's flash memory.
The Pronto has unfortunately been discontinued (2004).
(For more information on the Pronto, see remotecentral.com. They even have certain versions of ProntoEdit for free download. There is also an open source version, called Tonto. It is used in IrScrutinizer for importing and exporting Pronto (Classic) configuration files.)
We do not have anything similar for JP1. Most importantly, a way to have the remote to send IR-commands is not known to exist. Therefore, we have to use some other IR sender. For this, the library HarcHardware can be used. (It is used in IrScrutinizer for all hardware access.) It supports several different IR hardware senders (for example GlobalCache, Arduino (Girs), IrToy, ...) The supported hardware implements the Java interface org.harctoolbox.harchardware.ir.IRawIrSender, which defines a few functions that implementing classes must implement.
So, somewhat simplified, when a button in the emulator is triggered, we have to compute its IrSignal (org.harctoolbox.ircore.IrSignal). The work to translate the RM executor and its parameters to IRP protocol and corresponding parameters has been done by Graham in the context of "Girr export"; possibly a slight re-organization is necessary to implement something like Function.toIrSignal(). Then this IrSignal object is sent to an IRawIrSender using its sendIR(...) function. Basically, that is it. There is of course locating device, opening, and closing, BUT using the library, the hardware details are encapsulated.
Should not be too much work. The HarcHardware jar must be included; it is presently 267kb. In the first version, just emulate one DeviceUpgrade, and just one brand of hardware (like GlobalCache Flex or Arduino Girs (serial)). In a later version, can do a full multi-device remote (in the sense of RMIR), with device buttons etc, possibly also supporting different hardware. |
|
Back to top |
|
|
mathdon Expert
Joined: 22 Jul 2008 Posts: 4523 Location: Cambridge, UK |
Posted: Thu Jul 23, 2020 6:26 am Post subject: |
|
|
Barf wrote: | possibly a slight re-organization is necessary to implement something like Function.toIrSignal() |
I don't think any re-organization is necessary. For a DeviceUpgrade upgrade and a Function function the steps are essentially
Code: | DeviceUpgradeExporter exporter = new DeviceUpgradeExporter( upgrade );
RemoteSet remoteSet = exporter.getRemoteSet();
Remote remote = remoteSet.getRemotes().toArray( new Remote[ 0 ] )[ 0 ]; // there is only one
Map< String, Command > map = remote.getCommands();
Command command = map.get( function.getName() );
IrSignal irSignal = command.toIrSignal(); |
The first four lines need only be done once in setting the upgrade, the last two generate the IrSignal from the Function.
I am looking forward to this. It seems to me that you will, however, need some sort of API for RMIR to be able to access this code. Let me know what you need me to do, if anything. _________________ Graham |
|
Back to top |
|
|
|
|
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
|