pax_global_header 0000666 0000000 0000000 00000000064 13121004061 0014476 g ustar 00root root 0000000 0000000 52 comment=9cda43b1378ae2dfb89a9b523634a89233cb4c7a
ucrpf1host-0.0.20170617/ 0000775 0000000 0000000 00000000000 13121004061 0014341 5 ustar 00root root 0000000 0000000 ucrpf1host-0.0.20170617/README.md 0000664 0000000 0000000 00000001412 13121004061 0015616 0 ustar 00root root 0000000 0000000
# ucrpf1host
This program is a host program for a 3D printer called Panowin F1.
It can also be used on other 3D printers but beware that it might not
work perfectly.
Panowin F1 has some problems on its serial port circuit of its motherboard.
The error rate is very high and makes the g-code broken often. Also their
firmware is not the standard Marlin so it needs some special care when sending
out the G-Codes. Like if the error eats the newline character, then we need to
implement a timeout in host to resend the command when newline is missing.
This host program should be used under Linux. On Windows it is probably to use
pango software (the host and slicer) made by Panowin. It uses proprietary
binary P-code which deals better with the high transmission error rate.
ucrpf1host-0.0.20170617/build.xml 0000664 0000000 0000000 00000004621 13121004061 0016165 0 ustar 00root root 0000000 0000000
ucrpf1host-0.0.20170617/com/ 0000775 0000000 0000000 00000000000 13121004061 0015117 5 ustar 00root root 0000000 0000000 ucrpf1host-0.0.20170617/com/ucrobotics/ 0000775 0000000 0000000 00000000000 13121004061 0017273 5 ustar 00root root 0000000 0000000 ucrpf1host-0.0.20170617/com/ucrobotics/yliu/ 0000775 0000000 0000000 00000000000 13121004061 0020255 5 ustar 00root root 0000000 0000000 ucrpf1host-0.0.20170617/com/ucrobotics/yliu/ucrpf1host/ 0000775 0000000 0000000 00000000000 13121004061 0022353 5 ustar 00root root 0000000 0000000 ucrpf1host-0.0.20170617/com/ucrobotics/yliu/ucrpf1host/CommandData.java 0000664 0000000 0000000 00000012515 13121004061 0025372 0 ustar 00root root 0000000 0000000 /*
Copyright (C) 2017 Ying-Chun Liu (PaulLiu)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
*/
package com.ucrobotics.yliu.ucrpf1host;
import java.util.logging.*;
import java.util.*;
import gnu.io.*;
/**
* Represent a G-Code command
*/
public class CommandData {
private String command=null;
private ArrayList answer=null;
private int lineNumber = 0;
private long timestamp=0;
private double prevExtruderX=0.0;
private double prevExtruderY=0.0;
private double prevExtruderZ=0.0;
private double prevExtruderE=0.0;
private double prevExtruderF=0.0;
/**
* Constuct a CommandData with the G-Code command as a String.
*
* @gCodeCommand the G-Code string
*/
public CommandData(String gCodeCommand) {
this.answer = new ArrayList();
this.command = gCodeCommand;
}
/**
* Get the raw G-code of the CommandData
*
* @return the G-code string
*/
public String getCommand() {
return command;
}
/**
* Get the stripped G-code of the CommandData.
*
* It will remove the comments start with semi-comma (;) and also
* removes all whitespaces in the g-code.
*
* @return the stripped G-code string
*/
public String getStripedCommand() {
String ret = command;
int commentIndex = ret.indexOf(';');
if (commentIndex >= 0) {
ret = ret.substring(0, commentIndex);
}
ret = ret.replaceAll("\\s+", "");
return ret;
}
/**
* Calculate the checksum of a command.
*
* You should calculate the checksum based on stripped command and with
* the line number added. Not the raw one.
* And before calculation you should convert it to bytes[] rather
* than String.
*
* @s the g-code string in byte[]
* @return the checksum.
*/
private int getChecksum(byte[] s) {
int checksum=0;
for (int i=0; i