Skip to content

Commit

Permalink
Added Field Weakening angle display in charts
Browse files Browse the repository at this point in the history
  • Loading branch information
mspider65 committed Aug 16, 2020
1 parent 1b76ce3 commit be8f56e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public class ChartActivity extends AppCompatActivity implements LogManager.LogRe
private enum DataType {
level, speed,cadence,pPower,mPower,current,
volt,energy,mTemp,cTemp,dCycle,erps,
foc,pTorque;
foc,pTorque,fwAngle;

public String getName() {
switch (this) {
Expand Down Expand Up @@ -118,6 +118,8 @@ public String getName() {
return MyApp.getInstance().getString(R.string.foc_angle);
case pTorque:
return MyApp.getInstance().getString(R.string.pedal_torque);
case fwAngle:
return MyApp.getInstance().getString(R.string.fw_angle);
}
return "";
}
Expand All @@ -126,7 +128,7 @@ public String getName() {
DataType.level, DataType.speed, DataType.cadence, DataType.pPower, DataType.mPower,
DataType.mTemp, DataType.volt, DataType.current, DataType.energy));
private static final Set<DataType> DEBUG_DATA_TYPES = new HashSet<>(Arrays.asList(
DataType.dCycle, DataType.erps, DataType.foc, DataType.pTorque, DataType.cTemp));
DataType.dCycle, DataType.erps, DataType.foc, DataType.pTorque, DataType.cTemp, DataType.fwAngle));
private static final Set<DataType> POWER_DATA_TYPES = new HashSet<>(Arrays.asList(
DataType.mPower, DataType.pPower));
private static final Set<DataType> TEMPERATURE_DATA_TYPES = new HashSet<>(Arrays.asList(
Expand Down Expand Up @@ -514,6 +516,9 @@ private ArrayList<Entry> fillData(DataType dataType, YAxis yAxis, float maxY) {
case cTemp:
y = debugData.get(i).debug.pcbTemperature;
break;
case fwAngle:
y = debugData.get(i).debug.notUsed;
break;
}
if (y > maxY)
maxY = y;
Expand Down Expand Up @@ -767,6 +772,7 @@ private void showDataSelectionDialog() {
new DataItem(DataType.speed, true),
new DataItem(DataType.cadence, false),
new DataItem(DataType.pPower, true),
new DataItem(DataType.pTorque, false),
new DataItem(DataType.mPower, false),
new DataItem(DataType.current, false),
new DataItem(DataType.volt, false),
Expand All @@ -776,7 +782,7 @@ private void showDataSelectionDialog() {
new DataItem(DataType.dCycle, false),
new DataItem(DataType.erps, false),
new DataItem(DataType.foc, false),
new DataItem(DataType.pTorque, false)
new DataItem(DataType.fwAngle, false)
};
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setCancelable(false);
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
<string name="not_used">Not Used</string>
<string name="adc_value">ADC value</string>
<string name="controller_temp">Controller Temp.</string>
<string name="fw_angle">FW Angle</string>

<string name="tsdz_cfg">Bike Configuration</string>
<string name="title_activity_esp32_ota">Esp32 Firmware Update</string>
Expand Down

0 comments on commit be8f56e

Please sign in to comment.