├── Sources ├── LogicCircuit.UnitTest │ ├── Usings.cs │ ├── HDL │ │ ├── HdlItem.cs │ │ ├── HdlLexer.g4 │ │ ├── HdlJam.cs │ │ ├── HdlParser.g4 │ │ ├── HdlErrorListener.cs │ │ └── HdlIOPin.cs │ ├── DataPersistent │ │ ├── IntField.cs │ │ └── RowIdTest.cs │ ├── AssemblyInfo.cs │ ├── VisualElementLoadTest.cs │ ├── Properties │ │ └── From2.0.0.6Conversion.CircuitProject │ ├── SettingsTest.cs │ └── TestHelper.cs ├── Setup │ ├── Banner.bmp │ ├── Dialog.bmp │ └── Setup.wixproj ├── LogicCircuit │ ├── Properties │ │ ├── default.wav │ │ ├── LogicCircuit.ico │ │ ├── LogicCircuit.png │ │ └── AssemblyInfo.cs │ ├── GateShape.cs │ ├── Function │ │ ├── IFunctionClock.cs │ │ ├── State.cs │ │ ├── IFunctionMemory.cs │ │ ├── IFunctionVisual.cs │ │ ├── FunctionNot.cs │ │ ├── FunctionRom.cs │ │ ├── FunctionClock.cs │ │ ├── FunctionTriStateGroup.cs │ │ ├── FunctionTriState.cs │ │ ├── FunctionRam.cs │ │ ├── OneBitConst.cs │ │ ├── FunctionXor.cs │ │ ├── FunctionXorNot.cs │ │ ├── FunctionLedMatrixIndividual.cs │ │ └── Probe.cs │ ├── DataPersistent │ │ ├── SnapTableAction.cs │ │ ├── RolledBackEventArgs.cs │ │ ├── ITableSnapshot.cs │ │ ├── VersionChangeEventArgs.cs │ │ ├── ITableChange.cs │ │ ├── ISnapTable.cs │ │ ├── ISnapTableChange.cs │ │ ├── RowIdPseudoField.cs │ │ ├── SnapStoreException.cs │ │ ├── IntArray.cs │ │ ├── RowIdField.cs │ │ └── RowId.cs │ ├── CircuitProject │ │ ├── LedMatrixType.cs │ │ ├── LedMatrixCellShape.cs │ │ ├── PinType.cs │ │ ├── PinSide.cs │ │ ├── MemoryOnStart.cs │ │ ├── SensorType.cs │ │ ├── Rotation.cs │ │ ├── JamComparer.cs │ │ ├── GateType.cs │ │ ├── NamedItemSet.cs │ │ ├── CircuitSymbolComparer.cs │ │ ├── SensorPoint.cs │ │ ├── PinComparer.cs │ │ └── CollapsedCategory.cs │ ├── CircuitShape.cs │ ├── ColorPicker │ │ ├── ColorPickerMode.cs │ │ ├── HueToColorConverter.cs │ │ └── ColorSlider.cs │ ├── SymbolShapes │ │ ├── MarkerLine.xaml │ │ ├── DisplayBorder.xaml │ │ ├── DisplayBackground.xaml │ │ ├── Led.xaml │ │ ├── LedMatrixRectCell.xaml │ │ ├── MarkerRectangle.xaml │ │ ├── Button.xaml │ │ ├── LedMatrix.xaml │ │ ├── ShapedNot.xaml │ │ ├── LedMatrixRoundCell.xaml │ │ ├── ShapedTriState2.xaml │ │ ├── CircuitFlipFlop.xaml │ │ ├── ShapedTriState1.xaml │ │ ├── Clock.xaml │ │ ├── GraphicsArray.xaml │ │ ├── Rectangular.xaml │ │ ├── TextNote.xaml │ │ ├── Pin.xaml │ │ ├── Probe.xaml │ │ ├── Constant.xaml │ │ ├── CircuitMux.xaml │ │ ├── CircuitDemux.xaml │ │ ├── ToggleLed.xaml │ │ ├── Splitter.xaml │ │ ├── CircuitAlu.xaml │ │ ├── Sound.xaml │ │ ├── SensorAuto.xaml │ │ ├── SensorManual.xaml │ │ ├── ShapedAnd.xaml │ │ ├── ShapedOr.xaml │ │ └── SevenSegment.xaml │ ├── Schema │ │ ├── Empty.xml │ │ ├── ConvertFrom.2.0.0.11.xslt │ │ ├── ConvertFrom.2.0.0.12.xslt │ │ ├── ConvertFrom.2.0.0.13.xslt │ │ ├── ConvertFrom.1.0.0.2.xslt │ │ ├── ConvertFrom.2.0.0.1.xslt │ │ ├── ConvertFrom.2.0.0.2.xslt │ │ ├── ConvertFrom.2.0.0.4.xslt │ │ ├── ConvertFrom.2.0.0.7.xslt │ │ ├── ConvertFrom.2.0.0.8.xslt │ │ ├── ConvertFrom.2.0.0.9.xslt │ │ ├── ConvertFrom.2.0.0.6.xslt │ │ ├── ConvertFrom.2.0.0.10.xslt │ │ ├── ConvertFrom.2.0.0.3.xslt │ │ ├── ConvertSettings.xslt │ │ └── ConvertFrom.2.0.0.5.xslt │ ├── Dialog │ │ ├── DialogRAM.cs │ │ ├── DialogROM.cs │ │ ├── ControlKeyGesture.xaml │ │ ├── DialogReport.xaml │ │ ├── ControlFolderSelector.xaml │ │ ├── IronPythonConsole.xaml │ │ ├── DialogMemory.xaml.cs │ │ ├── DialogReport.xaml.cs │ │ ├── DialogProbeHistory.xaml │ │ ├── ControlPinOrder.xaml │ │ ├── DialogProject.xaml │ │ ├── DialogSound.xaml │ │ ├── DialogProbe.xaml │ │ ├── ControlFolderSelector.xaml.cs │ │ ├── DialogMemory.xaml │ │ ├── DialogFind.xaml │ │ ├── DialogHyperlink.xaml │ │ ├── DialogUsage.xaml.cs │ │ └── DialogProbe.xaml.cs │ ├── ColorMethods.cs │ ├── Icon │ │ ├── Warning.xaml │ │ ├── Error.xaml │ │ ├── Info.xaml │ │ ├── CircuitPower.xaml │ │ ├── Question.xaml │ │ ├── EditJustify.xaml │ │ ├── EditTextCenter.xaml │ │ ├── ColorFont.xaml │ │ ├── EditRightJustify.xaml │ │ ├── Delete.xaml │ │ ├── FileSave.xaml │ │ ├── FileClose.xaml │ │ ├── EditBulletList.xaml │ │ ├── CircuitPulse.xaml │ │ ├── EditLeftJustify.xaml │ │ ├── EditTextIndent.xaml │ │ ├── EditIncreaseFontSize.xaml │ │ ├── EditDecreaseFontSize.xaml │ │ ├── EditCopy.xaml │ │ ├── EditRotateRight.xaml │ │ ├── F1Help.xaml │ │ ├── CircuitTable.xaml │ │ ├── EditTextOutdent.xaml │ │ ├── EditPaste.xaml │ │ ├── EditRotateLeft.xaml │ │ ├── FileOpen.xaml │ │ ├── Image.xaml │ │ ├── CircuitProperty.xaml │ │ ├── AlignLeft.xaml │ │ ├── FileNew.xaml │ │ ├── AlignTop.xaml │ │ ├── AlignBottom.xaml │ │ ├── AlignRight.xaml │ │ ├── EditRedo.xaml │ │ ├── AlignCenter.xaml │ │ ├── EditUndo.xaml │ │ ├── AlignMiddle.xaml │ │ ├── CircuitProjectProperty.xaml │ │ ├── Hyperlink.xaml │ │ └── FileSaveAs.xaml │ ├── VectorImageLoaderConverter.cs │ ├── InverseBooleanConverter.cs │ ├── Editor │ │ ├── CircuitDescriptorComparer.cs │ │ ├── WireDisplayControl.xaml │ │ ├── Marker.cs │ │ └── AreaMarker.cs │ ├── RemoveAcceleratorConverter.cs │ ├── EnumDescriptor.cs │ ├── AutoWidthComboBox.cs │ ├── DoubleAdderConverter.cs │ ├── EnumToVisibilityConvertor.cs │ ├── Settings │ │ ├── SettingsEnumCache.cs │ │ ├── SettingsBoolCache.cs │ │ ├── SettingsDateTimeCache.cs │ │ ├── SettingsIntegerCache.cs │ │ ├── SettingsGridLengthCache.cs │ │ ├── SettingsStringCache.cs │ │ └── SettingsDoubleCache.cs │ ├── EnumHelper.cs │ ├── HDL │ │ └── HdlTransformation.cs │ ├── TruthTableFilterParser.g4 │ ├── TruthTableFilterLexer.g4 │ ├── OneToMany.cs │ ├── GridPoint.cs │ ├── HyperlinkNavigationCommand.cs │ ├── ButtonControl.cs │ ├── Conductor.cs │ ├── DisplayCanvas.cs │ └── CommandMenuItem.cs ├── Tools │ ├── ItemWrapper.Generator │ │ ├── ItemModifier.cs │ │ ├── RealmType.cs │ │ ├── AccessModifier.cs │ │ ├── AssemblyInfo.cs │ │ ├── Store.cs │ │ ├── Error.cs │ │ ├── GeneratorItem.tt │ │ ├── GeneratorStore.tt │ │ └── ToStringHelper.cs │ ├── Directory.Build.props │ ├── ExportResx │ │ ├── Value.cs │ │ └── ExportResx.csproj │ └── FindUnusedResources │ │ └── FindUnusedResources.csproj ├── .editorconfig ├── License.txt ├── ReleaseCheckList.txt ├── Directory.Build.props ├── LogicCircuit.slnx ├── ToDoList.txt └── BuildSetup.cmd └── README.md /Sources/LogicCircuit.UnitTest/Usings.cs: -------------------------------------------------------------------------------- 1 | global using Microsoft.VisualStudio.TestTools.UnitTesting; -------------------------------------------------------------------------------- /Sources/Setup/Banner.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenelepekhin/LogicCircuit/HEAD/Sources/Setup/Banner.bmp -------------------------------------------------------------------------------- /Sources/Setup/Dialog.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenelepekhin/LogicCircuit/HEAD/Sources/Setup/Dialog.bmp -------------------------------------------------------------------------------- /Sources/LogicCircuit/Properties/default.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenelepekhin/LogicCircuit/HEAD/Sources/LogicCircuit/Properties/default.wav -------------------------------------------------------------------------------- /Sources/LogicCircuit/Properties/LogicCircuit.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenelepekhin/LogicCircuit/HEAD/Sources/LogicCircuit/Properties/LogicCircuit.ico -------------------------------------------------------------------------------- /Sources/LogicCircuit/Properties/LogicCircuit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenelepekhin/LogicCircuit/HEAD/Sources/LogicCircuit/Properties/LogicCircuit.png -------------------------------------------------------------------------------- /Sources/LogicCircuit/GateShape.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace LogicCircuit { 4 | public enum GateShape { 5 | Rectangular, 6 | Shaped 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Sources/Tools/ItemWrapper.Generator/ItemModifier.cs: -------------------------------------------------------------------------------- 1 | namespace ItemWrapper.Generator { 2 | public enum ItemModifier { 3 | None, 4 | Abstract 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Sources/LogicCircuit/Function/IFunctionClock.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace LogicCircuit { 4 | public interface IFunctionClock { 5 | bool Flip(); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Sources/LogicCircuit/DataPersistent/SnapTableAction.cs: -------------------------------------------------------------------------------- 1 | namespace DataPersistent { 2 | public enum SnapTableAction { 3 | Insert, 4 | Delete, 5 | Update 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Sources/Tools/ItemWrapper.Generator/RealmType.cs: -------------------------------------------------------------------------------- 1 | namespace ItemWrapper.Generator { 2 | public enum RealmType { 3 | None, 4 | Universe, 5 | Multiverse, 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Sources/LogicCircuit/CircuitProject/LedMatrixType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace LogicCircuit { 4 | public enum LedMatrixType { 5 | Individual, 6 | Selector 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Sources/LogicCircuit/CircuitProject/LedMatrixCellShape.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace LogicCircuit { 4 | public enum LedMatrixCellShape { 5 | Round, 6 | Rectangle 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Sources/LogicCircuit/CircuitProject/PinType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace LogicCircuit { 4 | public enum PinType { 5 | None, 6 | Input, 7 | Output 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Sources/LogicCircuit/CircuitProject/PinSide.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace LogicCircuit { 4 | public enum PinSide { 5 | Left, 6 | Top, 7 | Right, 8 | Bottom 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Sources/LogicCircuit/CircuitShape.cs: -------------------------------------------------------------------------------- 1 | namespace LogicCircuit { 2 | public enum CircuitShape { 3 | Rectangular, 4 | Display, 5 | Mux, 6 | Demux, 7 | Alu, 8 | FlipFlop, 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Sources/Tools/ItemWrapper.Generator/AccessModifier.cs: -------------------------------------------------------------------------------- 1 | namespace ItemWrapper.Generator { 2 | public enum AccessModifier { 3 | Public, 4 | Internal, 5 | Protected, 6 | Private, 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Sources/LogicCircuit/ColorPicker/ColorPickerMode.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace LogicCircuit { 4 | public enum ColorPickerMode { 5 | Color, 6 | Foreground, 7 | Background 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Sources/LogicCircuit/CircuitProject/MemoryOnStart.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace LogicCircuit { 4 | public enum MemoryOnStart { 5 | Random, 6 | Zeros, 7 | Ones, 8 | Data 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Sources/LogicCircuit/CircuitProject/SensorType.cs: -------------------------------------------------------------------------------- 1 | namespace LogicCircuit { 2 | public enum SensorType { 3 | Series, 4 | Loop, 5 | Random, 6 | Manual, 7 | KeyCode, 8 | ASCII, 9 | Sequence, 10 | Clock, 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Sources/LogicCircuit/Function/State.cs: -------------------------------------------------------------------------------- 1 | namespace LogicCircuit { 2 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")] 3 | public enum State : byte { 4 | Off, 5 | On0, 6 | On1 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Sources/LogicCircuit/SymbolShapes/MarkerLine.xaml: -------------------------------------------------------------------------------- 1 | 7 | -------------------------------------------------------------------------------- /Sources/LogicCircuit/SymbolShapes/DisplayBorder.xaml: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /Sources/LogicCircuit/Function/IFunctionMemory.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace LogicCircuit { 4 | public interface IFunctionMemory { 5 | int AddressBitWidth { get; } 6 | int DataBitWidth { get; } 7 | int this[int index] { get; set; } 8 | 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Sources/LogicCircuit/SymbolShapes/DisplayBackground.xaml: -------------------------------------------------------------------------------- 1 | 7 | -------------------------------------------------------------------------------- /Sources/LogicCircuit/SymbolShapes/Led.xaml: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /Sources/LogicCircuit/SymbolShapes/LedMatrixRectCell.xaml: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /Sources/LogicCircuit/CircuitProject/Rotation.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace LogicCircuit { 4 | public enum Rotation { 5 | Up, 6 | Right, 7 | Down, 8 | Left 9 | } 10 | 11 | public interface IRotatable { 12 | Rotation Rotation { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Sources/Tools/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $(ToolsFolder) 6 | false 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # LogicCircuit 2 | **LogicCircuit** – is free, open source educational software for designing and simulating digital logic circuits. 3 | ![LogicCircuit](https://logiccircuit.org/images/screenshot.png) 4 | 5 | ### How do I build it ### 6 | 7 | * Use Visual Studio. 8 | * Install Wix Toolset extension 9 | -------------------------------------------------------------------------------- /Sources/LogicCircuit.UnitTest/HDL/HdlItem.cs: -------------------------------------------------------------------------------- 1 | // Ignore Spelling: Hdl 2 | 3 | namespace LogicCircuit.UnitTest.HDL { 4 | internal class HdlItem { 5 | public HdlContext HdlContext { get; } 6 | 7 | protected HdlItem(HdlContext hdlContext) { 8 | this.HdlContext = hdlContext; 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Sources/LogicCircuit/SymbolShapes/MarkerRectangle.xaml: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /Sources/LogicCircuit/Schema/Empty.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Sources/LogicCircuit/Dialog/DialogRAM.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace LogicCircuit { 4 | public class DialogRam : DialogMemoryEditor { 5 | public DialogRam(Memory memory) : base(memory) { 6 | Tracer.Assert(memory.Writable); 7 | this.Title = Properties.Resources.RAMNotation; 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Sources/LogicCircuit/SymbolShapes/Button.xaml: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /Sources/LogicCircuit/SymbolShapes/LedMatrix.xaml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Sources/LogicCircuit/SymbolShapes/ShapedNot.xaml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Sources/LogicCircuit/Dialog/DialogROM.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace LogicCircuit { 4 | public class DialogRom : DialogMemoryEditor { 5 | public DialogRom(Memory memory) : base(memory) { 6 | Tracer.Assert(!memory.Writable); 7 | this.Title = Properties.Resources.ROMNotation; 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Sources/LogicCircuit/DataPersistent/RolledBackEventArgs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DataPersistent { 4 | public class RolledBackEventArgs : EventArgs { 5 | 6 | public int Version { get; private set; } 7 | 8 | public RolledBackEventArgs(int version) { 9 | this.Version = version; 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Sources/LogicCircuit/SymbolShapes/LedMatrixRoundCell.xaml: -------------------------------------------------------------------------------- 1 | 10 | -------------------------------------------------------------------------------- /Sources/Tools/ExportResx/Value.cs: -------------------------------------------------------------------------------- 1 | namespace ExportResx { 2 | internal sealed class Value { 3 | public string Name { get; } 4 | public string Text { get; } 5 | public string Note { get; } 6 | 7 | public Value(string name, string text, string note) { 8 | this.Name = name; 9 | this.Text = text; 10 | this.Note = note; 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Sources/LogicCircuit/DataPersistent/ITableSnapshot.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace DataPersistent { 4 | public interface ITableSnapshot : IEnumerable { 5 | StoreSnapshot StoreSnapshot { get; } 6 | string Name { get; } 7 | IEnumerable Rows { get; } 8 | bool WasChanged(int fromVersion, int toVersion); 9 | bool WasAffected(int version); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Sources/LogicCircuit/Dialog/ControlKeyGesture.xaml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Sources/LogicCircuit/DataPersistent/VersionChangeEventArgs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DataPersistent { 4 | public class VersionChangeEventArgs : EventArgs { 5 | public int OldVersion { get; } 6 | public int NewVersion { get; } 7 | 8 | public VersionChangeEventArgs(int oldVersion, int newVersion) { 9 | this.OldVersion = oldVersion; 10 | this.NewVersion = newVersion; 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Sources/LogicCircuit/Function/IFunctionVisual.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics.CodeAnalysis; 3 | 4 | namespace LogicCircuit { 5 | public interface IFunctionVisual { 6 | void TurnOn(); 7 | [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "TurnOff")] 8 | void TurnOff(); 9 | void Redraw(bool force); 10 | bool Invalid { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Sources/LogicCircuit/SymbolShapes/ShapedTriState2.xaml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Sources/LogicCircuit/SymbolShapes/CircuitFlipFlop.xaml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /Sources/LogicCircuit/SymbolShapes/ShapedTriState1.xaml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Sources/LogicCircuit/SymbolShapes/Clock.xaml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /Sources/LogicCircuit/ColorMethods.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Media; 3 | 4 | namespace LogicCircuit { 5 | public static class ColorMethods { 6 | public static int CompareTo(this Color color1, Color color2) { 7 | return color1.ToInt32() - color2.ToInt32(); 8 | } 9 | 10 | public static int ToInt32(this Color color) { 11 | return (color.A << 24) | (color.R << 16) | (color.G << 8) | color.B; 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Sources/LogicCircuit/DataPersistent/ITableChange.cs: -------------------------------------------------------------------------------- 1 | namespace DataPersistent { 2 | internal interface ITableChange where TRecord:struct { 3 | SnapTableAction Action(RowId rowId); 4 | void GetNewData(RowId rowId, out TRecord data); 5 | void GetOldData(RowId rowId, out TRecord data); 6 | TField GetNewField(RowId rowId, IField field); 7 | TField GetOldField(RowId rowId, IField field); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Sources/LogicCircuit/CircuitProject/JamComparer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | 5 | namespace LogicCircuit { 6 | internal sealed class JamComparer : IComparer { 7 | public static readonly IComparer Comparer = new JamComparer(); 8 | 9 | public int Compare(Jam? x, Jam? y) { 10 | Debug.Assert(x != null && y != null); 11 | return PinComparer.Comparer.Compare(x.Pin, y.Pin); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Sources/LogicCircuit/DataPersistent/ISnapTable.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace DataPersistent { 4 | internal interface ISnapTable { 5 | SnapStore SnapStore { get; } 6 | string Name { get; } 7 | void Rollback(); 8 | void Revert(int version); 9 | ITableSnapshot CreateTableSnapshot(StoreSnapshot storeSnapshot); 10 | List Children { get; } 11 | bool IsUserTable { get; } 12 | bool WasChangedIn(int version); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Sources/LogicCircuit/SymbolShapes/GraphicsArray.xaml: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Sources/LogicCircuit/SymbolShapes/Rectangular.xaml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /Sources/Tools/ItemWrapper.Generator/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Resources; 2 | using System.Runtime.InteropServices; 3 | 4 | [assembly: NeutralResourcesLanguageAttribute("en-US")] 5 | 6 | // Setting ComVisible to false makes the types in this assembly not visible 7 | // to COM components. If you need to access a type in this assembly from 8 | // COM, set the ComVisible attribute to true on that type. 9 | [assembly: ComVisible(false)] 10 | [assembly: CLSCompliant(false)] 11 | -------------------------------------------------------------------------------- /Sources/LogicCircuit/DataPersistent/ISnapTableChange.cs: -------------------------------------------------------------------------------- 1 | namespace DataPersistent { 2 | internal interface ISnapTableChange where TRecord:struct { 3 | RowId RowId(int changeIndex); 4 | SnapTableAction Action(int changeIndex); 5 | void GetNewData(int changeIndex, out TRecord data); 6 | void GetOldData(int changeIndex, out TRecord data); 7 | TField GetNewField(int changeIndex, IField field); 8 | TField GetOldField(int changeIndex, IField field); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Sources/LogicCircuit/SymbolShapes/TextNote.xaml: -------------------------------------------------------------------------------- 1 | 15 | -------------------------------------------------------------------------------- /Sources/LogicCircuit/CircuitProject/GateType.cs: -------------------------------------------------------------------------------- 1 | namespace LogicCircuit { 2 | public enum GateType { 3 | // Future extensions should add new types, not insert in the middle, unless old file conversion defined. 4 | Nop, 5 | Clock, 6 | Not, 7 | Or, 8 | And, 9 | Xor, 10 | Odd, // This one should not be used anymore 11 | Even, // This one should not be used anymore 12 | Led, 13 | Probe, // This one should not be used anymore 14 | TriState1, // This with controlling pin at the bottom 15 | TriState2 // This with controlling pin at the top 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Sources/.editorconfig: -------------------------------------------------------------------------------- 1 | [*.cs] 2 | 3 | # CA1062: Validate arguments of public methods 4 | dotnet_diagnostic.CA1062.severity = none 5 | 6 | # CA1031: Do not catch general exception types 7 | dotnet_diagnostic.CA1031.severity = none 8 | 9 | # CA5394: Do not use insecure randomness 10 | dotnet_diagnostic.CA5394.severity = none 11 | 12 | # CA1515: Because an application's API isn't typically referenced from outside the assembly, types can be made internal 13 | dotnet_diagnostic.CA1515.severity = none 14 | 15 | # CA1056: URI properties should not be strings 16 | dotnet_diagnostic.CA1056.severity = none 17 | -------------------------------------------------------------------------------- /Sources/LogicCircuit/Function/FunctionNot.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace LogicCircuit { 4 | public class FunctionNot : CircuitFunction { 5 | private readonly int param0; 6 | 7 | public FunctionNot(CircuitState circuitState, int parameter, int result) : base(circuitState, parameter, result) { 8 | this.param0 = parameter; 9 | } 10 | public override bool Evaluate() { 11 | return this.SetResult0(CircuitFunction.Not(this.CircuitState[this.param0])); 12 | } 13 | 14 | public override string ReportName { get { return Properties.Resources.GateNotName; } } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Sources/LogicCircuit/Icon/Warning.xaml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /Sources/LogicCircuit/SymbolShapes/Pin.xaml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /Sources/LogicCircuit/SymbolShapes/Probe.xaml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /Sources/License.txt: -------------------------------------------------------------------------------- 1 | Copyright 2025 LogicCircuit.org 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /Sources/LogicCircuit/SymbolShapes/Constant.xaml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /Sources/LogicCircuit/VectorImageLoaderConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using System.Windows.Data; 4 | 5 | namespace LogicCircuit { 6 | public class VectorImageLoaderConverter : IValueConverter { 7 | public object? Convert(object value, Type targetType, object parameter, CultureInfo culture) { 8 | if(parameter is string path) { 9 | return Symbol.Skin(path); 10 | } 11 | return null; 12 | } 13 | 14 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { 15 | throw new InvalidOperationException(); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Sources/Tools/ExportResx/ExportResx.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net7.0-windows 6 | enable 7 | enable 8 | true 9 | 10 | AllEnabledByDefault 11 | latest-all 12 | 13 | 1.0.0.0 14 | Utility Export Resx 15 | © LogicCircuit.org 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /Sources/LogicCircuit/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.CompilerServices; 2 | using System.Windows; 3 | 4 | [assembly: InternalsVisibleTo("LogicCircuit.UnitTest")] 5 | 6 | [assembly: ThemeInfo( 7 | // where theme specific resource dictionaries are located 8 | // (used if a resource is not found in the page, 9 | // or application resource dictionaries) 10 | ResourceDictionaryLocation.None, 11 | // where the generic resource dictionary is located 12 | // (used if a resource is not found in the page, 13 | // app, or any theme specific resource dictionaries) 14 | ResourceDictionaryLocation.SourceAssembly 15 | )] 16 | -------------------------------------------------------------------------------- /Sources/LogicCircuit/Dialog/DialogReport.xaml: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Sources/LogicCircuit/Function/FunctionRom.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace LogicCircuit { 4 | public class FunctionRom : FunctionMemory { 5 | public FunctionRom(CircuitState circuitState, int[] address, int[] result, int[]? address2, int[]? result2, Memory memory) : base( 6 | circuitState, address, null, result, address2, result2, 0, memory 7 | ) { 8 | } 9 | 10 | public override bool Evaluate() { 11 | return this.Read(); 12 | } 13 | 14 | public override string ReportName { get { return Properties.Resources.ReportMemoryName(Properties.Resources.ROMNotation, this.AddressBitWidth, this.DataBitWidth); } } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Sources/LogicCircuit/Icon/Error.xaml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /Sources/LogicCircuit/Icon/Info.xaml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /Sources/LogicCircuit/Dialog/ControlFolderSelector.xaml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 |