25 lines
1.4 KiB
PowerShell
25 lines
1.4 KiB
PowerShell
$file = "UIrrigation_Impl.inc"
|
|
$text = Get-Content $file -Encoding UTF8 -Raw
|
|
|
|
# 1. 함수 선언부 변경
|
|
$oldFunc = "function EvalIrriConditions(const AConds: array of TAutoCondItem; AMode: TAutoCondMode): Boolean;`r`nvar i: Integer;`r`nbegin`r`n if Length(AConds) = 0 then Exit(True);"
|
|
$newFunc = "function EvalIrriConditions(const AConds: array of TAutoCondItem; AMode: TAutoCondMode; AEmptyResult: Boolean): Boolean;`r`nvar i: Integer;`r`nbegin`r`n if Length(AConds) = 0 then Exit(AEmptyResult);"
|
|
$text = $text.Replace($oldFunc, $newFunc)
|
|
|
|
# 2. StartConds 호출부 변경 (대기 중 및 시작 조건) -> 빈 배열일 시 True (무조건 시작)
|
|
$oldStart = "EvalIrriConditions(CurAct.StartConds, CurAct.StartCondMode)"
|
|
$newStart = "EvalIrriConditions(CurAct.StartConds, CurAct.StartCondMode, True)"
|
|
$text = $text.Replace($oldStart, $newStart)
|
|
|
|
# 3. StopConds 호출부 변경 -> 빈 배열일 시 False (조건 없이 즉시 쿨다운/정지 안함)
|
|
$oldStop = "EvalIrriConditions(CurAct.StopConds, CurAct.StopCondMode)"
|
|
$newStop = "EvalIrriConditions(CurAct.StopConds, CurAct.StopCondMode, False)"
|
|
$text = $text.Replace($oldStop, $newStop)
|
|
|
|
# 4. EndConds 호출부 변경 -> 빈 배열일 시 False (조건 없이 즉시 종료 안함)
|
|
$oldEnd = "EvalIrriConditions(CurAct.EndConds, CurAct.EndCondMode)"
|
|
$newEnd = "EvalIrriConditions(CurAct.EndConds, CurAct.EndCondMode, False)"
|
|
$text = $text.Replace($oldEnd, $newEnd)
|
|
|
|
Set-Content $file -Value $text -Encoding UTF8
|