GNU General Public License v3.0

项目介绍

winder/Universal-G-Code-Sender 是一个托管在 GitHub 上的开源项目,主要使用 Java 编写,采用 GNU General Public License v3.0 许可证,目前获得 2.3k 个 Star、736 次 Fork。

仓库全名
winder/Universal-G-Code-Sender
开源许可证
GNU General Public License v3.0
Star 数
2.3k
Fork 数
736
未关闭 Issue
192

README 摘要

Universal G-Code Sender is a Java based, cross platform G-Code sender, compatible with GRBL, TinyG, g2core and Smoothieware. Webpage: https://universalgcodesender.com/ Discussion forum: https://github.com/winder/Universal-G-Code-Sender/discussions Discord chat: https://discord.com/invite/4DYywtyGYK Translations: https://translate.universalgcodesender.com/ Technical details: JSSC or JSerialComm for serial…

完整内容见 GitHub 原始 README 或本页 。

常见问题

Universal-G-Code-Sender 用什么语言开发?

主要使用 Java 编写,采用 GNU General Public License v3.0 许可证,目前有 2.3k 个 Star。

Universal-G-Code-Sender 可以免费商用吗?

仓库标注的许可证为 GNU General Public License v3.0,商用前请先阅读仓库 LICENSE 文件确认授权范围。

如何获取 Universal-G-Code-Sender 的源码?

可以直接克隆仓库:git clone https://github.com/winder/Universal-G-Code-Sender.git,默认分支为 master;安装与运行步骤见仓库 README。

Universal-G-Code-Sender 最近还在维护吗?

仓库最近一次更新为 2 天前,当前有 192 个未关闭 Issue;Star 数为 2.3k,可作为社区活跃度的参考。

简要分析

热度分
3922
价值分
1597
活跃状态
活跃

语言占比

Batchfile
CSS
G-code
HTML
Java
JavaScript
Python
SCSS
Shell
TypeScript
nesC

Release

README

Universal G-Code Sender

Last commit Build Status Crowdin Downloads Releases Discord

Universal G-Code Sender is a Java based, cross platform G-Code sender, compatible with GRBL, TinyG, g2core and Smoothieware.

Webpage: https://universalgcodesender.com/
Discussion forum: https://github.com/winder/Universal-G-Code-Sender/discussions
Discord chat: https://discord.com/invite/4DYywtyGYK
Translations: https://translate.universalgcodesender.com/

Technical details:

Downloads

Below you will find the latest release of UGS.
For older releases please visit the releases page.

Unpack and start the program bin/ugsplatform

Latest release (v2.1.23) Nightly build
Windows 64-bit Windows 64-bit Windows 64-bit Windows 64-bit
Mac OSX Mac OSX Mac OSX Mac OSX
Mac OSX Mac OSX ARM64 Mac OSX ARM64 Mac OSX ARM64
Linux x64 Linux 64-bit Linux x64 Linux 64-bit
Linux ARM Linux ARM Linux ARM Linux ARM
Linux ARM Linux ARM64 Linux ARM Linux ARM64
Zip All platforms Zip All platforms

Screenshots

UGS Platform main window

UGS Platform

Customizable panel layout

Customizable panel layout

Menu actions with customizable keybindings

Actions

Menu with plugins

Plugins

One of many plugins

Dowel Maker

Basic gcode editor

Basic gcode editor

Vector graphics designer for generating GCode toolpaths

Designer

Development

Show details on how to compile the software

For development we use Maven and Java 17 for compiling.

On Windows you might need to install zip:

winget install -e --id GnuWin32.Zip
Compiling and starting the application

UGS Classic:

./mvnw install
./mvnw exec:java -Dexec.mainClass="com.willwinder.universalgcodesender.MainWindow" -pl ugs-core

UGS Platform:

./mvnw install
./mvnw nbm:run-platform -pl ugs-platform/application
Execute all tests
./mvnw test
Building the self-executing JAR
./mvnw install
./mvnw package -pl ugs-classic
Build a UniversalGcodeSender.zip release file
./mvnw package -pl ugs-classic assembly:assembly
Develop via IntelliJ

If you are more used to IntelliJ, you can also build, run and debug it there.

  • Run ./mvnw nbm:run-platform -pl ugs-platform/application once via terminal to build everything
  • Import the Source, File -> New -> Project from existing Sources
  • Setup a new “Run Configuration”, Java Application, with following settings:
    • Main Class: org.netbeans.Main
    • VM Options:
