These are chat archives for machinekit/machinekit

18th
Jun 2016
Jakob Flierl
@koppi
Jun 18 2016 02:35

In case someone will design another UI please keep in mind the results of the following study:

https://pbs.twimg.com/media/Cj4qpW1UYAAuBTm.jpg:large

Michael Haberler
@mhaberler
Jun 18 2016 16:36
yeah that one is a real bummer
damn if you do, damn if you dont
"press button to test. <klick>. release button to detonate."
zhivko
@zhivko
Jun 18 2016 19:36
trying to get around:
        if (data.length < 1 || (data[0] != 0 && data[0] != 1)) {
            throw new IllegalArgumentException("subscription flag");
        }
this is from jzmq-api project
Michael Haberler
@mhaberler
Jun 18 2016 19:37
make it if (data.length < 1 ) {
zhivko
@zhivko
Jun 18 2016 19:37
It obviously expects that first byte data[0] = 1 or what
Michael Haberler
@mhaberler
Jun 18 2016 19:38
actually you should be able to subscribe just fine with this version
in which case data[0] == 1
whats the problem?
zhivko
@zhivko
Jun 18 2016 19:39
yes
I tryed to subscribe - but it say XSUB cannot be cast to subscribable
just a sec..
So
I tried with:
        SocketBuilder builder = ctx.buildSocket(SocketType.XSUB)
                .withIdentity(identity.getBytes())
                .asSubscribable()
                .subscribe("".getBytes());
and I get
Exception in thread "main" java.lang.ClassCastException: org.zeromq.jzmq.sockets.XSubSocketBuilder cannot be cast to org.zeromq.api.Subscribable
    at org.zeromq.jzmq.sockets.SocketBuilder.asSubscribable(SocketBuilder.java:294)
    at com.kz.pipeCutter.BBB.BBBHalRComp.getSocket(BBBHalRComp.java:150)
    at com.kz.pipeCutter.BBB.BBBHalRComp.<init>(BBBHalRComp.java:50)
    at com.kz.pipeCutter.BBB.BBBHalRComp.main(BBBHalRComp.java:183)
Michael Haberler
@mhaberler
Jun 18 2016 19:42
sorry cant help with that - I dont understand java
zhivko
@zhivko
Jun 18 2016 19:43
OK thank you any way - I just wanted to relief my pain ;)
hehe
but it should be possible I mean jzmq-api is referenced as project under zeromq
so it should be possible somehow... will still play a bit
Michael Haberler
@mhaberler
Jun 18 2016 19:44
well you better talk to the zeromq-dev list then, unlikely you get help here on a zeromq java issue?
zhivko
@zhivko
Jun 18 2016 19:45
OK yes good idea
zhivko
@zhivko
Jun 18 2016 21:46
ughh.. making progress ... reading hal_glib.py helped :)
receiving MT_HALRCOMP_BIND_REJECT now ;)
probably because I defined component name and pin names only ... pin direction and type are mandatory for proper binding ?
Michael Haberler
@mhaberler
Jun 18 2016 21:50
getting when - does the rcomp already exist or not
if you want to bind against an existing rcomp pins dirs types must match exactly
zhivko
@zhivko
Jun 18 2016 21:51
I wanna bind motion component for (motion.program-line)
Michael Haberler
@mhaberler
Jun 18 2016 21:51
otherwise it cannot work
you cannot bind an existing RT comp
zhivko
@zhivko
Jun 18 2016 21:51
since MT_HALRCOMMAND_DESCRIPTION returns motion.program-line - I think it already exist
? maybe silly question - but why not ?
Michael Haberler
@mhaberler
Jun 18 2016 21:52
it describes hal status, but it does not say motion is a remote comp you can bind to
well your code and the RT functs are going to fight, right? it just does not make any sense
zhivko
@zhivko
Jun 18 2016 21:53
so this means MT_HALRCOMMAND_DESCRIPTION is only way to retrieve motion.program-line?
Michael Haberler
@mhaberler
Jun 18 2016 21:53
like in the rest of HAL - create a comp, link the pins
you create some rcomp, you can then link its pins to motion pins
but an rcomp has - as described in the doc - has a remote processing funct
zhivko
@zhivko
Jun 18 2016 21:54
I do this in *.hal file right ?
Michael Haberler
@mhaberler
Jun 18 2016 21:54
an RT comp already has a local funct
just look the example under machinetalk/tutorial/motorctrl
zhivko
@zhivko
Jun 18 2016 21:54
OK.