|
@@ -70,15 +70,15 @@ public class SettingActivity extends BaseActivity {
|
70
|
70
|
}
|
71
|
71
|
|
72
|
72
|
private void getDataSerialPort() {
|
73
|
|
- serialPortList.add(new DataSerialPort(1, "Serial Port 2"));
|
74
|
|
- serialPortList.add(new DataSerialPort(2, "Serial Port 3"));
|
|
73
|
+ serialPortList.add(new DataSerialPort(1, "Serial Port 1"));
|
|
74
|
+ serialPortList.add(new DataSerialPort(2, "Serial Port 2"));
|
|
75
|
+ serialPortList.add(new DataSerialPort(3, "Serial Port 3"));
|
75
|
76
|
setDataSerialPort();
|
76
|
77
|
}
|
77
|
78
|
|
78
|
79
|
private void getDataDirectURL() {
|
79
|
80
|
directURLList.add(new DataDirectURL(1, "Development"));
|
80
|
|
- directURLList.add(new DataDirectURL(2, "Staging"));
|
81
|
|
- directURLList.add(new DataDirectURL(3, "Production"));
|
|
81
|
+ directURLList.add(new DataDirectURL(2, "Production"));
|
82
|
82
|
setDataDirectURL();
|
83
|
83
|
}
|
84
|
84
|
|
|
@@ -86,10 +86,16 @@ public class SettingActivity extends BaseActivity {
|
86
|
86
|
private void setDataSerialPort(){
|
87
|
87
|
ArrayAdapter<DataSerialPort> adapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_dropdown_item, serialPortList);
|
88
|
88
|
binding.spinnerSerialPort.setAdapter(adapter);
|
89
|
|
- if (getSessionManager().isSerialPort2()){
|
90
|
|
- binding.spinnerSerialPort.setSelection(0);
|
91
|
|
- } else {
|
92
|
|
- binding.spinnerSerialPort.setSelection(1);
|
|
89
|
+ switch (getSessionManager().getDataSerialPort()){
|
|
90
|
+ case 1:
|
|
91
|
+ binding.spinnerSerialPort.setSelection(0);
|
|
92
|
+ break;
|
|
93
|
+ case 2:
|
|
94
|
+ binding.spinnerSerialPort.setSelection(1);
|
|
95
|
+ break;
|
|
96
|
+ case 3:
|
|
97
|
+ binding.spinnerSerialPort.setSelection(2);
|
|
98
|
+ break;
|
93
|
99
|
}
|
94
|
100
|
}
|
95
|
101
|
|
|
@@ -103,9 +109,6 @@ public class SettingActivity extends BaseActivity {
|
103
|
109
|
case 2:
|
104
|
110
|
binding.spinnerDirectUrl.setSelection(1);
|
105
|
111
|
break;
|
106
|
|
- case 3:
|
107
|
|
- binding.spinnerDirectUrl.setSelection(2);
|
108
|
|
- break;
|
109
|
112
|
}
|
110
|
113
|
}
|
111
|
114
|
|
|
@@ -140,16 +143,16 @@ public class SettingActivity extends BaseActivity {
|
140
|
143
|
Toast.makeText(this, dataSerialPort.getName() + " " + dataDirectURL.getName(), Toast.LENGTH_LONG).show();
|
141
|
144
|
|
142
|
145
|
// ID 1 ==> Serial Port 2
|
143
|
|
- if (dataSerialPort.getId() == 1){
|
144
|
|
- getSessionManager().setIsSerialport2(true);
|
|
146
|
+ if (dataSerialPort.getId() != null){
|
|
147
|
+ Timber.i("Data Serial Port : %s", dataSerialPort.getId());
|
|
148
|
+ getSessionManager().setDataSerialPort(dataSerialPort.getId());
|
145
|
149
|
} else {
|
146
|
|
- getSessionManager().setIsSerialport2(false);
|
|
150
|
+ Timber.i("Data Serial Port Null");
|
147
|
151
|
}
|
148
|
152
|
|
149
|
153
|
// DATA DIRECT URL
|
150
|
154
|
// ID 1 ==> DEV
|
151
|
|
- // ID 2 ==> STAGING
|
152
|
|
- // ID 3 ==> PRODUCTION
|
|
155
|
+ // ID 2 ==> PRODUCTION
|
153
|
156
|
if (dataDirectURL.getId() != null){
|
154
|
157
|
Timber.i("Data Direct ID : %s", dataDirectURL.getId());
|
155
|
158
|
getSessionManager().setDataDirectId(dataDirectURL.getId());
|