Reworked auto mode and pass status sections
This commit is contained in:
parent
2272d133f9
commit
0c8de47893
1 changed files with 8 additions and 7 deletions
|
|
@ -106,12 +106,14 @@ class BlockPair():
|
||||||
self.pass_done = [True, True, True]
|
self.pass_done = [True, True, True]
|
||||||
self.rescued = self.size
|
self.rescued = self.size
|
||||||
self.status[pass_num] = get_formatted_status(
|
self.status[pass_num] = get_formatted_status(
|
||||||
label='Pass {}'.format(pass_num),
|
label='Pass {}'.format(pass_num+1),
|
||||||
data=100)
|
data=100)
|
||||||
# Mark future passes as Skipped
|
# Mark future passes as Skipped
|
||||||
pass_num += 1
|
pass_num += 1
|
||||||
while pass_num <= 2:
|
while pass_num <= 2:
|
||||||
self.status[pass_num] = 'Skipped'
|
self.status[pass_num] = get_formatted_status(
|
||||||
|
label='Pass {}'.format(pass_num+1),
|
||||||
|
data='Skipped')
|
||||||
pass_num += 1
|
pass_num += 1
|
||||||
else:
|
else:
|
||||||
self.pass_done[pass_num] = True
|
self.pass_done[pass_num] = True
|
||||||
|
|
@ -723,20 +725,18 @@ def menu_main(state):
|
||||||
while auto_run or not state.started:
|
while auto_run or not state.started:
|
||||||
state.started = True
|
state.started = True
|
||||||
run_ddrescue(state, pass_settings)
|
run_ddrescue(state, pass_settings)
|
||||||
if state.finished or not auto_run:
|
|
||||||
state.set_pass_num()
|
|
||||||
break
|
|
||||||
if state.current_pass_done():
|
if state.current_pass_done():
|
||||||
if (state.current_pass == 0 and
|
if (state.current_pass == 0 and
|
||||||
state.current_pass_min() < AUTO_PASS_1_THRESHOLD):
|
state.current_pass_min() < AUTO_PASS_1_THRESHOLD):
|
||||||
auto_run = False
|
auto_run = False
|
||||||
if (state.current_pass == 1 and
|
elif (state.current_pass == 1 and
|
||||||
state.current_pass_min() < AUTO_PASS_2_THRESHOLD):
|
state.current_pass_min() < AUTO_PASS_2_THRESHOLD):
|
||||||
auto_run = False
|
auto_run = False
|
||||||
else:
|
else:
|
||||||
auto_run = False
|
auto_run = False
|
||||||
# Update current pass for next iteration
|
|
||||||
state.set_pass_num()
|
state.set_pass_num()
|
||||||
|
if state.finished:
|
||||||
|
break
|
||||||
|
|
||||||
elif selection == 'C':
|
elif selection == 'C':
|
||||||
menu_settings(state)
|
menu_settings(state)
|
||||||
|
|
@ -919,6 +919,7 @@ def run_ddrescue(state, pass_settings):
|
||||||
else:
|
else:
|
||||||
# Mark pass finished
|
# Mark pass finished
|
||||||
bp.finish_pass(state.current_pass)
|
bp.finish_pass(state.current_pass)
|
||||||
|
update_sidepane(state)
|
||||||
|
|
||||||
# Done
|
# Done
|
||||||
if str(return_code) != '0':
|
if str(return_code) != '0':
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue