Java UI for linuxcnc

More
25 Jun 2021 15:23 #212909 by Doogie
Replied by Doogie on topic Java UI for linuxcnc
The author hasn't been online for 8 months so you might also open an issue on his git repo for another possible contact mechanism.

Please Log in or Create an account to join the conversation.

More
27 Jun 2021 05:55 #213002 by Reinhard
Replied by Reinhard on topic Java UI for linuxcnc

The author hasn't been online for 8 months so you might also open an issue on his git repo for another possible contact mechanism.

Sorry, but email-notification from forum does not work any more :(
.

Is this project still ongoing or it was abandoned due to some limitations?

Well, no limitations.
I didn't post here for little interest on java ui.
I added some polish to the "gremlin" and I was quite pleased with the state reached.
Everything I wanted worked so far.

As a side note: I don't use gremlin. I implemented a 3D-view on my own.

... but: I didn't follow changes on master.
.

I am interested about the details on how to communicate with the library and also about the gremlin plot.
I really hope you did not hit a bottleneck and that a java based UI would be a feasible solution.

Based on your question I checked my app against master and it looks as if it is broken.
LC has changed access api of NML, so currently it does not work.
Have to research for that changes and change the access layer.

Please Log in or Create an account to join the conversation.

More
28 Jun 2021 07:17 #213096 by vmihalca
Replied by vmihalca on topic Java UI for linuxcnc
Glad to read your answer!
I am interested in building a Java based UI but with kotlin instead of java.
I looked over your code and indeed, I can see some programming experience behind, you don't seem to be just a hacker! :D
I have contributed a bit with on the QtPyVcp project and I have also build my VCP on top of QtPyVcp, but even though I've became more familiar with python, the object oriented part of me cannot make peace with the non-typed python.
Also since Compose for Desktop was announced, I said I wanted to build this.
Can we connect a chat or smth for more discussions?

Please Log in or Create an account to join the conversation.

More
28 Jun 2021 14:41 #213144 by Reinhard
Replied by Reinhard on topic Java UI for linuxcnc

I am interested in building a Java based UI but with kotlin instead of java.

Well, can't help with kotlin.
I'm convinced, that java/swing is the most powerful ui-framework out there. Never had an ui-idea, that was impossible to work out.
But first of all, you should figure out, what goal you wonna reach. Kotlin is preferred language of android - and android runs on ???
Language selection should be one of the last decisions, not the first one.
.

I looked over your code and indeed, I can see some programming experience behind

That's right, I learned to work concept based - the opposite of hacking :dry:
.

I have contributed a bit with on the QtPyVcp project and I have also build my VCP on top of QtPyVcp

Well, Qt is a huge framework, but it has the drawback, that it works by occasion. That means, same code may work on one machine and simply crash on another machine. I only happen to know the crashy side of Qt ... :(

Lately I had to realize a small ui for linux without X-server - and I choosed GTK+
There's a OO-language for GTK+ called vala. Never heard that before, but it is a very clean and convincing conecpt. It took me few days and my project was up and running.
.

I've became more familiar with python, the object oriented part of me cannot make peace with the non-typed python.

Python is a language built for hackers that don't like to learn how to code. I never accepted python as a programming language.
Nevertheless I had to realize a project using python - as it was the only scripting engine on the target system.
.

Can we connect a chat or smth for more discussions?

No, I'm too old for chat. Don't like that.
I'm a fan of asynchronous communication ...
We can mail or use forum.

Please Log in or Create an account to join the conversation.

More
28 Jun 2021 18:14 #213165 by vmihalca
Replied by vmihalca on topic Java UI for linuxcnc
Kotlin is fancier Java. Kotlin code is interoperable with java code, it compiles to java bytecode that runs on JVM.
You can see more details here:
kotlinlang.org/docs/comparison-to-java.h...-addressed-in-kotlin

In the last 4 years, I've been a Kotlin developer on Android, and I really like the language features.
Since compose framework was announced for building declarative UI on Android, I've thought how nice it would be to write the entire VCP in kotlin & compose.
Then I've discovered that JetBrains, has announced Compose for Desktop, which runs on Windows, Linux, MacOS.

What I would like to achieve is smth like this:
An onion style architecture where I have:
Services - all the linuxcnc specific communication with the linuxcnc library, database service, network service.
Repositories - that are aggregating information from services and exposing streams of data (similar to RxJava) to the upper layer
UseCases - Here by combining various repositories, we could handle the common functionality between the Lathe/Mill/Plasma
Each layer will have its own specific objects, that will be visible only the the upper layer.
That way, I can unit test every layer and have confidence that everything works as expected.
Then comes the UI, which would be written in Kotlin Compose.

The philosophy that I've used for my QtPyVcp app, was that I don't wanna see on the screen, information that is not relevant or buttons that don't make sense to be clicked when the machine is that specific state.
Eg:
- it doesn't make sense to have spindle stop button when spindle is not running, and it doesn't make sense to have fwd/rev buttons when the spindle is running.
- it doesn't make sense to see DTG info when you're the machine is not executing anything in mdi or program running....and so on.

So I am thinking of having a state machine, where every state in which the machine can be will be defined and mapped 1:1 with the UI
This state machine will respond to asynchronous events that are getting triggered by status channel & error channel.

Excepting the services layer, all the code so far is cross platform, so the controller app could run on any OS including android tablets.
By creating the services layer smart enough, we could have linuxcnc running like centroid is running, on a different pc than that one that is controlling the machine.

The reason I wanna do this is because I need a strong enough motivation to learn compose UI and understand better the internals of linuxcnc.

If you could help me to get your app working, it would be huge help and a great startup.
After that I could slowly build the architecture that I've discussed above.
Until the Compose for destkop hits the stable release, I have enough time to do all the logic that's needed in the layers below.
I have looked over your code, and with my previous experience, I understand it quite a bit, but its been more than 12 years since I wrote a swing desktop app, and don't quite know how to even start it.. :dry:

Please Log in or Create an account to join the conversation.

More
29 Jun 2021 06:30 #213218 by vmihalca
Replied by vmihalca on topic Java UI for linuxcnc
Can you help me get your app running? I would like to play with it and understand better the linkage with linuxcnc.

Please Log in or Create an account to join the conversation.

More
29 Jun 2021 15:15 #213242 by Reinhard
Replied by Reinhard on topic Java UI for linuxcnc

In the last 4 years, I've been a Kotlin developer ...

So I'm quite sure, that you don't need help to create your GUI
.

What I would like to achieve is smth like this:
An onion style architecture where I have ...

Well, that sounds nice, but I think you'll do yourself a favor and checkout/research, what linuxcnc interfaces offer.
There are different interfaces with different usecase ...
You should consider LC a blackbox with which you can communicate through api-layer
.

The philosophy that I've used for my QtPyVcp app, was that I don't wanna see on the screen, information that is not relevant or buttons that don't make sense to be clicked when the machine is that specific state.
Eg:
- it doesn't make sense to have spindle stop button when spindle is not running, and it doesn't make sense to have fwd/rev buttons when the spindle is running.
- it doesn't make sense to see DTG info when you're the machine is not executing anything in mdi or program running....and so on.

CUA (specs written by IBM in the 80th - but stil valid for GUI) says:
When you never can enter a state, where you can use a button, that should be hidden. When the current application state prohibits the use of a button, but user can enter another state, where the button usage makes sense, then that button should be disabled but visible.
Imagine a business desktop, where every application depends on certain grants. So if a user does not have the right to execute an application, that action-button/menuentry/whatever should not be visible.

But Spindle on/off is no subject to justify hiding a button. Opposed to that, it may make sense, if there are milling specific buttons and your app runs in lathe mode than hiding the milling buttons is valid.
.

Excepting the services layer, all the code so far is cross platform, so the controller app could run on any OS including android tablets.

That's simply not true. May be you know octoprint - in that case it may be true. With a 3D-printer you don't have to fix workpieces and measure dimensions of workpiece ...
Controller application is tied to hardware-controlling modules which are synchronized in realtime. It makes absolutely no sense, to port the controller to a system, that has no possibility of realtime data exchange with hardware controllers.

Therefore I designed my app to use the api of LC like any other UI from LC. That means, that every control is tied to send a command to LC and all display elements show content received from LC.

If you don't understand the connection layer to LC from my app, may be its easier to have a look at Qtpyvcp or other gui applications. All use the same communiction channels
.

Can you help me get your app running?

Actually no.
Communication-layer to LC is broken and I have to find out, what happened and how can I come back to a working communication.

Please Log in or Create an account to join the conversation.

More
29 Jun 2021 20:38 #213266 by vmihalca
Replied by vmihalca on topic Java UI for linuxcnc
I really appreciate your feedback and the fact that you are challenging my ideas.
You obviously know more about this topic than me because you already have invested some time to understand how all that works.
I do understand the connection layer to LC inside your app, I am just not sure how to get the app running.
Regarding the communication layer not working, I would assume there is an issue in the BufferDescriptor.java where there is all the mapping of offset & size for reading from the linuxcnc's shared memory. Perhaps the library has introduced/removed something that has messed up the offsets. This is just my wild guess, I am sure you know a lot more about this.
I don't need help with writing my custom UI or with kotlin, once I manage to have your app running so that I can have the communication established with linuxcnc, I think I should be ok.
I already have a VCP written on top of QtPyVcp, but even if I'm happy with the visual result, I don't like the python code at all. So the coder part of me is not happy to invest more in growing that app.
Do you know by chance when was the last time it was working? Perhaps I could see the history of the relevant files in the library and find out what's new in the present
or at least pull an older version of master on which you know it was working, try with that one, then compare.

Please Log in or Create an account to join the conversation.

More
30 Jun 2021 02:35 #213300 by Reinhard
Replied by Reinhard on topic Java UI for linuxcnc

Regarding the communication layer not working, I would assume there is an issue in the BufferDescriptor.java where there is all the mapping of offset

No, its not the BufferDescriptor.
A wrong BufferDescriptor leads to wrong values, but not to errors in communication.

Currently the native call does not return a valid address from backend.
I can't work around that in my app - I have to fix backend or use another way to access status ...
.

Do you know by chance when was the last time it was working?

According to github it was about a year ago.
I already had the same idea and tried to use LC releases back until 2.7 - the problem is, in the last year, operating system and external libs have been changed a lot, so no release is compilable at current state of debian stable (which I use as os).

The only thing I can say at the moment: hold on, I'm working on research and find a way to get my app working again.
The following user(s) said Thank You: vmihalca

Please Log in or Create an account to join the conversation.

More
30 Jun 2021 16:05 #213352 by Reinhard
Replied by Reinhard on topic Java UI for linuxcnc
Good news! I found the source of evil ;)
New access layer is much cleaner now.
Stil have a build problem, but I'm on the way ;)

Please Log in or Create an account to join the conversation.

Time to create page: 0.182 seconds
Powered by Kunena Forum