mirror of
https://github.com/Team4388/RidgeScout.git
synced 2026-06-09 00:37:59 -06:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 76a1b1ff70 | |||
| 82465f213f | |||
| 3c7a879f51 | |||
| 3157de62ff |
@@ -25,8 +25,8 @@ android {
|
|||||||
applicationId = "com.ridgebotics.ridgescout"
|
applicationId = "com.ridgebotics.ridgescout"
|
||||||
minSdk = 24
|
minSdk = 24
|
||||||
targetSdk = 34
|
targetSdk = 34
|
||||||
versionCode = 12 // **IMPORTANT** Increment this before releasing on github
|
versionCode = 15 // **IMPORTANT** Increment this before releasing on github
|
||||||
versionName = "2.0"// **IMPORTANT** Change this before releasing on github (<Year num since 2024>.<Update Version>)
|
versionName = "3.1"// **IMPORTANT** Change this before releasing on github (<Year num since 2024>.<Update Version>)
|
||||||
|
|
||||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,11 +47,13 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
// Load default match fields
|
// Load default match fields
|
||||||
if(!FileEditor.fileExist(Fields.matchFieldsFilename)){
|
if(!FileEditor.fileExist(Fields.matchFieldsFilename)){
|
||||||
Fields.save(Fields.matchFieldsFilename, Fields.default_match_fields);
|
Fields.save(Fields.matchFieldsFilename, Fields.default_match_fields);
|
||||||
|
FileEditor.toTheArchaicPeriod(Fields.matchFieldsFilename);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load default pit fields
|
// Load default pit fields
|
||||||
if(!FileEditor.fileExist(Fields.pitsFieldsFilename)){
|
if(!FileEditor.fileExist(Fields.pitsFieldsFilename)){
|
||||||
Fields.save(Fields.pitsFieldsFilename, Fields.default_pit_fields);
|
Fields.save(Fields.pitsFieldsFilename, Fields.default_pit_fields);
|
||||||
|
FileEditor.toTheArchaicPeriod(Fields.pitsFieldsFilename);
|
||||||
}
|
}
|
||||||
|
|
||||||
// get time zone for FTP file transfer
|
// get time zone for FTP file transfer
|
||||||
|
|||||||
@@ -30,36 +30,7 @@ public class Fields {
|
|||||||
|
|
||||||
public static final FieldType[][] default_match_fields = new FieldType[][] {
|
public static final FieldType[][] default_match_fields = new FieldType[][] {
|
||||||
{
|
{
|
||||||
new FieldposType(uuid(),"Auto start pos", "Where does the robot start its auto?", new int[]{0,0}),
|
new FieldposType(uuid(),"Auto start pos", "Where does the robot start its auto?", new int[]{0,0})
|
||||||
|
|
||||||
new TallyType(uuid(),"Auto L4 Coral", "How many coral did this robot score in L4 during auto?", 0),
|
|
||||||
new TallyType(uuid(),"Auto L3 Coral", "How many coral did this robot score in L3 during auto?", 0),
|
|
||||||
new TallyType(uuid(),"Auto L2 Coral", "How many coral did this robot score in L2 during auto?", 0),
|
|
||||||
new TallyType(uuid(),"Auto L1/Trough Coral", "How many coral did this robot score in L1 during auto?", 0),
|
|
||||||
new TallyType(uuid(),"Auto Processor Algae", "How many algae did this robot score in the Barge during auto?", 0),
|
|
||||||
new TallyType(uuid(),"Auto Barge Algae", "How many algae did this robot score in the Barge during auto?", 0),
|
|
||||||
|
|
||||||
new DropdownType(uuid(),"Auto Quality", "How did the robot drive during auto?", new String[]{"Smooth", "Jittery"}, 0),
|
|
||||||
new TextType(uuid(),"Auto Comments", "Anything interesting about auto", ""),
|
|
||||||
|
|
||||||
new TallyType(uuid(),"Teleop L4 Coral", "How many coral did this robot score in L4 during auto?", 0),
|
|
||||||
new TallyType(uuid(),"Teleop L3 Coral", "How many coral did this robot score in L3 during auto?", 0),
|
|
||||||
new TallyType(uuid(),"Teleop L2 Coral", "How many coral did this robot score in L2 during auto?", 0),
|
|
||||||
new TallyType(uuid(),"Teleop L1 Coral", "How many coral did this robot score in L1 during auto?", 0),
|
|
||||||
new TallyType(uuid(),"Teleop Processor Algae", "How many algae did this robot score in the Barge during auto?", 0),
|
|
||||||
new TallyType(uuid(),"Teleop Barge Algae", "How many algae did this robot score in the Barge during auto?", 0),
|
|
||||||
|
|
||||||
new CheckboxType(uuid(),"Upper Algae Removal", "Did the robot remove upper Algae?", 0),
|
|
||||||
new CheckboxType(uuid(),"Lower Algae Removal", "Did the robot remove lower Algae?", 0),
|
|
||||||
|
|
||||||
new DropdownType(uuid(),"Teleop Quality", "How did the robot drive during Teleop?", new String[]{"Smooth", "Jittery"}, 0),
|
|
||||||
new TextType(uuid(),"Teleop Comments", "Anything interesting about Teleop", ""),
|
|
||||||
|
|
||||||
new DropdownType(uuid(),"Climb State", "What was the final condition of the robot?", new String[]{"Nothing", "Continued Cycling", "Park", "Attempted Shallow", "Shallow", "Attempted Deep", "Deep"}, 0),
|
|
||||||
|
|
||||||
new DropdownType(uuid(),"Robot Condition", "Was anything broken?", new String[]{"Everything was working", "Something was maybe broken", "Something was broken", "Robot was disabled for part of the match", "Missing robot"}, 0),
|
|
||||||
|
|
||||||
new TextType(uuid(),"Other Comments", "Any other comments you have", "")
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -69,14 +40,6 @@ public class Fields {
|
|||||||
new DropdownType(uuid(),"Intake type", "What type of intake does this team have?", new String[]{"Ground only", "Player Station only", "Both", "Other, Info in comments"}, 0),
|
new DropdownType(uuid(),"Intake type", "What type of intake does this team have?", new String[]{"Ground only", "Player Station only", "Both", "Other, Info in comments"}, 0),
|
||||||
new DropdownType(uuid(),"Intake Consistency", "How consistent is the robot at intakeing?", new String[]{"Does not work", "Worked a few times during testing", "Works most of the time", "Fails sometimes", "Never fails"}, 0),
|
new DropdownType(uuid(),"Intake Consistency", "How consistent is the robot at intakeing?", new String[]{"Does not work", "Worked a few times during testing", "Works most of the time", "Fails sometimes", "Never fails"}, 0),
|
||||||
|
|
||||||
new DropdownType(uuid(),"Score Area", "What does this robot score?", new String[]{"Only Algae", "Mostly Algae", "Both", "Mostly Coral", "Only Coral"}, 0),
|
|
||||||
|
|
||||||
new CheckboxType(uuid(),"L4 Scoring", "Will the robot score in Layer 4?", 0),
|
|
||||||
new CheckboxType(uuid(),"L3 Scoring", "Will the robot score in Layer 3?", 0),
|
|
||||||
new CheckboxType(uuid(),"L2 Scoring", "Will the robot score in Layer 3?", 0),
|
|
||||||
new CheckboxType(uuid(),"L1/Trough Scoring", "Will the robot score in Layer 1?", 0),
|
|
||||||
new CheckboxType(uuid(),"Processor Scoring", "Will the robot score in the Processor?", 0),
|
|
||||||
new CheckboxType(uuid(),"Barge Scoring", "Will the robot score algae in the Barge?", 0),
|
|
||||||
new DropdownType(uuid(),"Scoring Consistency", "How consistent is the robot at Scoring?", new String[]{"Does not work", "Worked a few times during testing", "Works most of the time", "Fails sometimes", "Never fails"}, 0),
|
new DropdownType(uuid(),"Scoring Consistency", "How consistent is the robot at Scoring?", new String[]{"Does not work", "Worked a few times during testing", "Works most of the time", "Fails sometimes", "Never fails"}, 0),
|
||||||
|
|
||||||
new TextType(uuid(),"Auto Capability", "What autos does this team have?", ""),
|
new TextType(uuid(),"Auto Capability", "What autos does this team have?", ""),
|
||||||
|
|||||||
@@ -174,23 +174,24 @@ public class HttpSync extends Thread {
|
|||||||
|
|
||||||
TransferFile localFile = findInFileArray(localFiles, remoteFile.filename);
|
TransferFile localFile = findInFileArray(localFiles, remoteFile.filename);
|
||||||
|
|
||||||
boolean shouldUpload;
|
boolean shouldDownload;
|
||||||
|
|
||||||
// If there is no file on the sever, upload.
|
// If there is no file on the sever, upload.
|
||||||
if(localFile == null) {
|
if(localFile == null) {
|
||||||
shouldUpload = true;
|
shouldDownload = true;
|
||||||
} else {
|
} else {
|
||||||
// If the remote file is the same as the local one, do nothing.
|
// If the remote file is the same as the local one, do nothing.
|
||||||
boolean checksumsEqual = !Objects.equals(localFile.checksum, remoteFile.checksum);
|
|
||||||
|
boolean checksumsNotEqual = !Objects.equals(localFile.checksum, remoteFile.checksum);
|
||||||
// If the local file is updated after the remote file
|
// If the local file is updated after the remote file
|
||||||
boolean after = after(remoteFile.updated, localFile.updated);
|
boolean after = after(remoteFile.updated, localFile.updated);
|
||||||
// If the local file and remote file's upload dates are exactly the same
|
// If the local file and remote file's upload dates are exactly the same
|
||||||
boolean datesEqual = !localFile.updated.equals(remoteFile.updated);
|
boolean datesNotEqual = !localFile.updated.equals(remoteFile.updated);
|
||||||
|
|
||||||
shouldUpload = (!checksumsEqual && (after) && !datesEqual);
|
shouldDownload = checksumsNotEqual && after;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(shouldUpload) {
|
if(shouldDownload) {
|
||||||
downloadFile(remoteFile, serverIP);
|
downloadFile(remoteFile, serverIP);
|
||||||
// await();
|
// await();
|
||||||
Log.d(getClass().toString(), "RemoteFile: " + remoteFile.filename + ", " + remoteFile.checksum + ", " + remoteFile.updated + ": Downloaded");
|
Log.d(getClass().toString(), "RemoteFile: " + remoteFile.filename + ", " + remoteFile.checksum + ", " + remoteFile.updated + ": Downloaded");
|
||||||
|
|||||||
@@ -263,6 +263,11 @@ public final class FileEditor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Sets the date modified to a long, long time ago
|
||||||
|
public static boolean toTheArchaicPeriod(String name) {
|
||||||
|
return new File(baseDir + name).setLastModified(0);
|
||||||
|
}
|
||||||
|
|
||||||
public static boolean createFile(String filepath){
|
public static boolean createFile(String filepath){
|
||||||
if(fileExist(filepath)){
|
if(fileExist(filepath)){
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user