[bb] added status report on status bar

* also changed title to add "(Beta)"
This commit is contained in:
Pete Batard 2011-12-07 00:28:27 +00:00
parent 192c3d6cc8
commit f93a85ab83
4 changed files with 23 additions and 14 deletions

View File

@ -29,7 +29,8 @@ s/^[ \t]*FILEVERSION[ \t]*\(.*\),\(.*\),\(.*\),.*/ FILEVERSION \1,\2,\3,@@TAGVER
s/^[ \t]*PRODUCTVERSION[ \t]*\(.*\),\(.*\),\(.*\),.*/ PRODUCTVERSION \1,\2,\3,@@TAGVER@@/
s/^\([ \t]*\)VALUE[ \t]*"FileVersion",[ \t]*"\(.*\)\..*"/\1VALUE "FileVersion", "\2.@@TAGVER@@"/
s/^\([ \t]*\)VALUE[ \t]*"ProductVersion",[ \t]*"\(.*\)\..*"/\1VALUE "ProductVersion", "\2.@@TAGVER@@"/
s/^\(.*\)"Rufus v\(.*\)\.\(.*\)"\(.*\)/\1"Rufus v\2.@@TAGVER@@"\4/
# TODO: revert ' ' to '"' below when out of beta
s/^\(.*\)"Rufus v\(.*\)\.\(.*\) \(.*\)/\1"Rufus v\2.@@TAGVER@@ \4/
s/^\(.*\)"Version \(.*\) (Build \(.*\))"\(.*\)/\1"Version \2 (Build @@TAGVER@@)"\4/
_EOF
@ -44,7 +45,5 @@ sed -f cmd.sed src/rufus.rc > src/rufus.rc~
sed 's/$/\r/' src/rufus.rc~ > src/rufus.rc
rm src/rufus.rc~
git add src/rufus.rc
#sed -f cmd.sed _bm.sh > _bm.sh~
#mv _bm.sh~ _bm.sh
rm cmd.sed

View File

