Changed the way it makes the files
This commit is contained in:
parent
fae1eb8c8b
commit
0813b2ee0b
@ -37,9 +37,10 @@ public class AutoActivity extends AppCompatActivity {
|
|||||||
private TextView l1TV;
|
private TextView l1TV;
|
||||||
private TextView processorTV;
|
private TextView processorTV;
|
||||||
private TextView netTV;
|
private TextView netTV;
|
||||||
private String eventString, matchString;
|
private String eventString, matchString, TeamString;
|
||||||
public static final String Event_Key = "EVENTCONFIRM";
|
public static final String Event_Key = "EVENTCONFIRM";
|
||||||
public static final String Match_key = "MATCHCONFIRM";
|
public static final String Match_key = "MATCHCONFIRM";
|
||||||
|
public static final String Team_key = "TEAMCONFIRM";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
@ -54,6 +55,7 @@ public class AutoActivity extends AppCompatActivity {
|
|||||||
Intent intentinput = getIntent();
|
Intent intentinput = getIntent();
|
||||||
eventString = intentinput.getStringExtra(MainActivity.Event_Key);
|
eventString = intentinput.getStringExtra(MainActivity.Event_Key);
|
||||||
matchString = intentinput.getStringExtra(MainActivity.Match_key);
|
matchString = intentinput.getStringExtra(MainActivity.Match_key);
|
||||||
|
TeamString = intentinput.getStringExtra(MainActivity.Team_key);
|
||||||
|
|
||||||
|
|
||||||
Button l4Button = (Button) findViewById(R.id.button_L4);
|
Button l4Button = (Button) findViewById(R.id.button_L4);
|
||||||
@ -149,6 +151,7 @@ public class AutoActivity extends AppCompatActivity {
|
|||||||
Intent intent = new Intent(this, TeleActivity.class);
|
Intent intent = new Intent(this, TeleActivity.class);
|
||||||
intent.putExtra(Event_Key, eventString);
|
intent.putExtra(Event_Key, eventString);
|
||||||
intent.putExtra(Match_key, matchString);
|
intent.putExtra(Match_key, matchString);
|
||||||
|
intent.putExtra(Team_key, TeamString);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
@ -190,7 +193,10 @@ public class AutoActivity extends AppCompatActivity {
|
|||||||
public void CSVmake(Context context) {
|
public void CSVmake(Context context) {
|
||||||
//adds the strings
|
//adds the strings
|
||||||
String CSVLine = String.format(
|
String CSVLine = String.format(
|
||||||
"%s,%s,%s,%s,%s,%s,%s,%s,%s,%s",
|
"%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s",
|
||||||
|
eventString,
|
||||||
|
matchString,
|
||||||
|
TeamString,
|
||||||
auto,
|
auto,
|
||||||
l4Scored,
|
l4Scored,
|
||||||
l3Scored,
|
l3Scored,
|
||||||
@ -203,7 +209,7 @@ public class AutoActivity extends AppCompatActivity {
|
|||||||
coralPickup
|
coralPickup
|
||||||
);
|
);
|
||||||
//makes the file
|
//makes the file
|
||||||
File csvFile = new File(context.getFilesDir(), eventString+".csv");
|
File csvFile = new File(context.getFilesDir(), eventString+matchString+TeamString+".csv");
|
||||||
Log.d("CSVFile", "File created/written at: " + csvFile.getAbsolutePath());
|
Log.d("CSVFile", "File created/written at: " + csvFile.getAbsolutePath());
|
||||||
//writes to file
|
//writes to file
|
||||||
try (FileWriter writer = new FileWriter(csvFile, true)) {
|
try (FileWriter writer = new FileWriter(csvFile, true)) {
|
||||||
|
@ -37,9 +37,10 @@ public class TeleActivity extends AppCompatActivity {
|
|||||||
private TextView l1TV;
|
private TextView l1TV;
|
||||||
private TextView processorTV;
|
private TextView processorTV;
|
||||||
private TextView netTV;
|
private TextView netTV;
|
||||||
private String eventString, matchString;
|
private String eventString, matchString, TeamString;
|
||||||
public static final String Event_Key = "EVENTCONFIRM";
|
public static final String Event_Key = "EVENTCONFIRM";
|
||||||
public static final String Match_key = "MATCHCONFIRM";
|
public static final String Match_key = "MATCHCONFIRM";
|
||||||
|
public static final String Team_key = "TEAMCONFIRM";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
@ -54,6 +55,7 @@ public class TeleActivity extends AppCompatActivity {
|
|||||||
Intent intentinput = getIntent();
|
Intent intentinput = getIntent();
|
||||||
eventString = intentinput.getStringExtra(AutoActivity.Event_Key);
|
eventString = intentinput.getStringExtra(AutoActivity.Event_Key);
|
||||||
matchString = intentinput.getStringExtra(AutoActivity.Match_key);
|
matchString = intentinput.getStringExtra(AutoActivity.Match_key);
|
||||||
|
TeamString = intentinput.getStringExtra(AutoActivity.Team_key);
|
||||||
|
|
||||||
Button l4Button = (Button) findViewById(R.id.button_L4);
|
Button l4Button = (Button) findViewById(R.id.button_L4);
|
||||||
Button l3Button = (Button) findViewById(R.id.button_L3);
|
Button l3Button = (Button) findViewById(R.id.button_L3);
|
||||||
@ -148,6 +150,7 @@ public class TeleActivity extends AppCompatActivity {
|
|||||||
Intent intent = new Intent(this, EndActivity.class);
|
Intent intent = new Intent(this, EndActivity.class);
|
||||||
intent.putExtra(Event_Key, eventString);
|
intent.putExtra(Event_Key, eventString);
|
||||||
intent.putExtra(Match_key, matchString);
|
intent.putExtra(Match_key, matchString);
|
||||||
|
intent.putExtra(Team_key, TeamString);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
@ -189,7 +192,10 @@ public class TeleActivity extends AppCompatActivity {
|
|||||||
public void csvMake() {
|
public void csvMake() {
|
||||||
//adds the strings
|
//adds the strings
|
||||||
String CSVLine = String.format(
|
String CSVLine = String.format(
|
||||||
"%s,%s,%s,%s,%s,%s,%s,%s,%s,%s",
|
"%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s",
|
||||||
|
eventString,
|
||||||
|
matchString,
|
||||||
|
TeamString,
|
||||||
tele,
|
tele,
|
||||||
l4Scored,
|
l4Scored,
|
||||||
l3Scored,
|
l3Scored,
|
||||||
@ -202,7 +208,7 @@ public class TeleActivity extends AppCompatActivity {
|
|||||||
coralPickup
|
coralPickup
|
||||||
);
|
);
|
||||||
//makes the file
|
//makes the file
|
||||||
File csvFile = new File(this.getFilesDir(), eventString+".csv");
|
File csvFile = new File(this.getFilesDir(), eventString+matchString+TeamString+".csv");
|
||||||
Log.d("CSVFile", "File created/written at: " + csvFile.getAbsolutePath());
|
Log.d("CSVFile", "File created/written at: " + csvFile.getAbsolutePath());
|
||||||
//writes to file
|
//writes to file
|
||||||
try (FileWriter writer = new FileWriter(csvFile, true)) {
|
try (FileWriter writer = new FileWriter(csvFile, true)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user