开源改变世界!!

解析 GCode 文件时出现 NullPointerException #690

推推 grbl 2年前 (2023-01-27) 112次浏览
关闭
tkkuehn 打开了这个问题 2017 年 7 月 18 日 · 2 条评论
关闭

解析 GCode 文件时出现 NullPointerException#690

tkkuehn 打开了这个问题 2017 年 7 月 18 日 · 2 条评论

注释

解析 GCode 文件时出现 NullPointerException #690

你好,

我在 Arch Linux 上运行 2017 年 7 月 16 日的夜间构建。

当我尝试从对话框中解析任何 GCode 文件(我相信我尝试过的每个文件都是有效的)时Browse,该文件无法解析并且日志显示 NullPointerException。

示例 gcode 文件:
sample_gcode.txt

示例输出:

SEVERE: Problem while browsing.
java.lang.NullPointerException
	at javax.vecmath.Tuple3d.<init>(Tuple3d.java:91)
	at javax.vecmath.Point3d.<init>(Point3d.java:74)
	at com.willwinder.universalgcodesender.types.PointSegment.<init>(PointSegment.java:82)
	at com.willwinder.universalgcodesender.gcode.GcodeParser.addLinearPointSegment(GcodeParser.java:232)
	at com.willwinder.universalgcodesender.gcode.GcodeParser.handleGCode(GcodeParser.java:312)
	at com.willwinder.universalgcodesender.gcode.GcodeParser.processCommand(GcodeParser.java:210)
	at com.willwinder.universalgcodesender.gcode.GcodeParser.testState(GcodeParser.java:438)
	at com.willwinder.universalgcodesender.gcode.GcodeParser.preprocessCommand(GcodeParser.java:421)
	at com.willwinder.universalgcodesender.gcode.util.GcodeParserUtils.write(GcodeParserUtils.java:71)
	at com.willwinder.universalgcodesender.gcode.util.GcodeParserUtils.processAndExportText(GcodeParserUtils.java:124)
	at com.willwinder.universalgcodesender.gcode.util.GcodeParserUtils.processAndExport(GcodeParserUtils.java:54)
	at com.willwinder.universalgcodesender.model.GUIBackend.preprocessAndExportToFile(GUIBackend.java:163)
	at com.willwinder.universalgcodesender.model.GUIBackend.initializeProcessedLines(GUIBackend.java:909)
	at com.willwinder.universalgcodesender.model.GUIBackend.setGcodeFile(GUIBackend.java:476)
	at com.willwinder.universalgcodesender.MainWindow.browseButtonActionPerformed(MainWindow.java:1271)
	at com.willwinder.universalgcodesender.MainWindow.access$3000(MainWindow.java:84)
	at com.willwinder.universalgcodesender.MainWindow$28.actionPerformed(MainWindow.java:993)
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
	at java.awt.Component.processMouseEvent(Component.java:6533)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
	at java.awt.Component.processEvent(Component.java:6298)
	at java.awt.Container.processEvent(Container.java:2236)
	at java.awt.Component.dispatchEventImpl(Component.java:4889)
	at java.awt.Container.dispatchEventImpl(Container.java:2294)
	at java.awt.Component.dispatchEvent(Component.java:4711)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
	at java.awt.Container.dispatchEventImpl(Container.java:2280)
	at java.awt.Window.dispatchEventImpl(Window.java:2746)
	at java.awt.Component.dispatchEvent(Component.java:4711)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
	at java.awt.EventQueue.access$500(EventQueue.java:97)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.awt.EventQueue$3.run(EventQueue.java:703)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
	at java.awt.EventQueue$4.run(EventQueue.java:731)
	at java.awt.EventQueue$4.run(EventQueue.java:729)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
	at com.willwinder.universalgcodesender.utils.GUIHelpers.lambda$displayErrorDialog$0(GUIHelpers.java:45)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
	at java.awt.EventQueue.access$500(EventQueue.java:97)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.awt.EventQueue$3.run(EventQueue.java:703)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
解析 GCode 文件时出现 NullPointerException #690
所有者
绕线机 评论了 2017 年 8 月 10 日  

抱歉耽搁了。

问题是 UGS 不处理G0没有坐标的。我认为这肯定是无效的,但看看GRBL 遵循的标准是:

For rapid motion, program G0 axes, where all the axis words are optional.

感谢您报告这个边缘案例!

解析 GCode 文件时出现 NullPointerException #690 收卷  关闭此作为完成 d81bb03 2017 年 8 月 10 日
喜欢 (0)