Skip to content

Commit

Permalink
Update repair time handling (#174)
Browse files Browse the repository at this point in the history
Signed-off-by: Alyona Teyber <[email protected]>
  • Loading branch information
aivanova5 authored Feb 28, 2024
1 parent 779394d commit 8485300
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions module/powerflow/pole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -575,23 +575,29 @@ TIMESTAMP pole::postsync(TIMESTAMP t0) ////
down_time = gl_globalclock;
verbose("down_time = %lld", down_time);
}

// // M = a * V^2 + b * V + c
// // TODO
// pole_stress_polynomial_a = pole_moment_per_wind + equipment_moment_nowind + wire_moment_nowind;
// pole_stress_polynomial_b = 0.0;
// pole_stress_polynomial_c = wire_tension;

TIMESTAMP next_event = pole_status == PS_FAILED ? down_time + (int)(repair_time*3600) : TS_NEVER;
verbose("next_event = %lld", next_event); //// should return repair time
recalc = false;
return stop_on_pole_failure && pole_status == PS_FAILED ? TS_INVALID : next_event;
}
else
{
verbose("no pole recalculation flagged");
return TS_NEVER;
}

if ( pole_status == PS_FAILED )
{
if ( stop_on_pole_failure )
{
return TS_INVALID;
}
TIMESTAMP next_event = down_time + (int)(repair_time*3600);
if ( t0 == next_event )
{
return TS_NEVER;
}
verbose("next_event = %lld", next_event); //// should return repair time
return next_event;

}
return TS_NEVER;
}

TIMESTAMP pole::commit(TIMESTAMP t1, TIMESTAMP t2)
Expand Down

0 comments on commit 8485300

Please sign in to comment.