-
Notifications
You must be signed in to change notification settings - Fork 0
Annotate instrument information on image. #11
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
base: development
Are you sure you want to change the base?
Conversation
|
This needs qbicsoftware/data-model-lib#52 to be merged. |
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.
LGTM! I have some very small nitpicks, the overall work looks really clean and concise! 👍
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.
LGTM!
|
Requires qbicsoftware/parent-poms#61 |
The code does not run until the parent-pom is fixed which can not be done until the data-model-lib is released.
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.
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.
code lgtm
|
The DTO returns null instead of empty strings whenever fields are not set in the address qbicsoftware/data-model-lib#55 |
The current version fails for missing address attributes.
| try { | ||
| mapAnnotationContent.add(new NamedValue("hardware.detector.type", instrumentHardware.getDetector().getType())); | ||
| } catch (NullPointerException ignored) {} | ||
| try { | ||
| mapAnnotationContent.add(new NamedValue("hardware.objective", instrumentHardware.getObjective())); | ||
| } catch (NullPointerException ignored) {} | ||
| try { | ||
| mapAnnotationContent.add(new NamedValue("manufacturer", instrument.getManufacturer())); | ||
| } catch (NullPointerException ignored) {} | ||
| try { | ||
| mapAnnotationContent.add(new NamedValue("location.address.affiliation", instrumentLocationAddress.getAffiliation())); | ||
| } catch (NullPointerException ignored) {} | ||
| try { | ||
| mapAnnotationContent.add(new NamedValue("location.address.country", instrumentLocationAddress.getCountry())); | ||
| } catch (NullPointerException ignored) {} | ||
| try { | ||
| mapAnnotationContent.add(new NamedValue("location.address.street", instrumentLocationAddress.getStreet())); | ||
| } catch (NullPointerException ignored) {} | ||
| try { | ||
| mapAnnotationContent.add(new NamedValue("location.address.zipCode", instrumentLocationAddress.getZipCode().toString())); | ||
| } catch (NullPointerException ignored) {} | ||
| try { | ||
| mapAnnotationContent.add(new NamedValue("location.roomId", instrumentLocation.getRoomId())); | ||
| } catch (NullPointerException ignored) {} |
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.
Suggestion: the underlying problem is, that the instrument properties can be null. So lets make sure they are never null, but empty Strings, Lists or empty objects.
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 needs to be addressed in the instrument constructor then.
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 created an issue in the data-model-lib qbicsoftware/data-model-lib#55
|
@luiskuhn @wow-such-code Is this still needed? if not, feel free to close this PR |
No description provided.