-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Сильно переписал определение минимальных размеров элементов схемы. Дописал VirtualizationMode="None" к каждому ListBox'у в качестве багофикса явного бага авалонии: AvaloniaUI/Avalonia#4265 Разумеется своим умом до такого решения я бы впринципе никогда в жизни бы не дошёл, без жёстких навыков дизассемблерщика кншн XD
- Loading branch information
Showing
10 changed files
with
108 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<UserControl xmlns="https://github.com/avaloniaui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d" d:DesignWidth="{Binding UC_Width}" d:DesignHeight="{Binding UC_Height}" | ||
Width="{Binding UC_Width}" Height="{Binding UC_Height}" | ||
x:Class="LogicSimulator.Views.Shapes.AND_8" | ||
Tag="Gate"> | ||
|
||
<Canvas Tag="Gate"> | ||
<Border Tag="Body" Margin="{Binding BodyMargin}" Background="#08c" BorderThickness="{Binding BodyStrokeSize}" BorderBrush="#4cf" Width="{Binding BodyWidth}" Height="{Binding BodyHeight}" CornerRadius="{Binding BodyRadius}"> | ||
<Panel> | ||
<TextBlock Tag="Body" FontSize="{Binding FontSizze}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White">AND</TextBlock> | ||
<Image Tag="Resizer" Width="{Binding ImageSize}" VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="{Binding ImageMargins}" Height="{Binding ImageSize}" Source="avares://LogicSimulator/Assets/Resizer.png"/> | ||
</Panel> | ||
</Border> | ||
</Canvas> | ||
</UserControl> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using Avalonia.Controls; | ||
using System.ComponentModel; | ||
|
||
namespace LogicSimulator.Views.Shapes { | ||
public partial class AND_8: GateBase, IGate, INotifyPropertyChanged { | ||
public override int TypeId => 11; | ||
|
||
public override UserControl GetSelf() => this; | ||
protected override IGate GetSelfI => this; | ||
protected override int[][] Sides => new int[][] { | ||
System.Array.Empty<int>(), | ||
new int[] { 0, 0, 0, 0, 0, 0, 0, 0 }, | ||
new int[] { 1 }, | ||
System.Array.Empty<int>() | ||
}; | ||
|
||
protected override void Init() => InitializeComponent(); | ||
|
||
/* | ||
* Мозги | ||
*/ | ||
|
||
public void Brain(ref bool[] ins, ref bool[] outs) => outs[0] = ins[0] && ins[1] && ins[2] && ins[3] && ins[3] && ins[5] && ins[6] && ins[7]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<UserControl xmlns="https://github.com/avaloniaui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d" d:DesignWidth="{Binding UC_Width}" d:DesignHeight="{Binding UC_Height}" | ||
Width="{Binding UC_Width}" Height="{Binding UC_Height}" | ||
x:Class="LogicSimulator.Views.Shapes.OR_8" | ||
Tag="Gate"> | ||
|
||
<Canvas Tag="Gate"> | ||
<Border Tag="Body" Margin="{Binding BodyMargin}" Background="#08c" BorderThickness="{Binding BodyStrokeSize}" BorderBrush="#4cf" Width="{Binding BodyWidth}" Height="{Binding BodyHeight}" CornerRadius="{Binding BodyRadius}"> | ||
<Panel> | ||
<TextBlock Tag="Body" FontSize="{Binding FontSizze}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White">OR</TextBlock> | ||
<Image Tag="Resizer" Width="{Binding ImageSize}" VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="{Binding ImageMargins}" Height="{Binding ImageSize}" Source="avares://LogicSimulator/Assets/Resizer.png"/> | ||
</Panel> | ||
</Border> | ||
</Canvas> | ||
</UserControl> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using Avalonia.Controls; | ||
using System.ComponentModel; | ||
|
||
namespace LogicSimulator.Views.Shapes { | ||
public partial class OR_8: GateBase, IGate, INotifyPropertyChanged { | ||
public override int TypeId => 10; | ||
|
||
public override UserControl GetSelf() => this; | ||
protected override IGate GetSelfI => this; | ||
protected override int[][] Sides => new int[][] { | ||
System.Array.Empty<int>(), | ||
new int[] { 0, 0, 0, 0, 0, 0, 0, 0 }, | ||
new int[] { 1 }, | ||
System.Array.Empty<int>() | ||
}; | ||
|
||
protected override void Init() => InitializeComponent(); | ||
|
||
/* | ||
* Мозги | ||
*/ | ||
|
||
public void Brain(ref bool[] ins, ref bool[] outs) => outs[0] = ins[0] || ins[1] || ins[2] || ins[3] || ins[4] || ins[5] || ins[6] || ins[7]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"name": "Для тестирования", "created": 1683838621, "modified": 1683839324, "items": [{"id": 5, "pos": "$p$149,242", "size": "$s$75,75", "base_size": 25, "state": false}, {"id": 5, "pos": "$p$153,330", "size": "$s$75,75", "base_size": 25, "state": false}, {"id": 5, "pos": "$p$152,414", "size": "$s$75,75", "base_size": 25, "state": false}, {"id": 5, "pos": "$p$149,497", "size": "$s$75,75", "base_size": 25, "state": false}, {"id": 9, "pos": "$p$587,328", "size": "$s$105,105", "base_size": 25, "state": "0.1.0.1.0.0"}, {"id": 3, "pos": "$p$339,236", "size": "$s$90,90", "base_size": 25}, {"id": 3, "pos": "$p$348,336", "size": "$s$90,90", "base_size": 25}, {"id": 3, "pos": "$p$352,444", "size": "$s$90,90", "base_size": 25}, {"id": 3, "pos": "$p$355,546", "size": "$s$90,90", "base_size": 25}, {"id": 9, "pos": "$p$594,460", "size": "$s$105,105", "base_size": 25, "state": "0.0.1.0.0.0"}, {"id": 3, "pos": "$p$591,182", "size": "$s$90,90", "base_size": 25}, {"id": 7, "pos": "$p$749,199", "size": "$s$75,75", "base_size": 25}, {"id": 7, "pos": "$p$750,276", "size": "$s$75,75", "base_size": 25}, {"id": 7, "pos": "$p$751,354", "size": "$s$75,75", "base_size": 25}, {"id": 7, "pos": "$p$751,430", "size": "$s$75,75", "base_size": 25}, {"id": 7, "pos": "$p$752,506", "size": "$s$75,75", "base_size": 25}, {"id": 7, "pos": "$p$755,584", "size": "$s$75,75", "base_size": 25}, {"id": 1, "pos": "$p$592,596", "size": "$s$90,90", "base_size": 25}], "joins": [[0, 0, "Out", 5, 0, "In"], [1, 0, "Out", 6, 0, "In"], [2, 0, "Out", 7, 0, "In"], [3, 0, "Out", 8, 0, "In"], [4, 3, "Out", 6, 1, "In"], [11, 0, "In", 4, 3, "Out"], [4, 4, "Out", 10, 0, "In"], [12, 0, "In", 4, 4, "Out"], [13, 0, "In", 4, 5, "Out"], [4, 5, "Out", 17, 0, "In"], [4, 0, "In", 5, 2, "Out"], [6, 2, "Out", 4, 1, "In"], [6, 2, "Out", 9, 2, "In"], [7, 2, "Out", 4, 2, "In"], [7, 2, "Out", 9, 1, "In"], [8, 2, "Out", 9, 0, "In"], [9, 3, "Out", 10, 1, "In"], [14, 0, "In", 9, 3, "Out"], [15, 0, "In", 9, 4, "Out"], [9, 4, "Out", 17, 1, "In"], [16, 0, "In", 9, 5, "Out"], [9, 5, "Out", 7, 1, "In"], [10, 2, "Out", 5, 1, "In"], [17, 2, "Out", 8, 1, "In"]], "states": "00000100010000000000000"} | ||
{"name": "Для тестирования #2", "created": 1683843280, "modified": 1683846735, "items": [{"id": 3, "pos": "$p$6127,2377", "size": "$s$720,685", "base_size": 185.00624860645544}, {"id": 3, "pos": "$p$6127,3058", "size": "$s$720,685", "base_size": 185.00624860645544}, {"id": 3, "pos": "$p$6136,3747", "size": "$s$720,685", "base_size": 185.00624860645544}, {"id": 3, "pos": "$p$6172,4437", "size": "$s$720,685", "base_size": 185.00624860645544}, {"id": 7, "pos": "$p$9064,2637", "size": "$s$720,685", "base_size": 185.00624860645544}, {"id": 7, "pos": "$p$7829,2583", "size": "$s$720,685", "base_size": 185.00624860645544}, {"id": 7, "pos": "$p$8438,1911", "size": "$s$720,685", "base_size": 185.00624860645544}, {"id": 7, "pos": "$p$8420,3273", "size": "$s$720,685", "base_size": 185.00624860645544}, {"id": 7, "pos": "$p$7739,3917", "size": "$s$720,685", "base_size": 185.00624860645544}, {"id": 7, "pos": "$p$8420,4544", "size": "$s$720,685", "base_size": 185.00624860645544}, {"id": 7, "pos": "$p$9199,3917", "size": "$s$720,685", "base_size": 185.00624860645544}, {"id": 3, "pos": "$p$6208,5153", "size": "$s$720,685", "base_size": 185.00624860645544}, {"id": 3, "pos": "$p$6127,1679", "size": "$s$720,685", "base_size": 185.00624860645544}, {"id": 3, "pos": "$p$6127,989", "size": "$s$720,685", "base_size": 185.00624860645544}, {"id": 10, "pos": "$p$4108,933", "size": "$s$366,861", "base_size": 104.43120423539197}, {"id": 10, "pos": "$p$4121,1805", "size": "$s$366,861", "base_size": 104.43120423539197}, {"id": 10, "pos": "$p$4133,2675", "size": "$s$366,861", "base_size": 104.43120423539197}, {"id": 10, "pos": "$p$4141,3552", "size": "$s$366,861", "base_size": 104.43120423539197}, {"id": 10, "pos": "$p$4141,4438", "size": "$s$366,861", "base_size": 104.43120423539197}, {"id": 10, "pos": "$p$4158,5303", "size": "$s$366,861", "base_size": 104.43120423539197}, {"id": 10, "pos": "$p$4145,6180", "size": "$s$366,861", "base_size": 104.43120423539197}, {"id": 5, "pos": "$p$-1385,804", "size": "$s$714,702", "base_size": 203.50687346710035, "state": false}, {"id": 5, "pos": "$p$-1369,1537", "size": "$s$714,702", "base_size": 203.50687346710035, "state": false}, {"id": 5, "pos": "$p$-1353,2310", "size": "$s$714,702", "base_size": 203.50687346710035, "state": false}, {"id": 5, "pos": "$p$-1353,3075", "size": "$s$714,702", "base_size": 203.50687346710035, "state": false}, {"id": 5, "pos": "$p$-1412,5012", "size": "$s$714,702", "base_size": 203.50687346710035, "state": false}, {"id": 2, "pos": "$p$-746,1138", "size": "$s$333,327", "base_size": 94.93745839581057}, {"id": 2, "pos": "$p$-700,1878", "size": "$s$333,327", "base_size": 94.93745839581057}, {"id": 2, "pos": "$p$-712,2672", "size": "$s$333,327", "base_size": 94.93745839581057}, {"id": 2, "pos": "$p$-719,3477", "size": "$s$333,327", "base_size": 94.93745839581057}, {"id": 11, "pos": "$p$755,1028", "size": "$s$275,647", "base_size": 78.46070941802523}, {"id": 11, "pos": "$p$784,1715", "size": "$s$275,647", "base_size": 78.46070941802523}, {"id": 11, "pos": "$p$762,353", "size": "$s$275,647", "base_size": 78.46070941802523}, {"id": 11, "pos": "$p$771,-315", "size": "$s$275,647", "base_size": 78.46070941802523}, {"id": 11, "pos": "$p$787,2386", "size": "$s$275,647", "base_size": 78.46070941802523}, {"id": 11, "pos": "$p$787,3035", "size": "$s$275,647", "base_size": 78.46070941802523}, {"id": 11, "pos": "$p$781,3713", "size": "$s$275,647", "base_size": 78.46070941802523}, {"id": 11, "pos": "$p$778,4369", "size": "$s$275,647", "base_size": 78.46070941802523}, {"id": 11, "pos": "$p$759,-997", "size": "$s$275,647", "base_size": 78.46070941802523}, {"id": 11, "pos": "$p$759,-1665", "size": "$s$275,647", "base_size": 78.46070941802523}, {"id": 11, "pos": "$p$769,5053", "size": "$s$275,647", "base_size": 78.46070941802523}, {"id": 11, "pos": "$p$756,5753", "size": "$s$275,647", "base_size": 78.46070941802523}, {"id": 11, "pos": "$p$753,-2355", "size": "$s$275,647", "base_size": 78.46070941802523}, {"id": 11, "pos": "$p$789,6438", "size": "$s$275,647", "base_size": 78.46070941802523}, {"id": 11, "pos": "$p$785,7094", "size": "$s$275,647", "base_size": 78.46070941802523}, {"id": 11, "pos": "$p$791,7752", "size": "$s$275,647", "base_size": 78.46070941802516}, {"id": 2, "pos": "$p$403,-2225", "size": "$s$87,86", "base_size": 25}, {"id": 2, "pos": "$p$432,-1544", "size": "$s$87,86", "base_size": 25}, {"id": 2, "pos": "$p$422,-880", "size": "$s$87,86", "base_size": 25}, {"id": 2, "pos": "$p$423,-194", "size": "$s$83,83", "base_size": 25}, {"id": 2, "pos": "$p$417,467", "size": "$s$83,83", "base_size": 25}], "joins": [[4, 0, "In", 0, 2, "Out"], [7, 0, "In", 1, 2, "Out"], [8, 0, "In", 2, 2, "Out"], [10, 0, "In", 3, 2, "Out"], [9, 0, "In", 11, 2, "Out"], [5, 0, "In", 12, 2, "Out"], [6, 0, "In", 13, 2, "Out"], [14, 8, "Out", 13, 0, "In"], [15, 8, "Out", 12, 0, "In"], [16, 8, "Out", 0, 0, "In"], [17, 8, "Out", 1, 0, "In"], [18, 8, "Out", 2, 0, "In"], [19, 8, "Out", 3, 0, "In"], [20, 8, "Out", 11, 0, "In"], [26, 0, "In", 21, 0, "Out"], [27, 0, "In", 22, 0, "Out"], [28, 0, "In", 23, 0, "Out"], [29, 0, "In", 24, 0, "Out"], [46, 1, "Out", 42, 4, "In"], [46, 1, "Out", 42, 5, "In"], [46, 1, "Out", 42, 6, "In"], [46, 1, "Out", 42, 7, "In"], [47, 1, "Out", 39, 4, "In"], [39, 5, "In", 47, 1, "Out"], [47, 1, "Out", 39, 6, "In"], [39, 7, "In", 47, 1, "Out"], [48, 1, "Out", 38, 4, "In"], [48, 1, "Out", 38, 5, "In"], [48, 1, "Out", 38, 6, "In"], [48, 1, "Out", 38, 7, "In"], [49, 1, "Out", 33, 4, "In"], [49, 1, "Out", 33, 5, "In"], [49, 1, "Out", 33, 6, "In"], [49, 1, "Out", 33, 7, "In"], [50, 1, "Out", 32, 4, "In"], [50, 1, "Out", 32, 5, "In"], [50, 1, "Out", 32, 6, "In"], [50, 1, "Out", 32, 7, "In"]], "states": "000000000000000000000000000000011000001111111000000000000000000000000011111"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1089 | ||
1107 |