@ -277,6 +277,8 @@ static int s_flag = 1; /* show progress of test */
static int t_flag = 0; /* number of test patterns */
static unsigned int *t_patts = NULL; /* test patterns */
static int cancel_ops = 0; /* abort current operation */
static int cur_pattern, nr_pattern;
static int cur_op;
/* Abort test if more than this number of bad blocks has been encountered */
static unsigned int max_bb = EXT2_BAD_BLOCKS_THRESHOLD;
static DWORD time_start;
@ -361,8 +363,11 @@ static void print_status(void)
time_end = GetTickCount();
percent = calc_percent((unsigned long) currently_testing,
(unsigned long) num_blocks);
uprintf("%6.2f%% done, %4.0fs elapsed. "
PrintStatus("%d/%d(%c): %6.2f%% done, %.0fs elapsed. "
"(%d/%d/%d errors)",
2*cur_pattern - ((cur_op==OP_WRITE)?1:0),
2*nr_pattern,
(cur_op==OP_READ)?'R':'W',
percent,
(time_end - time_start)/1000.0,
num_read_errors,
@ -411,6 +416,7 @@ static void pattern_fill(unsigned char *buffer, unsigned int pattern,
i--;
}
PrintStatus("Testing with pattern 0x%02X", bpattern[i]);
cur_pattern++;
}
}
@ -564,9 +570,9 @@ static unsigned int test_ro (HANDLE hDrive, blk_t last_block,
static unsigned int test_rw(HANDLE hDrive, blk_t last_block, int block_size, blk_t first_block, unsigned int blocks_at_once)
{
unsigned char *buffer = NULL, *read_buffer;
const unsigned int patterns[] = {0xaa}; // {0xaa, 0x55, 0xff, 0x00};
const unsigned int patterns[] = {0xaa, 0x55, 0xff, 0x00};
const unsigned int *pattern;
int i, tryout, got, nr_pattern, pat_idx;
int i, tryout, got, pat_idx;
unsigned int bb_count = 0;
blk_t recover_block = ~0;
@ -588,6 +594,7 @@ static unsigned int test_rw(HANDLE hDrive, blk_t last_block, int block_size, blk
pattern = patterns;
nr_pattern = ARRAYSIZE(patterns);
}
cur_pattern = 0;
for (pat_idx = 0; pat_idx < nr_pattern; pat_idx++) {
if (cancel_ops) goto out;
@ -596,6 +603,7 @@ static unsigned int test_rw(HANDLE hDrive, blk_t last_block, int block_size, blk
currently_testing = first_block;
if (s_flag | v_flag)
uprintf("Writing\n");
cur_op = OP_WRITE;
tryout = blocks_at_once;
while (currently_testing < last_block) {
if (max_bb && bb_count >= max_bb) {
@ -630,6 +638,7 @@ static unsigned int test_rw(HANDLE hDrive, blk_t last_block, int block_size, blk
num_blocks = 0;
if (s_flag | v_flag)
uprintf("Reading and comparing\n");
cur_op = OP_READ;
num_blocks = last_block;
currently_testing = first_block;

View File

@ -43,12 +43,13 @@ typedef struct ext2_struct_u32_iterate *ext2_u32_iterate;
#define EXT2_SYS_PAGE_SIZE 4096
#define EXT2_TIMER_ID 0x1000
enum test_type {
enum test_types {
BADBLOCKS_RO, /* Read-only */
BADBLOCKS_RW, /* DESTRUCTIVE read-write */
BADBLOCKS_ND /* non-destructive read-write */
};
enum error_types { READ_ERROR, WRITE_ERROR, CORRUPTION_ERROR };
enum op_type { OP_READ, OP_WRITE };
/*
* Badblocks report

View File

@ -30,7 +30,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL
IDD_DIALOG DIALOGEX 12, 12, 206, 278
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_APPWINDOW
CAPTION "Rufus v1.0.2.81"
CAPTION "Rufus v1.0.2.82 (Beta)"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
DEFPUSHBUTTON "Start",IDC_START,94,236,50,14
@ -50,7 +50,7 @@ BEGIN
CONTROL "Create an &MS-DOS startup disk",IDC_DOS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,173,115,10
LTEXT "New volume &label",IDC_STATIC,9,121,105,10
CONTROL "",IDC_PROGRESS,"msctls_progress32",PBS_SMOOTH | WS_BORDER,7,210,189,9
CONTROL "Check device for bad blocks (*ALPHA*)",IDC_BADBLOCKS,
CONTROL "Check device for bad blocks",IDC_BADBLOCKS,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,185,171,10
END
@ -65,7 +65,7 @@ BEGIN
DEFPUSHBUTTON "OK",IDOK,231,175,50,14,WS_GROUP
CONTROL "<a href=""https://github.com/pbatard/rufus/wiki/Rufus"">https://github.com/pbatard/rufus</a>",IDC_ABOUT_RUFUS_URL,
"SysLink",WS_TABSTOP,46,47,114,9
LTEXT "Version 1.0.2 (Build 81)",IDC_STATIC,46,19,78,8
LTEXT "Version 1.0.2 (Build 82)",IDC_STATIC,46,19,78,8
PUSHBUTTON "License...",IDC_ABOUT_LICENSE,46,175,50,14,WS_GROUP
EDITTEXT IDC_ABOUT_COPYRIGHTS,46,107,235,63,ES_MULTILINE | ES_READONLY | WS_VSCROLL
LTEXT "Report bugs or request enhancements at:",IDC_STATIC,46,66,187,8
@ -164,8 +164,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,2,81
PRODUCTVERSION 1,0,2,81
FILEVERSION 1,0,2,82
PRODUCTVERSION 1,0,2,82
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -182,13 +182,13 @@ BEGIN
BEGIN
VALUE "CompanyName", "akeo.ie"
VALUE "FileDescription", "Rufus"
VALUE "FileVersion", "1.0.2.81"
VALUE "FileVersion", "1.0.2.82"
VALUE "InternalName", "Rufus"
VALUE "LegalCopyright", "© 2011 Pete Batard (GPL v3)"
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html"
VALUE "OriginalFilename", "rufus.exe"
VALUE "ProductName", "Rufus"
VALUE "ProductVersion", "1.0.2.81"
VALUE "ProductVersion", "1.0.2.82"
END
END
BLOCK "VarFileInfo"