Beispiel #1
0
        protected DialogMemoryEditor(Memory memory)
        {
            string typeName = this.GetType().Name;

            this.openFileFolder = new SettingsStringCache(Settings.User, typeName + ".OpenFile.Folder", Mainframe.DefaultProjectFolder());
            this.DataHeight     = new SettingsGridLengthCache(Settings.User, typeName + ".Data.Height", memory.Writable ? "0.25*" : "0.75*");
            this.NoteHeight     = new SettingsGridLengthCache(Settings.User, typeName + ".Note.Height", memory.Writable ? "0.75*" : "0.25*");

            this.Memory = memory;
            this.data   = memory.MemoryValue();

            this.DataContext = this;
            this.InitializeComponent();

            this.addressBitWidth.ItemsSource = MemoryDescriptor.AddressBitWidthRange;
            this.dataBitWidth.ItemsSource    = PinDescriptor.BitWidthRange;
            IEnumerable <EnumDescriptor <bool> > writeOnList = MemoryDescriptor.WriteOnList;

            this.writeOn.ItemsSource = writeOnList;
            EnumDescriptor <MemoryOnStart>[] onStartList = new EnumDescriptor <MemoryOnStart>[] {
                new EnumDescriptor <MemoryOnStart>(MemoryOnStart.Random, Properties.Resources.MemoryOnStartRandom),
                new EnumDescriptor <MemoryOnStart>(MemoryOnStart.Zeros, Properties.Resources.MemoryOnStartZeros),
                new EnumDescriptor <MemoryOnStart>(MemoryOnStart.Ones, Properties.Resources.MemoryOnStartOnes),
                new EnumDescriptor <MemoryOnStart>(MemoryOnStart.Data, Properties.Resources.MemoryOnStartData)
            };
            this.onStart.ItemsSource = onStartList;

            this.addressBitWidth.SelectedItem = this.currentAddressBitWidth = this.Memory.AddressBitWidth;
            this.dataBitWidth.SelectedItem    = this.currentDataBitWidth = this.Memory.DataBitWidth;
            this.writeOn.SelectedItem         = writeOnList.First(d => d.Value == this.Memory.WriteOn1);
            this.onStart.SelectedItem         = onStartList.First(d => d.Value == (this.Memory.Writable ? this.Memory.OnStart : MemoryOnStart.Data));
            this.checkBoxDualPort.IsChecked   = this.Memory.DualPort;
            this.note.Text = this.Memory.Note;

            this.FunctionMemory = new MemoryEditor(this.data, this.Memory.AddressBitWidth, this.DataBitWidth);

            this.initialized = true;
        }
Beispiel #2
0
 public LedMatrixDescriptor(CircuitProject circuitProject) : base(circuitProject.LedMatrixSet.Create(LedMatrixType.Individual, 4, 4))
 {
     this.Rows       = 4;
     this.Columns    = 4;
     this.MatrixType = LedMatrixDescriptor.LedMatrixTypeDescriptor(LedMatrixType.Individual);
 }
Beispiel #3
0
 public SoundDescriptor(CircuitProject circuitProject) : base(circuitProject.SoundSet.Create(LogicCircuit.PinSide.Left, string.Empty))
 {
     this.pinSide  = PinDescriptor.PinSideDescriptor(this.Circuit.PinSide);
     this.Notation = string.Empty;
 }
Beispiel #4
0
 public ConstantDescriptor(CircuitProject circuitProject) : base(circuitProject.ConstantSet.Create(1, 0, LogicCircuit.PinSide.Right))
 {
     this.BitWidth = 1;
     this.Value    = "0";
     this.pinSide  = PinDescriptor.PinSideDescriptor(LogicCircuit.PinSide.Right);
 }
Beispiel #5
0
 public ButtonDescriptor(CircuitProject circuitProject) : base(circuitProject.CircuitButtonSet.Create(string.Empty, false, LogicCircuit.PinSide.Right))
 {
     this.Notation = string.Empty;
     this.pinSide  = PinDescriptor.PinSideDescriptor(LogicCircuit.PinSide.Right);
 }