From 84c8da773f1afe6e22cc4aca0f39cab1a76153b5 Mon Sep 17 00:00:00 2001 From: Archontis Pantelopoulos Date: Sat, 26 Mar 2022 17:49:00 +0000 Subject: [PATCH] minor changes in symbol --- src/Renderer/DrawBlock/Symbol.fs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Renderer/DrawBlock/Symbol.fs b/src/Renderer/DrawBlock/Symbol.fs index 230b498..2334f08 100644 --- a/src/Renderer/DrawBlock/Symbol.fs +++ b/src/Renderer/DrawBlock/Symbol.fs @@ -467,6 +467,10 @@ let flipVPortMap (map:Map) (symbol:Symbol) = failwithf "Not implemented Yet" //////////////////////////////////////////////////// + +///////////////////////////// CustomPortMovement HELPERS ///////////////////////////////////// + + /// Helper function to change the side/ordering of ports on custom components /// First it inverts the name map to find the key of the port which should change /// If the newside submitted matches the current side then the SideIndex fields of the ports on that side are altered accordingly to bring the port in the beggining of the specific side @@ -1361,7 +1365,7 @@ let update (msg : Msg) (model : Model): Model*Cmd<'a> = { model with Symbols = Map.add sId addsym model.Symbols }, Cmd.none | ChangePort (sId, portName, portSide) -> - //extract info required from Map to store to SI field of Component + //extract info required from Map to store in SI field of Component let extractToSI map = let lst = map |> Map.toList lst |> List.map (fun x -> @@ -1377,7 +1381,7 @@ let update (msg : Msg) (model : Model): Model*Cmd<'a> = | "Bottom" -> Bottom | "Left" -> Left | "Right" -> Right - | _ -> failwithf "Side not implemented" + | _ -> failwithf "Undefined Side" let symbol' = {targetSymbol with APortOffsetsMap = (changePortSide targetSymbol.APortOffsetsMap portName newSide targetSymbol)} //change ports' Side and SideIndex fields let symbol'' = redefineCustomHW symbol' //change Height Width based on new sides (total ports on each side)