@@ 105,7 105,7 @@ update msg model =
else
update (NextSteps (n - 1)) <| Tuple.first <| update (NextStep model.finishRound) model
-
+
Step s ->
case s of
S0 ->
@@ 120,9 120,18 @@ update msg model =
S2 ->
-- S2 does S3
- let f = conditionalScrap model.scrapLimit >> justDoneToDone >> wipToJustDone model.round in
- ( chain <| applyStep model.kitForNkit ( Just f,
- Just f) model, Cmd.none )
+ let
+ f =
+ conditionalScrap model.scrapLimit >> justDoneToDone >> wipToJustDone model.round
+ in
+ ( chain <|
+ applyStep model.kitForNkit
+ ( Just f
+ , Just f
+ )
+ model
+ , Cmd.none
+ )
-- FIXME: updatewaiting moves justDone to Done, which it shouldn't
S3 ->
@@ 193,7 202,7 @@ update msg model =
defaultToCurrentModel <| Maybe.map (\y -> applyStep model.kitForNkit ( Just <| identifyScrap y, Just <| identifyScrap y ) <| { model | scrapLimit = Just y }) <| validIntInput 0 500 x
SwapKITForNKIT ->
- ( { model | kitForNkit = not model.kitForNkit}, Cmd.none )
+ ( { model | kitForNkit = not model.kitForNkit }, Cmd.none )
SwapAutoPlay ->
( { model | autoPlay = not model.autoPlay }, Cmd.none )
@@ 362,6 371,24 @@ view model =
scrapLimitInterface =
interface2 (String.fromInt <| Maybe.withDefault 0 model.scrapLimit) (Maybe.Extra.isNothing model.scrapLimit) [ text "scrap after", text "rounds" ] ChangedScrapLimit (text "rounds")
+ scrapShare =
+ case model.scrapLimit of
+ Nothing ->
+ Element.none
+
+ Just _ ->
+ let
+ all =
+ getAll model.nkit
+
+ scrapped =
+ List.filter (.conditions >> .scrapped) all
+
+ share =
+ (\x -> x * 100) <| safeDiv (toFloat <| List.length scrapped) (toFloat <| List.length all)
+ in
+ column [ width fill, height fill, spacing 5 ] [ text <| String.fromFloat share ++ "% of jobs", text "in NKIT scrapped" ]
+
batchButtons =
let
bButton n =
@@ 439,16 466,16 @@ view model =
playInterface =
row [ spacing 10, padding 13, Font.size 12, width fill ]
- [ column [width fill, height fill, spacing 7] [autoPlayer, kitForNkit]
+ [ column [ width fill, height fill, spacing 7 ] [ autoPlayer, kitForNkit ]
, reworkProbInterface
- , scrapLimitInterface
+ , column [ width fill, height fill, spacing 5 ] [ scrapLimitInterface, scrapShare ]
--, stopThresholds
]
kitForNkit =
row [ Font.size 12, spacing 10, width fill ]
- [ column [ spacing 5, Border.width 1, padding 5 ] [ text "KIT4NKIT", swapKITForNKITButton]
+ [ column [ spacing 5, Border.width 1, padding 5 ] [ text "KIT4NKIT", swapKITForNKITButton ]
]
autoPlayer =
@@ 456,7 483,6 @@ view model =
[ column [ spacing 5, Border.width 1, padding 5 ] [ text "AutoPlay", autoPlayButton ]
]
-
--lower =
-- row [ spacing 20, width fill, height fill ] [ viewField squareSizeUndone squareSizeDone model.nkit "NKIT", viewField squareSizeUndone squareSizeDone model.kit "KIT" ]
netWidth =