Skip to content

Commit

Permalink
Change_HPA_message_to_stop_flashing_&_move_to_end_of_line
Browse files Browse the repository at this point in the history
The HPA message alternating with the drive model serial
number made reading the serial number quite a challenge
and made the display far too messy looking when displaying
20+ drives or even 10+ drives with differing HPA statuses.

Removed, alternating appearance.
Reduced size of message.
Placed after temperature, before drive model/serial in display.
  • Loading branch information
PartialVolume committed Oct 17, 2023
1 parent ab9d269 commit 725c79b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 40 deletions.
1 change: 1 addition & 0 deletions src/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ int check_device( nwipe_context_t*** c, PedDevice* dev, int dcount )
}

/* Initialise the variables that toggle the [size][temp c] with [HPA status]
* Not currently used, but may be used in the future or for other purposes
*/
next_device->HPA_toggle_time = time( NULL );
next_device->HPA_display_toggle_state = 0;
Expand Down
64 changes: 24 additions & 40 deletions src/gui.c
Original file line number Diff line number Diff line change
Expand Up @@ -832,51 +832,35 @@ void nwipe_gui_select( int count, nwipe_context_t** c )
/* print the temperature */
wprintw_temperature( c[i + offset] );

/* Toggle the drive/serial with [HDA/DCO Status]
*/
switch( c[i + offset]->HPA_display_toggle_state )
switch( c[i + offset]->HPA_status )
{
case 0:
/* print the drive model and serial number */
wprintw( main_window, " %s/%s", c[i + offset]->device_model, c[i + offset]->device_serial_no );
case HPA_ENABLED:
wprintw( main_window, " " );
wattron( main_window, COLOR_PAIR( 9 ) );
wprintw( main_window, "[HS? YES!]" );
wattroff( main_window, COLOR_PAIR( 9 ) );
break;

case 1:
switch( c[i + offset]->HPA_status )
{
case HPA_ENABLED:
wprintw( main_window, " " );
wattron( main_window, COLOR_PAIR( 9 ) );
wprintw( main_window, " HPA/DCO Hidden sectors detected !!" );
wattroff( main_window, COLOR_PAIR( 9 ) );
break;

case HPA_DISABLED:
wprintw( main_window, " " );
wprintw( main_window, "HPA/DCO No hidden sectors detected " );
break;

case HPA_UNKNOWN:
wprintw( main_window, " " );
wattron( main_window, COLOR_PAIR( 9 ) );
wprintw( main_window, " HPA/DCO hidden sectors indeterminate " );
wattroff( main_window, COLOR_PAIR( 9 ) );
break;

case HPA_NOT_APPLICABLE:
/* print the drive model and serial number */
wprintw( main_window,
" %s/%s",
c[i + offset]->device_model,
c[i + offset]->device_serial_no );
break;

default:

break;
}
case HPA_DISABLED:
wprintw( main_window, " " );
wprintw( main_window, "[HS? NO ]" );
break;

case HPA_UNKNOWN:
wprintw( main_window, " " );
wprintw( main_window, "[HS? ???]" );
break;

default:

wprintw( main_window, " " );
wprintw( main_window, "[HS? N/A]" );
break;
}

/* print the drive model and serial number */
wprintw( main_window, " %s/%s", c[i + offset]->device_model, c[i + offset]->device_serial_no );

if( c[i + offset]->HPA_toggle_time + 1 < time( NULL ) )
{
switch( c[i + offset]->HPA_display_toggle_state )
Expand Down

0 comments on commit 725c79b

Please sign in to comment.