public PlankPanel(BoardInfo board) { InitializeComponent(); this.board = board; boardInfoBindingSource.DataSource = board; }
public EditBoardInfoForm(BoardInfo boardInfo) { InitializeComponent(); this.boardInfo = boardInfo; this.boardInfoBindingSource.DataSource = boardInfo; this.makerIdText.DataBindings["Text"].Parse += HexStringParse; this.plankIdText.DataBindings["Text"].Parse += HexStringParse; }
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); } }
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(); }
public PinMapping(string hostPin, BoardInfo targetPlank, string plankPin, PinTypes type) { this.hostPin = hostPin; this.targetPlank = targetPlank; this.plankPin = plankPin; this.type = type; }
public void EndEdit() { backup = null; }
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; }
public void BeginEdit() { if (backup == null) backup = (BoardInfo) this.MemberwiseClone(); }