diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/ivymon | 46 |
1 files changed, 20 insertions, 26 deletions
@@ -183,8 +183,6 @@ my $replay_current_t0; my $replay_current_t; my $replay_data_t0; my $replay_data_t; -my $replay_pause_t; -my $replay_pause_duration = 0; my $replay_maxgap = 0.2; # sec my $replay_regulpct = [50, 20]; # % my $replay_factor = 1000; # msec @@ -2337,14 +2335,7 @@ sub loadfileForReplay { -command => sub { return if $realspeedrate == 1; $realspeedrate = 1; - $replay_data_t0 = $replay_time; - $replay_current_t0 = gettimeofday(); - if ($replay_running == 0) { - $replay_pause_t = $replay_current_t0; - } else { - $replay_pause_t = undef; - } - $replay_pause_duration = 0; + ®ulationReset(); }, -selectcolor => 'white')->pack(-side => 'left'); $ctrl_fm1->Radiobutton(-text => "x2", -indicatoron => 0, @@ -2442,7 +2433,7 @@ sub loadfileForReplay { $message =~ s/\"$//; push(@{$replay_msg{$time}}, $message); $replay_text->insert('end', &replayTime($time)." ".$message."\n", $time); - # when user click on a message, the begin time changes. + # when user click on a message the begin time changes. $replay_text->tagBind($time, '<1>', [sub { my $ti = $_[1]; my $replay_was_running; @@ -2450,17 +2441,17 @@ sub loadfileForReplay { $replay_was_running = 1; &replayStop; } - my $fg = $replay_text->tagCget($ti, -foreground); - my $bg = $replay_text->tagCget($ti, -background); - $replay_text->tagConfigure($_[1], -foreground => 'white', - -background => 'gray50'); + $replay_text->tagConfigure($replay_last_time, + -foreground => $replay_fg_orig, + -background => $replay_bg_orig) + if defined $replay_last_time; + $replay_text->tagConfigure($ti, + -foreground => $replay_fg, + -background => $replay_bg); + $replay_last_time = $ti; $replay_hour = &replayTime($ti); $replay_time = $ti; - $replay_text->after(100, [sub { - $replay_text->tagConfigure($_[0], - -foreground => $fg, - -background => $bg); - }, $ti]); + ®ulationReset(); &replayStart if $replay_was_running; }, $time]); &setProgressbar($line, $step); @@ -2657,10 +2648,6 @@ sub replayStart { my $t = $replay_text; return if $replay_running and not $loopflag; return if $loopflag and not $replay_running; - if (defined $replay_pause_t and $replay_speed == 1) { - $replay_pause_duration += gettimeofday() - $replay_pause_t; - } - $replay_pause_t = undef; $replay_runnable = 0; $replay_running = 1; if ($replay_time > $replay_max_time) { @@ -2709,7 +2696,7 @@ sub replayStart { # continuous mode } else { - my $dt = gettimeofday() - $replay_current_t0 - $replay_pause_duration; + my $dt = gettimeofday() - $replay_current_t0; my $dt2 = sprintf("%.2f", $dt); my $d = sprintf("%.3f", $dt-$data_dt); @@ -2751,7 +2738,7 @@ sub replayStop { $replay_running = 0; $replay_runnable = 1; $replay_text->afterCancel($replay_timer) if defined $replay_timer; - $replay_pause_t = gettimeofday(); + ®ulationReset(); } # end replayStop @@ -2791,6 +2778,13 @@ sub replayTime { #---------------------------------------------------------------------------------- # General functions #---------------------------------------------------------------------------------- +sub regulationReset { + + $replay_data_t0 = undef; + $replay_current_t0 = undef; + +} # end regulationReset + sub enlarge { @packinfo = (); |