Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit de585d0

Browse files
committed
Added new XYseries to represent the desired setpoint of the process in the plot
1 parent 1c7b42d commit de585d0

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

Window.java

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public class Window extends JFrame
1919
private static final long serialVersionUID = 1L;
2020
final XYSeries process_output;
2121
final XYSeries process_input;
22+
final XYSeries process_setpoint;
2223
final XYSeriesCollection collectionData;
2324
final JFreeChart display;
2425
public JTextField txt_port;
@@ -81,21 +82,24 @@ public Window()
8182
this.getContentPane().add(mainPanel, BorderLayout.EAST);
8283

8384
// Setup the Chart panel
84-
process_input = new XYSeries("Process Input");
85-
process_output = new XYSeries("Process Output");
85+
process_input = new XYSeries("Process Input");
86+
process_output = new XYSeries("Process Output");
87+
process_setpoint = new XYSeries("Setpoint");
8688
process_input.clear();
8789
process_output.clear();
90+
process_setpoint.clear();
8891
collectionData = new XYSeriesCollection();
8992
collectionData.addSeries(process_input);
9093
collectionData.addSeries(process_output);
94+
collectionData.addSeries(process_setpoint);
9195
display = ChartFactory.createXYLineChart("Realtime Process Dynamics",
92-
"Time",
93-
"Amplitude",
94-
collectionData,
95-
PlotOrientation.VERTICAL,
96-
true,
97-
true,
98-
false);
96+
"Time",
97+
"Amplitude",
98+
collectionData,
99+
PlotOrientation.VERTICAL,
100+
true,
101+
true,
102+
false);
99103
JPanel rt_panel = new ChartPanel(display);
100104
this.getContentPane().add(rt_panel, BorderLayout.CENTER);
101105
this.setVisible(true);

0 commit comments

Comments
 (0)