Skip to content

Heinrichs Weikamp: Display the Model for OSTC4 / OSTC5. #85

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

Open
wants to merge 1 commit into
base: Subsurface-DS9
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions src/hw_ostc_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@
#define OSTC4_SCRUBBER_STATE_ERROR_FLAG 0x4000
#define OSTC4_SCRUBBER_STATE_WARNING_FLAG 0x2000

#define OSTC5_STARTING_SERIAL 1500

typedef struct hw_ostc_sample_info_t {
unsigned int type;
unsigned int divisor;
Expand Down Expand Up @@ -818,19 +820,28 @@ hw_ostc_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, unsigned
break;
case 6:
if (parser->first_scrubber_time_minutes == INT_MAX) {
return DC_STATUS_DATAFORMAT;
return DC_STATUS_UNSUPPORTED;
}

string->desc = "Remaining scrubber time at start [minutes]";
snprintf(buf, BUFLEN, "%d", parser->first_scrubber_time_minutes);
break;
case 7:
if (parser->last_scrubber_time_minutes == INT_MAX) {
return DC_STATUS_DATAFORMAT;
return DC_STATUS_UNSUPPORTED;
}

string->desc = "Remaining scrubber time at end [minutes]";
snprintf(buf, BUFLEN, "%d", parser->last_scrubber_time_minutes);
break;
case 8:
if (parser->model != OSTC4) {
Copy link
Preview

Copilot AI Jun 8, 2025

Choose a reason for hiding this comment

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

Clarify the rationale behind using the parser's serial number to determine the model string after checking that parser->model is OSTC4. Adding a comment to explain the significance of the 1500 threshold will improve code maintainability.

Copilot uses AI. Check for mistakes.

return DC_STATUS_UNSUPPORTED;
}

string->desc = "Model";
snprintf(buf, BUFLEN, "%s", parser->serial < OSTC5_STARTING_SERIAL ? "OSTC4" : "OSTC5");

break;
default:
return DC_STATUS_UNSUPPORTED;
Expand Down
Loading