示例#1
0
        public SplitterDescriptor(CircuitProject circuitProject) : base(circuitProject.SplitterSet.Create(3, 3, true))
        {
            this.PinCountRange  = PinDescriptor.NumberRange(2, BasePin.MaxBitWidth);
            this.BitWidthRange  = PinDescriptor.NumberRange(1, BasePin.MaxBitWidth / 2);
            this.DirectionRange = new DirectionDescriptor[] {
                new DirectionDescriptor(true, Properties.Resources.SplitterDirectionClockwise, 1),
                new DirectionDescriptor(false, Properties.Resources.SplitterDirectionCounterclockwise, -1)
            };

            this.PinCount     = 3;
            this.BitWidth     = 1;
            this.Direction    = this.DirectionRange.First();
            this.Circuit.Note = Properties.Resources.ToolTipDescriptorSplitter;
        }
        public DialogLedMatrix(LedMatrix ledMatrix)
        {
            this.LedMatrix  = ledMatrix;
            this.MatrixType = LedMatrixDescriptor.LedMatrixTypeDescriptor(this.LedMatrix.MatrixType);
            this.CellShape  = (int)this.LedMatrix.CellShape;
            this.Rows       = this.LedMatrix.Rows;
            this.Columns    = this.LedMatrix.Columns;
            this.ColorRange = PinDescriptor.NumberRange(LedMatrix.MinBitsPerLed, LedMatrix.MaxBitsPerLed);
            this.Colors     = ledMatrix.Colors;
            this.Note       = this.LedMatrix.Note;

            this.DataContext = this;
            this.InitializeComponent();
        }
 public DialogOptions(Mainframe mainframe)
 {
     this.mainframe            = mainframe;
     this.RecentFileRange      = PinDescriptor.NumberRange(1, 24);
     this.CurrentCulture       = App.CurrentCulture;
     this.AutoSaveIntervalList = PinDescriptor.NumberRange(1, 15);
     this.AutoSaveInterval     = Math.Max(1, Math.Min((this.mainframe.AutoSaveInterval != 0) ? this.mainframe.AutoSaveInterval / 60 : 5, 15));
     this.DataContext          = this;
     this.InitializeComponent();
     this.loadLastFile.IsChecked      = Settings.User.LoadLastFileOnStartup;
     this.autoSave.IsChecked          = this.mainframe.AutoSaveInterval != 0;
     this.showGrid.IsChecked          = this.mainframe.ShowGrid;
     this.gateShape.SelectedItem      = this.GateShapeList.First(d => d.Value == Settings.User.GateShape);
     this.maxRecentFiles.SelectedItem = Settings.User.MaxRecentFileCount;
 }
示例#4
0
 public static int[] AddressBitRange()
 {
     return(PinDescriptor.NumberRange(1, Memory.MaxAddressBitWidth));
 }
示例#5
0
 public static int[] NumberRange(int minBitWidth)
 {
     return(PinDescriptor.NumberRange(minBitWidth, BasePin.MaxBitWidth));
 }