Skip to content

Commit 234f33e

Browse files
committed
Multiple fixes / changes
- Fixed pacakge localization in org.usfirst.frc.team4716.robot.commands.Climber/face.java - Fixed JSON Parsing in org.usfirst.frc.team.4716.robot.utils/ConfigClient.java - Bumped up .gitnore file to the repo base dir and updated file - Prepped the Raider folder containing the project src to be bumped up to the base dir of the project - Prepped the Raider_Server to be moved to it's own project and bumped up to it's respective base dir for the project - Prepped Raider project for src dir movement to shorten package names (Ex. /src/robot.commands <- under org.usfirst.frc.team4716)
1 parent f8c2230 commit 234f33e

File tree

7 files changed

+112
-6
lines changed

7 files changed

+112
-6
lines changed

.gitignore

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Java
2+
*.class
3+
4+
# Mobile Tools for Java (J2ME)
5+
.mtj.tmp/
6+
7+
# Package Files #
8+
#*.jar -- Deprecated until automatic dependency retrival via gradle or maven
9+
*.war
10+
*.ear
11+
12+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
13+
hs_err_pid*
14+
15+
# Gradle
16+
.gradle
17+
build/
18+
19+
# Ignore Gradle GUI config
20+
gradle-app.setting
21+
22+
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
23+
!gradle/wrapper/gradle-wrapper.jar
24+
25+
# Eclipse
26+
*.pydevproject
27+
.metadata
28+
bin/
29+
tmp/
30+
*.tmp
31+
*.bak
32+
*.swp
33+
*~.nib
34+
local.properties
35+
.settings/
36+
.loadpath
37+
38+
# Eclipse Core
39+
.project
40+
41+
# External tool builders
42+
.externalToolBuilders/
43+
44+
# Locally stored "Eclipse launch configurations"
45+
*.launch
46+
47+
# CDT-specific
48+
.cproject
49+
50+
# JDT-specific (Eclipse Java Development Tools)
51+
.classpath
52+
53+
# Java annotation processor (APT)
54+
.factorypath
55+
56+
# PDT-specific
57+
.buildpath
58+
59+
# sbteclipse plugin
60+
.target
61+
62+
# TeXlipse plugin
63+
.texlipse

Raider/.classpath

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@
66
<attribute name="maven.pomderived" value="true"/>
77
</attributes>
88
</classpathentry>
9-
<classpathentry kind="var" path="wpilib" sourcepath="wpilib.sources"/>
9+
<classpathentry kind="var" path="wpilib" sourcepath="wpilib.sources">
10+
<attributes>
11+
<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="C:/Users/Matthew/wpilib/java/current/lib"/>
12+
</attributes>
13+
</classpathentry>
1014
<classpathentry kind="var" path="networktables" sourcepath="networktables.sources"/>
1115
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
1216
<attributes>

Raider/src/org/usfirst/frc/team4716/robot/commands/Climber/face.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.usfirst.frc.team4716.robot.commands;
1+
package org.usfirst.frc.team4716.robot.commands.Climber;
22

33
import edu.wpi.first.wpilibj.command.Command;
44

Raider/src/org/usfirst/frc/team4716/robot/utils/ConfigClient.java

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
package org.usfirst.frc.team4716.robot.utils;
22

3-
import org.json.*;
4-
import org.usfirst.frc.team4716.robot.RobotMap;
53
import java.io.IOException;
64
import java.io.PrintWriter;
5+
import java.io.StringReader;
76
import java.net.Socket;
8-
import java.util.Scanner;;
7+
import java.util.Scanner;
8+
9+
import org.json.simple.parser.ContainerFactory;
10+
import org.json.simple.parser.JSONParser;
11+
import org.json.simple.parser.ParseException;
12+
import org.usfirst.frc.team4716.robot.RobotMap;
13+
14+
import com.sun.corba.se.impl.io.TypeMismatchException;
915

1016
public class ConfigClient {
1117

@@ -46,16 +52,46 @@ private static void parseBootTimeResult(){
4652
// TODO parse everything
4753
}
4854

55+
@SuppressWarnings("static-access")
4956
private static void parseRuntimeResult(){
5057
// TODO only parse variable such as speed as rate
51-
58+
59+
/**Idk who's code this was, but it was way off...
5260
JSONObject root = new JSONObject(ConfigClient.configJsonText);
5361
//RobotMap.TEST_SPEED = root.getDouble("speed");
5462
System.out.println("OEHHEHEHEHEH : " + root.getDouble("speed"));
63+
5564
// just trying to mess with gyro port for experiment
5665
//RobotMap.gyroPort = root.getJSONObject("sensor_configs")
5766
// .getJSONObject("gyro")
5867
// .getInt("port");
68+
*/
69+
70+
/**Fixed your JSON Parsing, whoever wrote that. Just use the value of testSpeed
71+
* for whatever it was that you were doing.
72+
* @author Matthewacon
73+
*/
74+
JSONParser jsnpars = new JSONParser();
75+
double testSpeed = 0;
76+
try {
77+
Object o = jsnpars.parse(new StringReader(configJsonText), (ContainerFactory)null);
78+
if (!(o instanceof Double)) {
79+
throw new TypeMismatchException();
80+
} else {
81+
testSpeed = (Double)o;
82+
}
83+
} catch (IOException e) {
84+
// TODO Auto-generated catch block
85+
e.printStackTrace();
86+
} catch (ParseException e) {
87+
// TODO Auto-generated catch block
88+
e.printStackTrace();
89+
} catch (TypeMismatchException e) {
90+
e.printStackTrace();
91+
}
92+
//Some deprecated value from the last broken code block?
93+
// RobotMap.TEST_SPEED = testSpeed;
94+
5995
}
6096

6197
private static boolean queryServer() {
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/lib/
2+
/server/
3+
/META-INF/

Raider_Server/target/classes/lib/json-20151123.jar

100755100644
File mode changed.

Raider_Server/target/classes/server/FileServer.class

100755100644
File mode changed.

0 commit comments

Comments
 (0)