mirror of
https://github.com/Team4388/RidgeScout.git
synced 2026-06-08 16:28:00 -06:00
Some changes
This commit is contained in:
@@ -25,10 +25,10 @@ public class ScoutingDataWriter {
|
||||
for(int i = 0; i < data.length; i++){
|
||||
switch (data[i].getValueType()){
|
||||
case NUM:
|
||||
bb.addInt((int) data[i].get());
|
||||
bb.addInt((int) data[i].forceGetValue());
|
||||
break;
|
||||
case STRING:
|
||||
bb.addString((String) data[i].get());
|
||||
bb.addString((String) data[i].forceGetValue());
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -62,12 +62,12 @@ public class ScoutingDataWriter {
|
||||
for(int i = 0; i < values[version].length; i++){
|
||||
switch (objects.get(i+2).getType()){
|
||||
case 1:
|
||||
dataTypes[i] = new intType(values[version][i].name, (int) objects.get(i+2).get());
|
||||
dataTypes[i] = intType.newNull(values[version][i].name);
|
||||
dataTypes[i].forceSetValue(objects.get(i+2).get());
|
||||
break;
|
||||
case 2:
|
||||
String name = values[version][i].name;
|
||||
String value = (String) objects.get(i+2).get();
|
||||
dataTypes[i] = new stringType(name, value);
|
||||
dataTypes[i] = stringType.newNull(values[version][i].name);
|
||||
dataTypes[i].forceSetValue(objects.get(i+2).get());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ public class fields {
|
||||
new sliderType("Overall Driving Performance", 5, 1, 10),
|
||||
new textType("Overall Driving Comments", "None"),
|
||||
new sliderType("Score area (AMP <-> Speaker)", 5, 1, 10),
|
||||
new dropdownType("End Condition", new String[]{"Nothing", "Attempted Climb", "Successful Climbed", "Climbed with multiple robots", "Climbed with trapz"}, 1),
|
||||
new dropdownType("End Condition", new String[]{"Nothing", "Attempted Climb", "Successful Climbed", "Climbed with multiple robots", "Climbed with trap"}, 1),
|
||||
new dropdownType("Robot Condition", new String[]{"Everything was working", "Something seemed to be broken", "Something was broken", "Missing robot (Joe Johnson)"}, 1),
|
||||
new textType("Other Comments", "None")
|
||||
}
|
||||
|
||||
@@ -16,11 +16,11 @@ public class intType extends dataType {
|
||||
// }
|
||||
|
||||
public Object get(){
|
||||
return (int) forceGetValue()+2;
|
||||
return (int) forceGetValue()-2;
|
||||
}
|
||||
|
||||
public void set(Object value){
|
||||
forceSetValue((int) value - 2);
|
||||
forceSetValue((int) value + 2);
|
||||
}
|
||||
|
||||
public intType(String name, int value) {
|
||||
|
||||
@@ -25,7 +25,7 @@ public class stringType extends dataType{
|
||||
|
||||
public stringType(String name, String value) {
|
||||
super(name);
|
||||
forceSetValue(value+2);
|
||||
forceSetValue(value);
|
||||
}
|
||||
|
||||
public static stringType newNull(String name){
|
||||
|
||||
@@ -115,7 +115,7 @@ public class dropdownType extends inputType {
|
||||
// });
|
||||
return dropdown;
|
||||
|
||||
};
|
||||
}
|
||||
public void setViewValue(Object value) {
|
||||
if(dropdown == null) return;
|
||||
if(intType.isNull((int) value)){
|
||||
|
||||
@@ -33,7 +33,7 @@ public class tallyType extends inputType {
|
||||
public String get_type_name(){return "Dropdown";}
|
||||
public tallyType(String name, int default_value){
|
||||
super(name);
|
||||
this.default_value = default_value;
|
||||
this.default_value = default_value+2;
|
||||
}
|
||||
|
||||
|
||||
@@ -73,14 +73,14 @@ public class tallyType extends inputType {
|
||||
public void setViewValue(Object value) {
|
||||
if(tally == null) return;
|
||||
System.out.println(value);
|
||||
if(((int)value) == 0){
|
||||
if((int)value == intType.nullval || (int)value == intType.unselectedval){
|
||||
nullify();
|
||||
return;
|
||||
}
|
||||
|
||||
isBlank = false;
|
||||
tally.setVisibility(View.VISIBLE);
|
||||
tally.setValue((int)value);
|
||||
tally.setValue((int) value-2);
|
||||
}
|
||||
public void nullify(){
|
||||
isBlank = true;
|
||||
|
||||
+1
-1
@@ -303,7 +303,7 @@ public class MatchScoutingFragment extends Fragment {
|
||||
|
||||
for(int i = 0; i < DataManager.match_latest_values.length; i++){
|
||||
// types[i] = latest_values[i].getViewValue();
|
||||
DataManager.match_latest_values[i].setViewValue(types[i]);
|
||||
DataManager.match_latest_values[i].setViewValue(types[i].get());
|
||||
|
||||
if(DataManager.match_latest_values[i].isBlank){
|
||||
titles[i].setBackgroundColor(0xffff0000);
|
||||
|
||||
Reference in New Issue
Block a user