Skip to content

ndbc-csv#190

Open
TheRestOfMe wants to merge 5 commits into
masterfrom
ndbc-csv
Open

ndbc-csv#190
TheRestOfMe wants to merge 5 commits into
masterfrom
ndbc-csv

Conversation

@TheRestOfMe
Copy link
Copy Markdown
Member

Main change here is to support CSV file reading from NDBC data access site. I also simplified the output structure so that there is only one output now. I may go back in and mod that to more closely model what the buoys provide- not all buoys support all observables.
I blew away a lot of the old code so diff may not help much. Just let me know if it's confusing and I can walk thru a little more with you.

@TheRestOfMe TheRestOfMe requested a review from nickgaray April 1, 2026 00:55
Copy link
Copy Markdown
Collaborator

@nickgaray nickgaray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comments in the review, but one overall comment is to add the file header to all source files

osgi {
manifest {
attributes('Bundle-Vendor': 'Botts Innovative Research Inc.')
attributes('Bundle-Activator': 'org.sensorhub.impl.ndbc.Activator')
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bundle Activator attribute value must follow the package structure of the Activator file,

org.sensorhub.impl.sensor.ndbc

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will be corrected in next push

Comment thread sensors/hydro/sensorhub-driver-ndbc/config_ndbc.json
@@ -0,0 +1 @@
org.sensorhub.impl.ndbc.NDBCDescriptor
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like the activator, the package name must follow the same structure:

org.sensorhub.impl.sensor.ndbc

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will be corrected in next push

setDoubleValue(dataBlock, index++, rec.lon);
setDoubleValue(dataBlock, index++, rec.windSpeed);
if(rec.windDir == null)
dataBlock.setDoubleValue(index, Double.NaN);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

index here should also be increased by 1

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will be corrected in next push

@TheRestOfMe
Copy link
Copy Markdown
Member Author

Minor comments in the review, but one overall comment is to add the file header to all source files

Is there a standard header we are using now? Still the Mozilla pubic license?

@TheRestOfMe TheRestOfMe self-assigned this May 7, 2026
@drewbotts drewbotts requested review from drewbotts and nickgaray May 14, 2026 15:15
@TheRestOfMe
Copy link
Copy Markdown
Member Author

Think I have a better handle on dealing with SSL certs in the context of the osh-node project. This driver uses https when polling the ndbc server. So I was getting SSL handshake errors running from launch.sh initially. I added the ndbc cert file to 'osh-node/dist/common/trusted_certificates' and it works. Not sure where it should be located in the driver- resources maybe?

At any rate, I've pushed latest code up to the repo. I think I covered all the changes in Nick's comments. The root build.gradle file required some minor changes also to get my local build to work. I will ask tomorrow morning about best route for adding crt file and resolving the build file issue in the osh-node repo.


// #STN LAT LON YYYY MM DD hh mm WDIR WSPD GST WVHT DPD APD MWD PRES PTDY ATMP WTMP DEWP VIS TIDE
public static boolean checkHeader(String header) {
// TODO check fields are as expected
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is a planned enhancement to the module, make sure we log it in the backlog with enough detail to come in here and complete.

// #text deg deg yr mo day hr mn degT m/s m/s m sec sec degT hPa hPa degC degC degC nmi ft
public static boolean checkUnits(String units) {
String [] fields = units.split("\\s+");
// TODO check units are as expected
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is a planned enhancement to the module, make sure we log it in the backlog with enough detail to come in here and complete.

try {
return Double.parseDouble(s);
} catch (NumberFormatException e) {
logger.error("", e);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty log messasge

try {
return Integer.parseInt(s);
} catch (NumberFormatException e) {
logger.error("", e);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty log message


public class BuoyEnums {

public enum ObsParam
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to encapsulate this enum within the parent class or will it suffice to just remove the inner enum and change the outer class to an enum?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants