diff --git a/messung/farm/schlange/kritischer-pfad-0512.ps1 b/messung/farm/schlange/kritischer-pfad-0512.ps1 new file mode 100644 index 00000000..5ae0ad7a --- /dev/null +++ b/messung/farm/schlange/kritischer-pfad-0512.ps1 @@ -0,0 +1,21 @@ +# 05.12. main/Owner: Farm nur fuer den kritischen Pfad der Live-Fassung. Alles andere manuell anhalten bzw. halten (fortsetzbar, nichts beendet). +$Q = 'D:\Projects\pf-batterie\messung\farm\schlange' +$grund = 'manuell farm 05.12. ' + (Get-Date -Format 'HH:mm') + ': Owner - Farm nur kritischer Pfad (exakt-Bau 3e88ab53/Flop-Fenster, jamprobe-allein, temperatur, sim-gekauft); fortsetzen durch farm nach Freigabe' +function Erlaubt([string]$id) { $id -match '^(flop-fenster-.*3e88ab53|innovation-jamprobe-allein|motor-pi-aus-pruefung|temperatur-uhr-0995-.*|sim-?gekauft.*|simpool.*)$' } +$rang = @{ 'flop-fenster' = -10; 'innovation' = -9; 'motor-pi' = -8; 'temperatur' = -8; 'sim-gekauft' = -7 } +foreach ($f in Get-ChildItem "$Q\laufend" -Filter *.json) { + $id = $f.BaseName + if (Erlaubt $id) { continue } + if ((Test-Path "$Q\PAUSE\$id") -and ((Get-Content "$Q\PAUSE\$id" -Raw) -notmatch '^auto')) { continue } + Set-Content "$Q\PAUSE\$id" $grund -Encoding UTF8; "ANGEHALTEN $id" +} +foreach ($f in Get-ChildItem "$Q\auftraege" -Filter *.json) { + $id = $f.BaseName; $j = Get-Content $f.FullName -Raw | ConvertFrom-Json + if (Erlaubt $id) { + $r = $rang["$($j.sitzung)"]; if ($null -eq $r) { $r = -8 } + if ($j.prio -eq $r -and $j.kurz -eq $true) { continue } + $j | Add-Member -NotePropertyName prio -NotePropertyValue $r -Force; $j | Add-Member -NotePropertyName kurz -NotePropertyValue $true -Force + $t = "$($f.FullName).tmp"; $j | ConvertTo-Json -Compress -Depth 5 | Set-Content $t -Encoding UTF8; Move-Item $t $f.FullName -Force + "VORNE $id prio $r"; continue } + Rename-Item $f.FullName "$($f.Name).halten"; "GEHALTEN $id" +}