상속: INotifyPropertyChanged, IEditableObject
예제 #1
0
        public PlankPanel(BoardInfo board)
        {
            InitializeComponent();

            this.board = board;
            boardInfoBindingSource.DataSource = board;
        }
예제 #2
0
 public EditBoardInfoForm(BoardInfo boardInfo)
 {
     InitializeComponent();
     this.boardInfo = boardInfo;
     this.boardInfoBindingSource.DataSource = boardInfo;
     this.makerIdText.DataBindings["Text"].Parse += HexStringParse;
     this.plankIdText.DataBindings["Text"].Parse += HexStringParse;
 }
예제 #3
0
 private void mainTreeView_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
 {
     editNode = e.Node.Tag as BoardInfo;
     if (e.Button == System.Windows.Forms.MouseButtons.Right)
     {
         boardContextMenu.Show(mainTreeView, e.Location);
     }
 }
예제 #4
0
        public BoardInfo[] GetPlankInfo()
        {
            List<BoardInfo> boards = new List<BoardInfo>();
            foreach(byte slaveAddr in PLANK_EEPROM_ADDRS) {
                try
                {
                    boards.Add(new BoardInfo(this.OpenEEPROM(slaveAddr, 65536), slaveAddr));
                }
                catch (I2CTransferError ex)
                {
                    if (((I2CStatusCode)ex.Status) == I2CStatusCode.I2C_MSTR_ERR_LB_NAK)
                    {
                        break;
                    }
                    else
                    {
                        throw;
                    }
                }
                catch (BoardInfoFormatException)
                {
                    // Board is present, but doesn't have a valid eeprom
                    BoardInfo plank = new BoardInfo(slaveAddr);
                    plank.PlankName = "Unknown Plank";
                    plank.Version = "";
                    boards.Add(plank);
                }
            }

            return boards.ToArray();
        }
예제 #5
0
 public PinMapping(string hostPin, BoardInfo targetPlank, string plankPin, PinTypes type)
 {
     this.hostPin = hostPin;
     this.targetPlank = targetPlank;
     this.plankPin = plankPin;
     this.type = type;
 }
예제 #6
0
 public void EndEdit()
 {
     backup = null;
 }
예제 #7
0
 public void CancelEdit()
 {
     this.Flags = backup.Flags;
     this.GPIONames = backup.GPIONames;
     this.PlankName = backup.PlankName;
     this.Version = backup.Version;
     this.MakerId = backup.MakerId;
     this.PlankId = backup.PlankId;
     backup = null;
 }
예제 #8
0
 public void BeginEdit()
 {
     if (backup == null)
         backup = (BoardInfo) this.MemberwiseClone();
 }