-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge json #23
base: main
Are you sure you want to change the base?
Merge json #23
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, I'm waiting on your answers about the file path and the possible use of an enum for controller type and then I can approve.
|
||
public static class Controller { | ||
public int port = -1; | ||
public String type = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we use an enum for types instead of strings? I feel like this would be less prone to typos and runtime errors that way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will look into it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will probably be a new pull request because I want to add some features to JSONSync to make this easier first
|
||
public String toString() { | ||
StringBuilder stringBuilder = new StringBuilder(); | ||
stringBuilder.append("Controler Object {\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tiny nitpick but I think there are 2 L's in controller.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we keep the toString method, because I made it for testing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If its needed for unit tests then keep it, otherwise we could probably get rid of it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still need to figure out how to do unit tests again, but I will remove it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok sounds good
} catch (NumberFormatException e) { | ||
if (!Controllers.synced.getObject().buttonShorthands.containsKey(button)) | ||
throw new RuntimeException( | ||
"Button Id not found as interger or in shorthands " + button); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another tiny nitpick but I think you accidentally put an extra 'r' before the 'g' in 'integer'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will fix that, and I also need to capitalize the d in Id
List<Controllers.Controller> controllers = Controllers.getControllers(); | ||
System.out.println(controllers.size()); | ||
assertEquals(23124, controllers.size()); | ||
assertFalse(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do these tests pass?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgot to redo them I will that later today
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was trying to get unit testing to work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah I remember they weren't running before right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you get unit tests working for the monitors?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I got them to run as far as I remember
oh you might have to merge |
@avidraccoon what's the status of this PR? I think we should make a branch on high-key-2024 to test this and then merge to main when we get it to work |
yes and I am realizing how bad this pull requests name is |
Modifys controllers to use new JSON system