Skip to content

Commit

Permalink
Update data object models; refactor packages
Browse files Browse the repository at this point in the history
  • Loading branch information
spencerng committed Feb 3, 2019
1 parent 7fb4cd7 commit 3bbe719
Show file tree
Hide file tree
Showing 17 changed files with 118 additions and 75 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
import javafx.scene.control.*;
import javafx.scene.text.Text;
import javafx.stage.DirectoryChooser;
import org.usfirst.frc.team25.scouting.client.data.BlueAlliance;
import org.usfirst.frc.team25.scouting.client.data.EventReport;
import org.usfirst.frc.team25.scouting.client.data.FileManager;
import org.usfirst.frc.team25.scouting.client.models.ScoutEntry;
import org.usfirst.frc.team25.scouting.data.BlueAlliance;
import org.usfirst.frc.team25.scouting.data.EventReport;
import org.usfirst.frc.team25.scouting.data.FileManager;
import org.usfirst.frc.team25.scouting.data.models.ScoutEntry;

import java.io.File;
import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
import org.usfirst.frc.team25.scouting.client.data.BlueAlliance;
import org.usfirst.frc.team25.scouting.data.BlueAlliance;

public class Main extends Application {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.usfirst.frc.team25.scouting.client.data;
package org.usfirst.frc.team25.scouting.data;

/**
* Class for alliance-based calculations and stats
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.usfirst.frc.team25.scouting.client.data;
package org.usfirst.frc.team25.scouting.data;

import com.google.gson.Gson;
import com.thebluealliance.api.v3.TBA;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package org.usfirst.frc.team25.scouting.client.data;
package org.usfirst.frc.team25.scouting.data;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.thebluealliance.api.v3.models.Match;
import com.thebluealliance.api.v3.models.MatchScoreBreakdown2018Alliance;
import org.usfirst.frc.team25.scouting.client.models.*;
import org.usfirst.frc.team25.scouting.data.models.*;

import java.io.File;
import java.io.FileNotFoundException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package org.usfirst.frc.team25.scouting.client.data;
package org.usfirst.frc.team25.scouting.data;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.thebluealliance.api.v3.models.Match;
import org.usfirst.frc.team25.scouting.client.models.ScoutEntry;
import org.usfirst.frc.team25.scouting.data.models.ScoutEntry;

import java.io.File;
import java.io.FileNotFoundException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.usfirst.frc.team25.scouting.client.data;
package org.usfirst.frc.team25.scouting.data;

import org.usfirst.frc.team25.scouting.client.models.Comparison;
import org.usfirst.frc.team25.scouting.client.models.RankingTree;
import org.usfirst.frc.team25.scouting.client.models.ScoutEntry;
import org.usfirst.frc.team25.scouting.data.models.Comparison;
import org.usfirst.frc.team25.scouting.data.models.RankingTree;
import org.usfirst.frc.team25.scouting.data.models.ScoutEntry;

import java.io.File;
import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.usfirst.frc.team25.scouting.client.data;
package org.usfirst.frc.team25.scouting.data;

import com.thebluealliance.api.v3.models.Match;
import com.thebluealliance.api.v3.models.SimpleMatch;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.usfirst.frc.team25.scouting.client.data;
package org.usfirst.frc.team25.scouting.data;

import java.math.BigDecimal;
import java.math.RoundingMode;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.usfirst.frc.team25.scouting.client.data;
package org.usfirst.frc.team25.scouting.data;

import org.usfirst.frc.team25.scouting.client.models.ScoutEntry;
import org.usfirst.frc.team25.scouting.data.models.ScoutEntry;

import java.io.File;
import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package org.usfirst.frc.team25.scouting.client.models;
package org.usfirst.frc.team25.scouting.data.models;


/**
* Object model for autonomous period of a match
Expand All @@ -15,11 +16,17 @@ public class Autonomous {
private boolean opponentCargoShipLineFoul;
private boolean sideCargoShipHatchCapable;
private boolean frontCargoShipHatchCapable;
private boolean cargoDroppedCargoShip;
private boolean cargoDroppedRocket;
private boolean hatchesDroppedRocket;
private boolean hatchesDroppedCargoShip;

public Autonomous(int rocketCargo, int rocketHatches, int cargoShipHatches,
int cargoShipCargo, int hatchesDropped, int cargoDropped,
boolean reachHabLine, boolean opponentCargoShipLineFoul,
boolean sideCargoShipHatchCapable, boolean frontCargoShipHatchCapable) {
boolean sideCargoShipHatchCapable, boolean frontCargoShipHatchCapable,
boolean cargoDroppedCargoShip, boolean cargoDroppedRocket,
boolean hatchesDroppedRocket, boolean hatchesDroppedCargoShip) {
this.rocketCargo = rocketCargo;
this.rocketHatches = rocketHatches;
this.cargoShipHatches = cargoShipHatches;
Expand All @@ -30,6 +37,22 @@ public Autonomous(int rocketCargo, int rocketHatches, int cargoShipHatches,
this.opponentCargoShipLineFoul = opponentCargoShipLineFoul;
this.sideCargoShipHatchCapable = sideCargoShipHatchCapable;
this.frontCargoShipHatchCapable = frontCargoShipHatchCapable;
this.cargoDroppedCargoShip = cargoDroppedCargoShip;
this.cargoDroppedRocket = cargoDroppedRocket;
this.hatchesDroppedRocket = hatchesDroppedRocket;
this.hatchesDroppedCargoShip = hatchesDroppedCargoShip;
}

public void setRocketCargo(int rocketCargo) {
this.rocketCargo = rocketCargo;
}

public void setRocketHatches(int rocketHatches) {
this.rocketHatches = rocketHatches;
}

public void setCargoShipHatches(int cargoShipHatches) {
this.cargoShipHatches = cargoShipHatches;
}

public void setHatchesDropped(int hatchesDropped) {
Expand All @@ -48,40 +71,44 @@ public void setOpponentCargoShipLineFoul(boolean opponentCargoShipLineFoul) {
this.opponentCargoShipLineFoul = opponentCargoShipLineFoul;
}

public int getRocketCargo() {
return rocketCargo;
public void setCargoShipCargo(int cargoShipCargo) {
this.cargoShipCargo = cargoShipCargo;
}

public void setRocketCargo(int rocketCargo) {
this.rocketCargo = rocketCargo;
public void setFrontCargoShipHatchCapable(boolean frontCargoShipHatchCapable) {
this.frontCargoShipHatchCapable = frontCargoShipHatchCapable;
}

public int getRocketHatches() {
return rocketHatches;
public boolean isSideCargoShipHatchCapable() {
return sideCargoShipHatchCapable;
}

public void setRocketHatches(int rocketHatches) {
this.rocketHatches = rocketHatches;
public void setSideCargoShipHatchCapable(boolean sideCargoShipHatchCapable) {
this.sideCargoShipHatchCapable = sideCargoShipHatchCapable;
}

public int getCargoShipHatches() {
return cargoShipHatches;
public boolean isCargoDroppedCargoShip() {
return cargoDroppedCargoShip;
}

public void setCargoShipHatches(int cargoShipHatches) {
this.cargoShipHatches = cargoShipHatches;
public void setCargoDroppedCargoShip(boolean cargoDroppedCargoShip) {
this.cargoDroppedCargoShip = cargoDroppedCargoShip;
}

public int getCargoShipCargo() {
return cargoShipCargo;
public int getRocketCargo() {
return rocketCargo;
}

public void setCargoShipCargo(int cargoShipCargo) {
this.cargoShipCargo = cargoShipCargo;
public int getRocketHatches() {
return rocketHatches;
}

public boolean isSideCargoShipHatchCapable() {
return sideCargoShipHatchCapable;
public int getCargoShipHatches() {
return cargoShipHatches;
}

public int getCargoShipCargo() {
return cargoShipCargo;
}

public int getHatchesDropped() {
Expand All @@ -100,15 +127,31 @@ public boolean isOpponentCargoShipLineFoul() {
return opponentCargoShipLineFoul;
}

public void setSideCargoShipHatchCapable(boolean sideCargoShipHatchCapable) {
this.sideCargoShipHatchCapable = sideCargoShipHatchCapable;
public boolean isCargoDroppedRocket() {
return cargoDroppedRocket;
}

public boolean isFrontCargoShipHatchCapable() {
return frontCargoShipHatchCapable;
}

public void setFrontCargoShipHatchCapable(boolean frontCargoShipHatchCapable) {
this.frontCargoShipHatchCapable = frontCargoShipHatchCapable;
public void setCargoDroppedRocket(boolean cargoDroppedRocket) {
this.cargoDroppedRocket = cargoDroppedRocket;
}

public boolean isHatchesDroppedRocket() {
return hatchesDroppedRocket;
}

public void setHatchesDroppedRocket(boolean hatchesDroppedRocket) {
this.hatchesDroppedRocket = hatchesDroppedRocket;
}

public boolean isHatchesDroppedCargoShip() {
return hatchesDroppedCargoShip;
}

public void setHatchesDroppedCargoShip(boolean hatchesDroppedCargoShip) {
this.hatchesDroppedCargoShip = hatchesDroppedCargoShip;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.usfirst.frc.team25.scouting.client.models;
package org.usfirst.frc.team25.scouting.data.models;

/**
* Class that holds a comparison between two teams
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.usfirst.frc.team25.scouting.client.models;
package org.usfirst.frc.team25.scouting.data.models;

import java.util.HashMap;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.usfirst.frc.team25.scouting.client.models;
package org.usfirst.frc.team25.scouting.data.models;


/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.usfirst.frc.team25.scouting.client.models;
package org.usfirst.frc.team25.scouting.data.models;

import org.usfirst.frc.team25.scouting.client.data.Sorters;
import org.usfirst.frc.team25.scouting.data.Sorters;

import java.util.ArrayList;
import java.util.HashMap;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.usfirst.frc.team25.scouting.client.models;
package org.usfirst.frc.team25.scouting.data.models;


import java.io.Serializable;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.usfirst.frc.team25.scouting.client.models;
package org.usfirst.frc.team25.scouting.data.models;


/**
Expand All @@ -7,32 +7,32 @@
*/
public class TeleOp {

private final int cargoShipHatches;
private final int cargoShipCargo;
private final int rocketLevelOneCargo;
private final int rocketLevelOneHatches;
private final int rocketLevelTwoCargo;
private final int rocketLevelTwoHatches;
private final int rocketLevelThreeCargo;
private final int rocketLevelThreeHatches;
private final int hatchesDropped;
private final int cargoDropped;

private final boolean climbAssistedByPartners;
private final int attemptHabClimbLevel;
private final int successHabClimbLevel;
private final boolean attemptHabClimb;
private final boolean successHabClimb;
private final int assistingClimbTeamNumber;
private final int otherRobotClimbsAssisted;
private final int highestClimbAssisted;
private int cargoShipHatches;
private int cargoShipCargo;
private int rocketLevelOneCargo;
private int rocketLevelOneHatches;
private int rocketLevelTwoCargo;
private int rocketLevelTwoHatches;
private int rocketLevelThreeCargo;
private int rocketLevelThreeHatches;
private int hatchesDropped;
private int cargoDropped;

private boolean climbAssistedByPartners;
private int attemptHabClimbLevel;
private int successHabClimbLevel;
private boolean attemptHabClimb;
private boolean successHabClimb;
private int assistingClimbTeamNumber;
private int numberOfPartnerClimbsAssisted;
private int highestClimbAssisted;

public TeleOp(int cargoShipHatches, int cargoShipCargo, int rocketLevelOneCargo,
int rocketLevelOneHatches, int rocketLevelTwoCargo, int rocketLevelTwoHatches,
int rocketLevelThreeCargo, int rocketLevelThreeHatches, int hatchesDropped,
int cargoDropped, boolean climbAssistedByPartners, int attemptHabClimbLevel,
int successHabClimbLevel, boolean attemptHabClimb, boolean successHabClimb,
int assistingClimbTeamNumber, int otherRobotClimbsAssisted,
int assistingClimbTeamNumber, int numberOfPartnerClimbsAssisted,
int highestClimbAssisted) {
this.cargoShipHatches = cargoShipHatches;
this.cargoShipCargo = cargoShipCargo;
Expand All @@ -50,7 +50,7 @@ public TeleOp(int cargoShipHatches, int cargoShipCargo, int rocketLevelOneCargo,
this.attemptHabClimb = attemptHabClimb;
this.successHabClimb = successHabClimb;
this.assistingClimbTeamNumber = assistingClimbTeamNumber;
this.otherRobotClimbsAssisted = otherRobotClimbsAssisted;
this.numberOfPartnerClimbsAssisted = numberOfPartnerClimbsAssisted;
this.highestClimbAssisted = highestClimbAssisted;
}

Expand Down Expand Up @@ -118,11 +118,11 @@ public int getAssistingClimbTeamNumber() {
return assistingClimbTeamNumber;
}

public int getOtherRobotClimbsAssisted() {
return otherRobotClimbsAssisted;
public int getNumberOfPartnerClimbsAssisted() {
return numberOfPartnerClimbsAssisted;
}

public int getHighestClimbAssisted() {
return highestClimbAssisted;
}
}
}

0 comments on commit 3bbe719

Please sign in to comment.