Some random bugfixes and changes

This commit is contained in:
Astatin3
2024-08-01 11:54:46 -06:00
parent 230ba0857b
commit 96cdda23ca
17 changed files with 129 additions and 102 deletions
+3 -4
View File
@@ -3,11 +3,11 @@ Ridgebotics 2025 scouting app in Android
## TODO:
#### Scouting:
- Make the "Compile" menu
- The compile menu should be a shortcut to view all the team's stats from the upcoming match, from the teams view
- Make the "Compare" menu, cross comparing team's stats.
- Make the "Report" menu, A tool that lets users select data to display from the the teams and compare menus.
- Make practice mode
#### Data Analysis:
- Add CSV exporting
- Add CSV exporting of match scouting data.
- Statbotics intigration
- AI overview of scouting data for a team???
#### Functionality:
@@ -18,7 +18,6 @@ Ridgebotics 2025 scouting app in Android
## In Progress:
#### Scouting:
#### Data Analysis:
- Make a word cloud for the compiled mode of text input type
#### Functionality:
- Make pit and match data field builder UIs. I don't want to have to keep editing a variable
- Test the scouting app
@@ -1,44 +1,44 @@
package com.astatin3.scoutingapp2025.types;
import androidx.annotation.NonNull;
import com.astatin3.scoutingapp2025.utility.AlertManager;
import com.astatin3.scoutingapp2025.utility.BuiltByteParser;
import com.astatin3.scoutingapp2025.utility.ByteBuilder;
import java.util.ArrayList;
public class frcEvent {
public static final int typecode = 254;
public String eventCode;
public String name;
public ArrayList<frcMatch> matches;
public ArrayList<frcTeam> teams;
public byte[] encode(){
public byte[] encode() {
try {
ByteBuilder bb = new ByteBuilder()
.addString(eventCode)
.addString(name);
for(frcTeam teams : teams){
for (frcTeam teams : teams) {
bb.addRaw(frcTeam.typecode, teams.encode());
}
for(frcMatch match : matches){
for (frcMatch match : matches) {
bb.addRaw(frcMatch.typecode, match.encode());
}
return bb.build();
} catch (ByteBuilder.buildingException e) {
AlertManager.error(e);
return null;
}
}
public static frcEvent decode(byte[] bytes){
try{
ArrayList<BuiltByteParser.parsedObject> objects = new BuiltByteParser(bytes).parse();
public static frcEvent decode(byte[] bytes) {
try {
ArrayList<BuiltByteParser.parsedObject> objects =
new BuiltByteParser(bytes).parse();
frcEvent frc = new frcEvent();
@@ -48,23 +48,32 @@ public class frcEvent {
frc.matches = new ArrayList<>();
frc.teams = new ArrayList<>();
for(BuiltByteParser.parsedObject object : objects){
if(object.getType() == frcTeam.typecode){
for (BuiltByteParser.parsedObject object : objects) {
if (object.getType() == frcTeam.typecode) {
frc.teams.add(frcTeam.decode((byte[]) object.get()));
}else if(object.getType() == frcMatch.typecode){
} else if (object.getType() == frcMatch.typecode) {
frc.matches.add(frcMatch.decode((byte[]) object.get()));
}
}
return frc;
}catch (BuiltByteParser.byteParsingExeption e){
} catch (BuiltByteParser.byteParsingExeption e) {
AlertManager.error(e);
return null;
}
}
@NonNull
public String toString(){
return "frcEvent Name: " + name + ", Code: " + eventCode + " numTeams: " + teams.size() + " numMatches: " + matches.size();
public String toString() {
return (
"frcEvent Name: " +
name +
", Code: " +
eventCode +
" numTeams: " +
teams.size() +
" numMatches: " +
matches.size()
);
}
}
@@ -82,18 +82,21 @@ public class dropdownType extends inputType {
iconSpinnerItems.add(new IconSpinnerItem(text_options[i]));
}
IconSpinnerAdapter iconSpinnerAdapter = new IconSpinnerAdapter(dropdown);
dropdown.setGravity(Gravity.CENTER);
dropdown.setSpinnerAdapter(iconSpinnerAdapter);
dropdown.setItems(iconSpinnerItems);
dropdown.selectItemByIndex((int) default_value);
dropdown.setPadding(10,10,10,10);
dropdown.setPadding(10,20,10,20);
dropdown.setBackgroundColor(0xf0000000);
dropdown.setTextColor(0xff00ff00);
dropdown.setTextSize(15);
dropdown.setTextSize(14.5f);
dropdown.setArrowGravity(SpinnerGravity.END);
dropdown.setArrowPadding(8);
dropdown.setSpinnerItemHeight(46);
// dropdown.setSpinnerItemHeight(46);
dropdown.setSpinnerPopupElevation(14);
@@ -1,5 +1,8 @@
package com.astatin3.scoutingapp2025.ui;
import static com.astatin3.scoutingapp2025.utility.DataManager.evcode;
import static com.astatin3.scoutingapp2025.utility.DataManager.event;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
@@ -18,6 +21,7 @@ import com.astatin3.scoutingapp2025.databinding.FragmentTeamSelectorBinding;
import com.astatin3.scoutingapp2025.types.frcEvent;
import com.astatin3.scoutingapp2025.types.frcTeam;
import com.astatin3.scoutingapp2025.utility.AlertManager;
import com.astatin3.scoutingapp2025.utility.DataManager;
import com.astatin3.scoutingapp2025.utility.fileEditor;
import java.util.Arrays;
@@ -25,13 +29,6 @@ import java.util.Arrays;
public class TeamSelectorFragment extends Fragment {
private FragmentTeamSelectorBinding binding;
private String evcode;
private static frcEvent event;
public static void setEvent(frcEvent tmpevent){
event = tmpevent;
}
private static boolean pits_mode;
public static void setPits_mode(boolean mode){
pits_mode = mode;
@@ -52,7 +49,7 @@ public class TeamSelectorFragment extends Fragment {
binding = FragmentTeamSelectorBinding.inflate(inflater, container, false);
// event = fileEditor.g
evcode = latestSettings.settings.get_evcode();
DataManager.reload_event();
if(evcode == null || evcode.equals("unset")){
AlertManager.error("You somehow have not loaded an event!");
@@ -9,15 +9,15 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import com.astatin3.scoutingapp2025.databinding.FragmentDataCompileBinding;
import com.astatin3.scoutingapp2025.databinding.FragmentDataReportBinding;
public class CompileFragment extends Fragment {
FragmentDataCompileBinding binding;
public class ReportFragment extends Fragment {
FragmentDataReportBinding binding;
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
binding = FragmentDataCompileBinding.inflate(inflater, container, false);
binding = FragmentDataReportBinding.inflate(inflater, container, false);
return binding.getRoot();
}
@@ -96,13 +96,13 @@ public class TeamsFragment extends Fragment {
dropdown.selectItemByIndex(0);
dropdown.setPadding(15,15,15,15);
dropdown.setPadding(10,20,10,20);
dropdown.setBackgroundColor(0xf0000000);
dropdown.setTextColor(0xff00ff00);
dropdown.setTextSize(15);
dropdown.setArrowGravity(SpinnerGravity.END);
dropdown.setArrowPadding(8);
dropdown.setSpinnerItemHeight(46);
// dropdown.setSpinnerItemHeight(46);
dropdown.setSpinnerPopupElevation(14);
@@ -41,9 +41,9 @@ public class dataFragment extends Fragment {
binding.noEventError.setVisibility(View.VISIBLE);
binding.buttons.setVisibility(View.VISIBLE);
binding.statusButton.setVisibility(View.GONE);
binding.teamsButton.setVisibility(View.GONE);
binding.compileButton.setVisibility(View.GONE);
binding.compareButton.setVisibility(View.GONE);
binding.reportButton.setVisibility(View.GONE);
binding.fieldsButton.setVisibility(View.VISIBLE);
@@ -52,12 +52,7 @@ public class dataFragment extends Fragment {
frcEvent event = frcEvent.decode(fileEditor.readFile(evcode + ".eventdata"));
binding.statusButton.setOnClickListener(v -> {
findNavController(this).navigate(R.id.action_navigation_data_to_navigation_data_status);
});
binding.teamsButton.setOnClickListener(v -> {
TeamSelectorFragment.setEvent(event);
TeamSelectorFragment.setPits_mode(false);
TeamSelectorFragment.setOnSelect(new TeamSelectorFragment.onTeamSelected() {
@Override
@@ -69,7 +64,7 @@ public class dataFragment extends Fragment {
findNavController(this).navigate(R.id.action_navigation_data_to_navigation_team_selector);
});
binding.compileButton.setOnClickListener(v -> {
binding.reportButton.setOnClickListener(v -> {
findNavController(this).navigate(R.id.action_navigation_data_to_navigation_data_compile);
});
@@ -1,5 +1,6 @@
package com.astatin3.scoutingapp2025.ui.scouting;
import static com.astatin3.scoutingapp2025.utility.DataManager.evcode;
import static com.astatin3.scoutingapp2025.utility.DataManager.pit_latest_values;
import static com.astatin3.scoutingapp2025.utility.DataManager.pit_transferValues;
import static com.astatin3.scoutingapp2025.utility.DataManager.pit_values;
@@ -54,7 +55,6 @@ public class PitScoutingFragment extends Fragment {
boolean edited = false;
String evcode;
String filename;
String username;
@@ -53,7 +53,6 @@ public class ScoutingFragment extends Fragment {
});
binding.pitScoutingButton.setOnClickListener(v -> {
TeamSelectorFragment.setEvent(event);
TeamSelectorFragment.setPits_mode(true);
TeamSelectorFragment.setOnSelect(new TeamSelectorFragment.onTeamSelected() {
@Override
@@ -65,6 +64,10 @@ public class ScoutingFragment extends Fragment {
findNavController(this).navigate(R.id.action_navigation_scouting_to_navigation_team_selector);
});
binding.statusButton.setOnClickListener(v -> {
findNavController(this).navigate(R.id.action_navigation_data_to_navigation_data_status);
});
return binding.getRoot();
}
@@ -1,4 +1,4 @@
package com.astatin3.scoutingapp2025.ui.data;
package com.astatin3.scoutingapp2025.ui.scouting;
import static com.astatin3.scoutingapp2025.utility.DataManager.event;
@@ -14,7 +14,7 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import com.astatin3.scoutingapp2025.databinding.FragmentDataStatusBinding;
import com.astatin3.scoutingapp2025.databinding.FragmentScoutingStatusBinding;
import com.astatin3.scoutingapp2025.utility.DataManager;
import com.astatin3.scoutingapp2025.utility.fileEditor;
import com.astatin3.scoutingapp2025.types.frcEvent;
@@ -23,12 +23,12 @@ import com.astatin3.scoutingapp2025.types.frcMatch;
import java.util.Arrays;
public class StatusFragment extends Fragment {
FragmentDataStatusBinding binding;
FragmentScoutingStatusBinding binding;
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
binding = FragmentDataStatusBinding.inflate(inflater, container, false);
binding = FragmentScoutingStatusBinding.inflate(inflater, container, false);
DataManager.reload_event();
binding.matchTable.removeAllViews();
+34 -35
View File
@@ -27,50 +27,49 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<Button
android:id="@+id/status_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="status"
android:textSize="34sp"
app:layout_constraintBottom_toTopOf="@+id/teamsButton"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.307" />
<Button
android:id="@+id/teamsButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="teams"
android:textSize="34sp"
app:layout_constraintBottom_toTopOf="@id/compileButton"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/status_button" />
<Button
android:id="@+id/compileButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Compile"
android:textSize="34sp"
app:layout_constraintBottom_toTopOf="@+id/fieldsButton"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/teamsButton" />
<Button
android:id="@+id/fieldsButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Fields"
android:textSize="34sp"
app:layout_constraintBottom_toTopOf="@+id/teamsButton"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/teamsButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Teams"
android:textSize="34sp"
app:layout_constraintBottom_toTopOf="@id/compareButton"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/fieldsButton" />
<Button
android:id="@+id/compareButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Compare"
android:textSize="34sp"
app:layout_constraintBottom_toTopOf="@+id/reportButton"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/teamsButton" />
<Button
android:id="@+id/reportButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Report"
android:textSize="34sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/compileButton"
app:layout_constraintTop_toBottomOf="@+id/compareButton"
app:layout_constraintVertical_bias="0.689" />
</androidx.constraintlayout.widget.ConstraintLayout>
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TBD"
android:textSize="34sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
+14 -1
View File
@@ -50,11 +50,24 @@
android:layout_height="wrap_content"
android:text="@string/pit_n_scouting"
android:textSize="34sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintBottom_toTopOf="@id/status_button"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/matchScoutingButton" />
<Button
android:id="@+id/status_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Status"
android:textSize="34sp"
app:layout_constraintTop_toBottomOf="@+id/pitScoutingButton"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintVertical_bias="0.307" />
</androidx.constraintlayout.widget.ConstraintLayout>
@@ -97,7 +97,6 @@
app:spinner_divider_color="@color/teal_200"
app:spinner_divider_show="true"
app:spinner_divider_size="0.4dp"
app:spinner_item_height="46dp"
app:spinner_popup_background="@color/black_2"
app:spinner_popup_elevation="14dp" />
@@ -133,7 +132,6 @@
app:spinner_divider_color="@color/teal_200"
app:spinner_divider_show="true"
app:spinner_divider_size="0.4dp"
app:spinner_item_height="46dp"
app:spinner_popup_background="@color/black_2"
app:spinner_popup_elevation="14dp" />
@@ -67,13 +67,6 @@
android:name="com.astatin3.scoutingapp2025.ui.data.dataFragment"
android:label="@string/title_data"
tools:layout="@layout/fragment_data">
<action
android:id="@+id/action_navigation_data_to_navigation_data_status"
app:destination="@id/navigation_data_status"
app:enterAnim="@anim/enter_anim"
app:exitAnim="@anim/exit_anim"
app:popEnterAnim="@anim/enter_anim"
app:popExitAnim="@anim/pop_exit_anim" />
<action
android:id="@+id/action_navigation_data_to_navigation_team_selector"
app:destination="@id/navigation_team_selector"
@@ -99,8 +92,8 @@
<fragment
android:id="@+id/navigation_data_status"
android:name="com.astatin3.scoutingapp2025.ui.data.StatusFragment"
tools:layout="@layout/fragment_data_status">
android:name="com.astatin3.scoutingapp2025.ui.scouting.StatusFragment"
tools:layout="@layout/fragment_scouting_status">
</fragment>
<fragment
@@ -111,8 +104,8 @@
<fragment
android:id="@+id/navigation_data_compile"
android:name="com.astatin3.scoutingapp2025.ui.data.CompileFragment"
tools:layout="@layout/fragment_data_compile">
android:name="com.astatin3.scoutingapp2025.ui.data.ReportFragment"
tools:layout="@layout/fragment_data_report">
</fragment>
<fragment