Skip to content

Commit

Permalink
Added scrolling functionality in TruthTableView to view the complet…
Browse files Browse the repository at this point in the history
…e Truth Table.
  • Loading branch information
LH-and-FPGA authored and tomcl committed Nov 30, 2024
1 parent b85594c commit 0e4804a
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 21 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions simulator_tests/dotnet/dotnet.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@
<TargetFramework>net6.0</TargetFramework>
<SelfContained>true</SelfContained>
</PropertyGroup>
<PropertyGroup>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Renderer\Renderer.fsproj" />
<Compile Include="Program.fs" />
</ItemGroup>
<Import Project="..\..\.paket\Paket.Restore.targets" />
</Project>
</Project>
13 changes: 6 additions & 7 deletions src/Main/Main.fsproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<RuntimeIdentifiers>win-x64;linux-x64</RuntimeIdentifiers>
</PropertyGroup>

<ItemGroup>
<Compile Include="..\Renderer\Common\ElectronAPI.fs" Link="ElectronAPI.fs" />
<Compile Include="..\Renderer\UI\ContextMenus.fs" Link="ContextMenus.fs" />
Expand All @@ -13,15 +13,14 @@
<ItemGroup>
<PackageReference Include="Fable.Import.Electron" Version="0.1.1" />
</ItemGroup>
<Import Project="..\..\.paket\Paket.Restore.targets" />
<PropertyGroup>
<RepositoryUrl>https://github.com/tomcl/issie</RepositoryUrl>
<FsDocsReleaseNotesLink>https://github.com/tomcl/issie/releases/</FsDocsReleaseNotesLink>
<FsDocsLicenseLink>https://github.com/tomcl/issie/blob/master/LICENSE.md</FsDocsLicenseLink>
<FsDocsLogoSource>/issieIcon.png</FsDocsLogoSource>
</PropertyGroup>
<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>

<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
<Import Project="..\..\.paket\Paket.Restore.targets" />
</Project>
34 changes: 25 additions & 9 deletions src/Renderer/UI/TruthTable/TruthTableView.fs
Original file line number Diff line number Diff line change
Expand Up @@ -746,15 +746,15 @@ let viewTruthTable canvasState model dispatch =
let wholeSimRes = ModelHelpers.simulateModel false None 2 canvasState model
let wholeButton =
match wholeSimRes with
| Error simError,_ ->
| Error simError, _ ->
Button.button
[
Button.Color IColor.IsWarning
Button.OnClick (fun _ ->
SimulationView.setSimErrorFeedback simError model dispatch
GenerateTruthTable (Some wholeSimRes) |> ttDispatch)
] [str "See Problems"]
| Ok sd,_ ->
| Ok sd, _ ->
if sd.IsSynchronous = false then
Button.button
[
Expand All @@ -777,15 +777,15 @@ let viewTruthTable canvasState model dispatch =
let selButton =
match selSimRes with
| None -> div [] []
| Some (Error simError,_) ->
| Some (Error simError, _) ->
Button.button
[
Button.Color IColor.IsWarning
Button.OnClick (fun _ ->
SimulationView.setSimErrorFeedback simError model dispatch
GenerateTruthTable selSimRes |> ttDispatch)
] [str "See Problems"]
| Some (Ok sd,_) ->
| Some (Ok sd, _) ->
if sd.IsSynchronous = false then
Button.button
[
Expand All @@ -798,10 +798,18 @@ let viewTruthTable canvasState model dispatch =
Button.Color IColor.IsSuccess
Button.IsLight
Button.OnClick (fun _ ->
let popup = Notifications.errorPropsNotification "Truth Table generation only supported for Combinational Logic"
let popup =
Notifications.errorPropsNotification "Truth Table generation only supported for Combinational Logic"
dispatch <| SetPropertiesNotification popup)
] [str "Generate Truth Table"]
div [] [
div [
// Outer container supports scrolling
Style [
MaxHeight "calc(100vh - 50px)" // Subtract the height of the fixed content at the top
OverflowY OverflowOptions.Auto // Enable vertical scrolling
Padding "10px" // Increase padding
]
] [
str "Generate Truth Tables for combinational logic using this tab."
br []
hr []
Expand All @@ -810,8 +818,8 @@ let viewTruthTable canvasState model dispatch =
wholeButton
hr []
Heading.h5 [] [str "Truth Table for selected logic"]
br []
br []
br []
br []
selButton
hr []
]
Expand Down Expand Up @@ -853,7 +861,14 @@ let viewTruthTable canvasState model dispatch =
makeMenuGroup true "Truth Table" [body; br []; hr []]
]

div [] [
div [
// Outer container supports scrolling
Style [
MaxHeight "calc(100vh - 50px)" // Subtract the height of the fixed content at the top
OverflowY OverflowOptions.Auto // Enable vertical scrolling
Padding "10px" // Increase padding
]
] [
Button.button
[ Button.Color IsDanger; Button.OnClick closeTruthTable ]
[ str "Close Truth Table" ]
Expand All @@ -862,3 +877,4 @@ let viewTruthTable canvasState model dispatch =
pressing the \"Generate Truth Table\" button."
menu
]

0 comments on commit 0e4804a

Please sign in to comment.