-Dpolyglot.engine.WarnInterpreterOnly=false
-Dnetbeans.user=$ProjectFileDir$/ugs-platform/application/target/userdir
-Dnetbeans.home=$ProjectFileDir$/ugs-platform/application/target/ugsplatform/platform
-Dnetbeans.logger.console=true
-Dnetbeans.indexing.noFileRefresh=true
-Dnetbeans.moduleitem.dontverifyclassloader=true
-Dnetbeans.dirs=$ProjectFileDir$/ugs-platform/application/target/ugsplatform/ugsplatform:$ProjectFileDir$/ugs-platform/application/target/ugsplatform/platform:$ProjectFileDir$/ugs-platform/application/target/ugsplatform/ide:$ProjectFileDir$/ugs-platform/application/target/ugsplatform/extra:$ProjectFileDir$/ugs-platform/application/target/ugsplatform/java
--add-opens=java.base/java.net=ALL-UNNAMED
--add-opens=java.base/java.lang.ref=ALL-UNNAMED
--add-opens=java.base/java.lang=ALL-UNNAMED
--add-opens=java.base/java.security=ALL-UNNAMED
--add-opens=java.base/java.util=ALL-UNNAMED
--add-opens=java.base/java.nio=ALL-UNNAMED
--add-exports=java.base/sun.reflect.annotation=ALL-UNNAMED
--add-opens=java.prefs/java.util.prefs=ALL-UNNAMED
--add-opens=java.desktop/javax.swing.plaf.basic=ALL-UNNAMED
--add-opens=java.desktop/javax.swing.text=ALL-UNNAMED
--add-opens=java.desktop/javax.swing=ALL-UNNAMED
--add-opens=java.desktop/java.awt=ALL-UNNAMED
--add-opens=java.desktop/java.awt.event=ALL-UNNAMED
--add-opens=java.desktop/sun.awt.X11=ALL-UNNAMED
--add-opens=java.desktop/javax.swing.plaf.synth=ALL-UNNAMED
--add-opens=java.desktop/com.sun.java.swing.plaf.gtk=ALL-UNNAMED
--add-opens=java.desktop/sun.awt.shell=ALL-UNNAMED
--add-opens=java.desktop/sun.awt.im=ALL-UNNAMED
--add-exports=java.desktop/sun.awt=ALL-UNNAMED
--add-exports=java.desktop/java.awt.peer=ALL-UNNAMED
--add-exports=java.desktop/com.sun.beans.editors=ALL-UNNAMED
--add-exports=java.desktop/sun.swing=ALL-UNNAMED
--add-exports=java.desktop/sun.awt.im=ALL-UNNAMED
--add-exports=java.desktop/com.sun.java.swing.plaf.motif=ALL-UNNAMED
  • Program arguments: --branding ugsplatform
  • Working dir: $ProjectFileDir$
  • Use classpath of module: ugs-platform-app
  • There is a runConfiguration in the repository, which should be available after importing the project

Show code documentation.

High-Level Architecture

  1. Core Module (ugs-core): This is the heart of UGS. It contains:

    • Communication Layer: Handles serial communication (or other protocols like TCP/IP for some controllers) with the CNC machine’s firmware (e.g., GRBL). It translates G-code commands into signals the controller understands and interprets responses from the controller.
    • G-code Parser and Interpreter: Processes G-code files, breaks them down into individual commands, and manages the sending sequence.
    • Machine State Management: Keeps track of the machine’s current position (X, Y, Z coordinates), feed rate, spindle speed, and other relevant operational parameters. This is the data that populates the “Controller State (DRO)” panel.
    • Toolpath Generation/Visualization Logic: While UGS isn’t primarily a CAM (Computer-Aided Manufacturing) software, it contains logic to interpret G-code and generate a visual representation of the toolpath for the user.
    • Settings and Configuration Management: Handles loading and saving user preferences, machine settings, and connection parameters.
  2. Platform/Application Layer (ugs-platform/application and other modules): This layer builds upon the core functionality and provides the graphical user interface (GUI) and specific features.

    • NetBeans Platform: UGS Platform leverages the NetBeans Platform, which provides a robust framework for building desktop applications. This means the UI is composed of “modules” or “plugins,” each responsible for a specific set of functionalities (e.g., a module for the visualizer, a module for the console, a module for the DRO).
    • User Interface (UI) Components: These are the visual elements the user interacts with, such as buttons, text fields, tables, and the visualizer. These components are typically Swing-based (Java’s GUI toolkit) or, less commonly, JavaFX.
    • Event Handling: Manages user interactions (button clicks, keyboard input, mouse movements) and translates them into calls to the core module or other platform services.
    • Plugin System: The modular nature allows for easy addition of new features or customization through plugins.
  3. Third-Party Libraries: UGS relies on various external libraries for tasks like:

    • Serial communication (e.g., JSSC - Java Simple Serial Connector).
    • 3D visualization (e.g., JOGL for OpenGL integration).
    • Logging.
    • JSON parsing (for settings).

UI elements

The user-interface elements of ugs-platform can be found in the ugs-platform folder. Each window in the platform-application is a Panel object. We list differnt ui elements together with their location below:

  • Controller State (DRO): This is the window to see the current state of the machine (connected/disconnected) and its current position. The code is located under ugs-platform/ugs-platform-plugin-dro/src/main/java/.../panels/MachineStatusPanel.java.

  • Jog Controller: This window contains buttons to jog the machine. The code is located under ugs-platform/ugs-platform-plugin-jog/src/main/java/.../jog/JogPannel.java. In the resources folder, you will find svg images which are displayed inside the jog buttons.

  • Overrides pannel: ugs-core/src/com/.../uielements/panels/OverridesPanel.java.

  • language-specific text: In the folder ugs-core/src/com/.../resources/, you will find a lot of .properties files. These contain language-specific text that is shown to the user, such as label text, button text etc.

Logs

Application logs, including detailed debug messages and error reports, are primarily written to the messages.log file. This file is located within the application’s user directory at ugs-platform/application/target/userdir/var/log/messages.log when running from the build target. In the event of an unexpected application crash or erratic behavior, reviewing this log file is the first recommended step, as it often contains stack traces and error messages that can pinpoint the root cause of the problem. Additionally, for severe JVM crashes, a hs_err_pid<PID>.log file might be generated in the application’s working directory, offering further low-level diagnostic information.

Supported by

JetBrains logo.

评论

暂无评论