Skip to content

Commit 8cbdca6

Browse files
author
vimsh
committed
Added "Same Y scale" to LogView WOT Pulls
1 parent 888fedd commit 8cbdca6

File tree

2 files changed

+24
-15
lines changed

2 files changed

+24
-15
lines changed

MafScaling.jar

119 Bytes
Binary file not shown.

src/com/vgi/mafscaling/LogView.java

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,7 @@ public void setColor(Color c) {
505505
private JMultiSelectionBox plotsColumn = null;
506506
private JMultiSelectionBox wotPlotsColumn = null;
507507
private ButtonGroup wotRbGroup = null;
508+
private JCheckBox sameScalecheckBox = null;
508509
private HashMap<String, ArrayList<HashMap<String, ArrayList<Double>>>> filesData = null;
509510
private int wotPoint = Config.getWOTStationaryPointValue();
510511
private int logThtlAngleColIdx = -1;
@@ -1032,9 +1033,9 @@ protected void createWotCtrlPanel(JPanel plotPanel) {
10321033
plotPanel.add(cntlPanel, gbc_ctrlPanel);
10331034

10341035
GridBagLayout gbl_cntlPanel = new GridBagLayout();
1035-
gbl_cntlPanel.columnWidths = new int[]{0, 0, 0, 0, 0, 0, 0, 0, 0};
1036+
gbl_cntlPanel.columnWidths = new int[]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
10361037
gbl_cntlPanel.rowHeights = new int[]{0};
1037-
gbl_cntlPanel.columnWeights = new double[]{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0};
1038+
gbl_cntlPanel.columnWeights = new double[]{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0};
10381039
gbl_cntlPanel.rowWeights = new double[]{0};
10391040
cntlPanel.setLayout(gbl_cntlPanel);
10401041

@@ -1059,6 +1060,10 @@ protected void createWotCtrlPanel(JPanel plotPanel) {
10591060
wotPlotsColumn.setPrototypeDisplayValue(prototypeDisplayValue);
10601061
cntlPanel.add(wotPlotsColumn, gbc);
10611062

1063+
gbc.gridx += 1;
1064+
sameScalecheckBox = new JCheckBox("Same Y scale");
1065+
cntlPanel.add(sameScalecheckBox, gbc);
1066+
10621067
gbc.gridx += 1;
10631068
JRadioButton button = new JRadioButton("RPM");
10641069
wotRbGroup.add(button);
@@ -2096,11 +2101,11 @@ private void viewWotPlotsByRpm(boolean skipDrops) {
20962101
int pullIdx;
20972102
setCursor(new Cursor(Cursor.WAIT_CURSOR));
20982103
try {
2104+
XYSeriesCollection dataset = null;
20992105
for (int i = 0; i < dataColNames.size(); ++i) {
21002106
String yAxisColName = dataColNames.get(i);
2101-
XYLineAndShapeRenderer lineRenderer = new XYLineAndShapeRenderer();
2102-
lineRenderer.setBaseShapesVisible(showWotCurvePoints);
2103-
XYSeriesCollection dataset = new XYSeriesCollection();
2107+
if (!sameScalecheckBox.isSelected() || i == 0)
2108+
dataset = new XYSeriesCollection();
21042109
DefaultMutableTreeNode root = (DefaultMutableTreeNode)wotTree.getModel().getRoot();
21052110
for (int idx = 0; idx < root.getChildCount(); ++idx) {
21062111
fileNode = (DefaultMutableTreeNode)root.getChildAt(idx);
@@ -2129,16 +2134,20 @@ private void viewWotPlotsByRpm(boolean skipDrops) {
21292134
}
21302135
}
21312136
}
2132-
NumberAxis yAxis = new NumberAxis(yAxisColName);
2133-
yAxis.setAutoRangeIncludesZero(false);
2134-
yAxis.setTickLabelPaint(Color.WHITE);
2135-
yAxis.setLabelPaint(Color.LIGHT_GRAY);
2136-
wotPlot.setRenderer(i, lineRenderer);
2137-
wotPlot.setRangeAxis(i, yAxis, false);
2138-
wotPlot.setDataset(i, dataset);
2139-
wotPlot.mapDatasetToRangeAxis(i, i);
2140-
wotPlot.mapDatasetToDomainAxis(i, 0);
2141-
wotPlot.setRangeAxisLocation(i, (i % 2 == 0 ? AxisLocation.BOTTOM_OR_LEFT : AxisLocation.BOTTOM_OR_RIGHT));
2137+
if (!sameScalecheckBox.isSelected() || i == 0) {
2138+
NumberAxis yAxis = new NumberAxis(yAxisColName);
2139+
yAxis.setAutoRangeIncludesZero(false);
2140+
yAxis.setTickLabelPaint(Color.WHITE);
2141+
yAxis.setLabelPaint(Color.LIGHT_GRAY);
2142+
XYLineAndShapeRenderer lineRenderer = new XYLineAndShapeRenderer();
2143+
lineRenderer.setBaseShapesVisible(showWotCurvePoints);
2144+
wotPlot.setRenderer(i, lineRenderer);
2145+
wotPlot.setRangeAxis(i, yAxis, false);
2146+
wotPlot.setDataset(i, dataset);
2147+
wotPlot.mapDatasetToRangeAxis(i, i);
2148+
wotPlot.mapDatasetToDomainAxis(i, 0);
2149+
wotPlot.setRangeAxisLocation(i, (i % 2 == 0 ? AxisLocation.BOTTOM_OR_LEFT : AxisLocation.BOTTOM_OR_RIGHT));
2150+
}
21422151
}
21432152
}
21442153
finally {

0 commit comments

Comments
 (0)