mirror of
https://github.com/Team4388/RidgeScout.git
synced 2026-06-08 16:28:00 -06:00
@@ -1,5 +1,9 @@
|
||||
package com.ridgebotics.ridgescout.types.data;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public abstract class dataType {
|
||||
public enum valueTypes {
|
||||
NUM,
|
||||
|
||||
@@ -219,5 +219,9 @@ public class checkboxType extends inputType {
|
||||
chart.invalidate();
|
||||
parent.addView(chart);
|
||||
}
|
||||
|
||||
public String toString(dataType data){
|
||||
return (int) data.get() == 1 ? "true" : "false";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -245,5 +245,9 @@ public class dropdownType extends inputType {
|
||||
chart.invalidate();
|
||||
parent.addView(chart);
|
||||
}
|
||||
|
||||
public String toString(dataType data){
|
||||
return text_options[(int) data.get()];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -232,5 +232,10 @@ public class fieldposType extends inputType {
|
||||
|
||||
parent.addView(chart);
|
||||
}
|
||||
|
||||
public String toString(dataType data){
|
||||
int[] intarr = (int[]) data.get();
|
||||
return "[" + intarr[0] + "," + intarr[1] + "]";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -107,4 +107,7 @@ public abstract class inputType {
|
||||
|
||||
|
||||
public abstract void add_history_view(LinearLayout parent, dataType[] data);
|
||||
|
||||
|
||||
public abstract String toString(dataType data);
|
||||
}
|
||||
@@ -318,5 +318,9 @@ public class numberType extends inputType {
|
||||
|
||||
parent.addView(chart);
|
||||
}
|
||||
|
||||
public String toString(dataType data){
|
||||
return String.valueOf((int) data.get());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -305,4 +305,8 @@ public class sliderType extends inputType {
|
||||
|
||||
parent.addView(chart);
|
||||
}
|
||||
|
||||
public String toString(dataType data){
|
||||
return String.valueOf((int) data.get());
|
||||
}
|
||||
}
|
||||
@@ -298,5 +298,9 @@ public class tallyType extends inputType {
|
||||
|
||||
parent.addView(chart);
|
||||
}
|
||||
|
||||
public String toString(dataType data){
|
||||
return String.valueOf((int) data.get());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -230,5 +230,9 @@ public class textType extends inputType {
|
||||
parent.addView(chart);
|
||||
|
||||
}
|
||||
|
||||
public String toString(dataType data){
|
||||
return String.valueOf(data.get());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ import com.ridgebotics.ridgescout.scoutingData.ScoutingDataWriter;
|
||||
import com.ridgebotics.ridgescout.types.data.dataType;
|
||||
import com.ridgebotics.ridgescout.types.frcMatch;
|
||||
import com.ridgebotics.ridgescout.types.frcTeam;
|
||||
import com.ridgebotics.ridgescout.types.input.inputType;
|
||||
import com.ridgebotics.ridgescout.utility.DataManager;
|
||||
import com.ridgebotics.ridgescout.utility.fileEditor;
|
||||
|
||||
@@ -59,11 +60,14 @@ public class CSVExport {
|
||||
data += ("null,".repeat(match_latest_values.length));
|
||||
}else{
|
||||
try {
|
||||
String tempData = "";
|
||||
ScoutingDataWriter.ParsedScoutingDataResult psdr = ScoutingDataWriter.load(filename, DataManager.match_values, DataManager.match_transferValues);
|
||||
dataType[] types = psdr.data.array;
|
||||
dataType[] matchData = psdr.data.array;
|
||||
inputType[] types = psdr.data.values[psdr.data.values.length-1];
|
||||
for (int i = 0; i < types.length; i++) {
|
||||
data += (safeCSV(types[i].get().toString()) + ",");
|
||||
tempData += (safeCSV(types[i].toString(matchData[i])) + ",");
|
||||
}
|
||||
data += tempData;
|
||||
} catch (Exception e){
|
||||
e.printStackTrace();
|
||||
data += ("null,".repeat(pit_latest_values.length));
|
||||
@@ -108,11 +112,14 @@ public class CSVExport {
|
||||
data += ("null,".repeat(pit_latest_values.length));
|
||||
}else{
|
||||
try {
|
||||
String tempData = "";
|
||||
ScoutingDataWriter.ParsedScoutingDataResult psdr = ScoutingDataWriter.load(filename, DataManager.pit_values, DataManager.pit_transferValues);
|
||||
dataType[] types = psdr.data.array;
|
||||
dataType[] teamData = psdr.data.array;
|
||||
inputType[] types = psdr.data.values[psdr.data.values.length-1];
|
||||
for (int i = 0; i < types.length; i++) {
|
||||
data += (safeCSV(types[i].get().toString()) + ",");
|
||||
tempData += (safeCSV(types[i].toString(teamData[i])) + ",");
|
||||
}
|
||||
data += tempData;
|
||||
} catch (Exception e){
|
||||
e.printStackTrace();
|
||||
data += ("null,".repeat(pit_latest_values.length));
|
||||
|
||||
Reference in New Issue
Block a user