Skip to content

Commit

Permalink
REI V.9.1.0
Browse files Browse the repository at this point in the history
Fixes to timemap.
  • Loading branch information
VarunAnanth2003 committed Feb 25, 2020
1 parent 90d6b2e commit 8b30328
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 31 deletions.
70 changes: 40 additions & 30 deletions roboterroridentifier/OverviewManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,31 +35,33 @@
* A class to manage overviews.
*/
public class OverviewManager {
private static JFrame sliderFrame;
private static JPanel jp;
private static JSlider sliderBar;
private static JLabel jlb;
private static JTextArea jta;
private static JComboBox<Object> jcb;
private static int tValue;
private static LogList mData;
private static JFrame imageFrame = new JFrame();;
private static JFrame sliderFrame = new JFrame("Slider Frame");
private static JPanel jp = new JPanel();
private static JSlider sliderBar = new JSlider();
private static JLabel jlb = new JLabel();
private static JTextArea jta = new JTextArea();
private static JComboBox<Object> jcb = null;
private static int tValue = 0;
private static LogList mData = new LogList();
private static JFrame imageFrame = new JFrame("Image Frame");
private static ImagePanel[] allImagePanels = new ImagePanel[0];
private static String[] panelNames;
private static JComboBox<Object> viewChooser;
private static String[] panelNames = new String[0];
private static JComboBox<Object> viewChooser = null;
private static ArrayList<String> activeActuators = new ArrayList<>();
private static int xPos;
private static int yPos;
private static int xPos = 0;
private static int yPos = 0;
private static JLabel pointLabel = new JLabel("Last clicked point: X, Y");

public static void createSliderWindow(final LogList data) {
sliderFrame.getContentPane().removeAll();
imageFrame.getContentPane().removeAll();
mData = data;
allImagePanels = new ImagePanel[0];
allImagePanels = Arrays.copyOf(allImagePanels, OverviewManager.ImageStorage.values().length);
for (int i = 0; i < OverviewManager.ImageStorage.values().length; i++) {
allImagePanels[i] = new ImagePanel(OverviewManager.ImageStorage.values()[i].getName(),
OverviewManager.ImageStorage.values()[i].getPath());
}
sliderFrame = new JFrame("Slider Frame");
jp = new JPanel();
jp.setLayout(new FlowLayout());
sliderBar = new JSlider(0, GraphManager.maxSec(data), 0);
Expand All @@ -83,7 +85,7 @@ public static void createSliderWindow(final LogList data) {
sliderBar.setForeground(LoggerGUI.plainWhite);

jlb.setBounds(275, 25, 100, 50);
jlb.setText("@t = " + sliderBar.getValue());
jlb.setText("@t = " + "0 - 1");

jcb.setBounds(50, 125, 300, 20);
jcb.setBackground(LoggerGUI.spartaGreen);
Expand All @@ -103,15 +105,18 @@ public void actionPerformed(final ActionEvent a) {
}
});
pointLabel.setBounds(125, 75, 400, 50);

sliderFrame.add(sliderBar);
sliderFrame.add(jlb);
sliderFrame.add(jcb);
sliderFrame.add(tlviewer);
sliderFrame.add(pointLabel);
sliderFrame.add(jp);
sliderFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
sliderFrame.setSize(400, 600);
sliderFrame.setResizable(false);
sliderFrame.setVisible(true);
imageFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
}

public static int getTValue() {
Expand Down Expand Up @@ -166,17 +171,19 @@ public static void updateErrors(final int t) {
}
}
jta.append("Logs in " + "Other" + ":\n");
for (int j = 0; j < subLogs.get(LoggerFilter.SUBSYSTEM_KEYS.length).messages.size(); j++) {
jta.append(subLogs.get(LoggerFilter.SUBSYSTEM_KEYS.length).messages.get(j) + " @t = " + subLogs.get(LoggerFilter.SUBSYSTEM_KEYS.length).timeStamps.get(j) + "\n");
for (int k = 0; k < LoggerFilter.ACTUATOR_NAMES.size(); k++) {
if (subLogs.get(LoggerFilter.SUBSYSTEM_KEYS.length).messages.get(j).contains("@" + LoggerFilter.ACTUATOR_NAMES.get(k) + "@")) {
if (!activeActuators.contains(LoggerFilter.ACTUATOR_NAMES.get(k))) {
activeActuators.add(LoggerFilter.ACTUATOR_NAMES.get(k));
}
}
for (int j = 0; j < subLogs.get(LoggerFilter.SUBSYSTEM_KEYS.length).messages.size(); j++) {
jta.append(subLogs.get(LoggerFilter.SUBSYSTEM_KEYS.length).messages.get(j) + " @t = "
+ subLogs.get(LoggerFilter.SUBSYSTEM_KEYS.length).timeStamps.get(j) + "\n");
for (int k = 0; k < LoggerFilter.ACTUATOR_NAMES.size(); k++) {
if (subLogs.get(LoggerFilter.SUBSYSTEM_KEYS.length).messages.get(j)
.contains("@" + LoggerFilter.ACTUATOR_NAMES.get(k) + "@")) {
if (!activeActuators.contains(LoggerFilter.ACTUATOR_NAMES.get(k))) {
activeActuators.add(LoggerFilter.ACTUATOR_NAMES.get(k));
}
}
jta.append("\n");
}
}
jta.append("\n");
}

public static boolean checkAllowedDisplay(final int n) {
Expand All @@ -203,13 +210,16 @@ public static void createOverview(final LogList data) {
viewChooser.setBackground(LoggerGUI.spartaGreen);
viewChooser.setForeground(LoggerGUI.plainWhite);
imageFrame.add(viewChooser);
viewChooser.addActionListener(new ActionListener() {
@Override
public void actionPerformed(final ActionEvent e) {
updateGraphics();
}
});
if (viewChooser.getActionListeners().length < 1) {
viewChooser.addActionListener(new ActionListener() {
@Override
public void actionPerformed(final ActionEvent e) {
updateGraphics();
}
});
}
updateGraphics();
updateErrors(0);
}

public static void updateGraphics() {
Expand Down
2 changes: 1 addition & 1 deletion roboterroridentifier/RobotErrorIdentifier.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* errors, and much more. Helpful for post-match diagnostics. <Also, if you can
* see this, thanks for checking out our code! :) >
*
* @version 9.0.0
* @version 9.1.0
* @author Team 2976!
* @see Github: https://github.com/SkylineSpartabots/RobotErrorIdentifier
*/
Expand Down
1 change: 1 addition & 0 deletions testing/coordinateTesting.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,4 @@ RANDOM_JUNK
RANDOM_JUNK
S_LOG !!! Error: <7.2> Limelight green light failed @Limelight@ !!! E_LOG
S_LOG !!! Error: <7.6> Lmao bruh idk limelight @Limelight@ !!! E_LOG
junk

0 comments on commit 8b30328

Please sign in to comment.