bengtmartensson / girr Goto Github PK
View Code? Open in Web Editor NEWGirr is a universal XML-based format for the exchange and storage of infrared signals.
Home Page: http://www.harctoolbox.org/
License: GNU General Public License v3.0
Girr is a universal XML-based format for the exchange and storage of infrared signals.
Home Page: http://www.harctoolbox.org/
License: GNU General Public License v3.0
The Java class Remote does not presently contain several CommandSet-s, unlike the XML structure.
In the IrpTransmogrifier/JP1 tradition, all protocol names are considered case insensitive. Turning them lower case makes life much easier for postprocessing.
Can probable have one static DecoderParameters in Command.
Basically do what irptransmogrifier analyze --named xxx --girr
. Should invoke the analyzer of IrpTransmogrifier.
Requires bengtmartensson/IrpTransmogrifier#97
... like in IrpTransmogrifier
Although the applicationData
allows for adding all sort of data, it would be desirable to make Girr more explicitly in inviting to use for other kind of remote control than IR in the proper sense, i.e. either raw signals or protocol/parameter form of signals. For this, in the commandSet
element. there should be a parameter kind
taking values like "ir", "serial", "tcp", "udp", "http", code" etc. (Default to "ir" for backwards compatibility). (Let's make it "text", and not an ennumeration, to be able to have it user extendable). It using this parameter, it may be necessary to complement it with some application parameter (appParameter
), like code
requires (e.g.) a lirc driver. both to make sense of the codes and to send them.
For example, the atilibusb.lircd.conf
may be turned into
<remote vendor="ATI" name="ATI_Remote_Wonder_II">
<commandSet type="code">
<applicationData application="lirc">
<appParameter name="driver" value="atilibusb"/>
<appParameter name="gap" value="203970"/>
</applicationData>
<command name="KEY_STOP" code="0x000231"/>
...
</commandSet>
</remote>
Similarly, a Sony Projector can be controlled serially and over IR by
<remote id="sony_vlp_hw50es" name="Sony VLP HW50ES" vendor="Sony" model="VLP HW50ES" type="projector">
<commandSet kind="serial">
<applicationData application="serial">
<applicationParameter name="protocol" value="rs232"/>
<applicationParameter name="baud" value="38400"/>
<applicationParameter name="dataBits="8"/>
<applicationParameter name="parity" value="even"/>
<applicationParameter name="stopBits" value="1"/>
<applicationParameter name="commandFormatter" value="org.harctoolbox.harchardware.misc.SonySerialCommand"/>
</applicationData>
<command name="power_toggle" code="set,23,21"/>
...
</commandSet>
<commandSet name="sony15" protocol="sony15" deviceno="84">
<command name="video_mute_toggle" code="36"/>
....
</commandSet>
....
</remote>
Here, the attribute F
in command
has been renamed to code
.
Remains to define syntax and semantic for
Note that:
girr[_ns].xsd
.An empty command is a command with a name, but without a definition: no protocol/parameters, no raw, no pronto. Presently, empty commands are rejected when importing. By allowing empty commands, the Girr format can be used to define templates for remotes.
To not break backwards compatibility, this should only be optional behavior.
Sorts the Remotes in a RemoteSet and the Commands in Remote respectivelly.
Prefer
<commandSet ... >
<parameters protocol="rc6">
<parameter name="D" value="0"/>
</parameters>
<command F="12" master="parameters" name="power_toggle"/>
<command F="56" master="parameters" name="input"/>
<command F="60" master="parameters" name="teletext_toggle"/>
...
over
<commandSet ... >
<command master="parameters" name="power_toggle">
<parameters protocol="rc6">
<parameter name="D" value="0"/>
<parameter name="F" value="12"/>
</parameters>
</command>
<command master="parameters" name="input">
<parameters protocol="rc6">
<parameter name="D" value="0"/>
<parameter name="F" value="56"/>
</parameters>
</command>
<command master="parameters" name="teletext_toggle">
<parameters protocol="rc6">
<parameter name="D" value="0"/>
<parameter name="F" value="60"/>
</parameters>
</command>
....
for reasons of human readability.
On the scheme level, this amounts to allow the irp:protocols element, for example as child element of remotes
and remote
.
This amounts to append the IRP data base of known protocols with the ones given in the file -- overriding in the case of identical names. The commands still refer to protocols using the protocol's name, not XML references.
Not necessary, just ugly.
For example line 127 of CommandSet.java, probably more.
Can basically make a light version of http://www.harctoolbox.org/Girr.html
If the top level element is not remots, "fill it" into a RemoteSet.
If the commands to be exported starts with a signal without a certain parameter (except F), and a later command, with the same protocol contains that parameter, a NPE will occur.
For example NEC1 D=123,F=... followed by NEC1 D=123,S=45,F=... will trigger the problem.
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException: Cannot invoke "java.lang.Long.equals(Object)" because the return value of "java.util.Map.get(Object)" is null
at org.harctoolbox.girr.Command.canReduce(Command.java:1278)
at org.harctoolbox.girr.Command.toElement(Command.java:1173)
at org.harctoolbox.girr.CommandSet.lambda$toElement$4(CommandSet.java:317)
at java.base/java.util.LinkedHashMap$LinkedValues.forEach(LinkedHashMap.java:647)
at org.harctoolbox.girr.CommandSet.toElement(CommandSet.java:316)
at org.harctoolbox.girr.Remote.toElement(Remote.java:280)
at org.harctoolbox.girr.RemoteSet.toElement(RemoteSet.java:552)
at org.harctoolbox.girr.XmlExporter.toDocument(XmlExporter.java:204)```
Valid documents trigger "attribute 'T' not allowed".
instead of directory tools.
Javadoc (for code), something for the scheme. Should use #10.
Basically tagging a release for IrScrutinizer 2.0.0.
Should be a child element instead of an attribute, multiplicity: *. Should take an xml:lang attribute (with unique-restriction), thus supporting multiiple languages.
In the same vein, adding a helpText
element (that can be used for tooltips etc) would be a good idea, same xml:language handling and restriction.
Added 2021-04-12: For compatibility, the attribute form should still be accepted (though deprecated), and equivalent to a displayName element with xml:lang="en".
Added 2021-04-15: This defines a new version of the schema, which we will call 1.2 and will have the schema location systemID http://www.harctoolbox.org/schemas/girr_ns-1.2.xsd
Replaces bengtmartensson/IrScrutinizer#163
...which is non-portable (to file systems that are not case sensitive).
Solution: rename Girr.xml.
For the next version of Girr, there should be some possibility to (non-mandatory) express semantic of a command, for example
<command name="..." ...>
....
<semantic>
<attribute name="toggle" value="true"/>
<attribute name="powers-on" value="true"/>
<attribute name="delay-after" value="5000"/>
</semantic>
....
</command>
Girr as such should leave the interpretation to a program. Thus, no changes in the Java code are required, just an extension of the schema.
Replacement of IrScrutinizer issue.
Ok to "forget" that it was an alias, for example when generating a Girr file.
Generated code is for first D only.
First in a development branch.
Easy, since there is now a simple default IrpDatabase in the standard jar.
Should be "ccf" to be valid wrt the schema.
And the Schema namespace is declared but not the XInclude.
Like this...
<commandSet name="commandSet">
<parameters protocol="nec1">
<parameter name="D" value="128"/>
</parameters>
<command master="ccf" name="Power On/Off Toggle">
<ccf>0000 006C 0022 0002 015B 00AD 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0016 0016 0016 0016 0041 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0041 0016 0016 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 05F7 015B 0057 0016 0E6C</ccf>
</command>
....
Cf. #1; IrpTransmogrifier (partially) supports longer parameters.
Depends on bengtmartensson/IrpTransmogrifier#38
cvc-enumeration-valid: Value 'prontoHex' is not facet-valid with respect to enumeration '[raw, ccf, parameters]'. It must be a value from the enumeration. [13]
cvc-attribute.3: The value 'prontoHex' of attribute 'master' on element 'command' is not valid with respect to its type, 'masterEnum'. [13]
This must have sneaked in when I renamed several "ccf" to "prontoHex".
Style sheet links has (although a nice technique as such) gone out of style. For example, Firefox (and probably also some other browsers) ignores such links (unless ...), "for security reasons". Moreover, this, basically useless, feature made the argument list to toDocument awfully long.
Todo: remove stylesheetUrl ans stylesheetType as argument to toDocument(....) and (not to just delete a working feature) make these static members of a suitable class.
Probably better with a new schema than to extend girr_ns.xsd.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.