Inheritance: INotifyPropertyChanged, IEditableObject
コード例 #1
0
ファイル: PlankPanel.cs プロジェクト: arachnidlabs/loki
        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
ファイル: MainForm.cs プロジェクト: arachnidlabs/loki
 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
ファイル: BoardInfo.cs プロジェクト: arachnidlabs/loki
 public PinMapping(string hostPin, BoardInfo targetPlank, string plankPin, PinTypes type)
 {
     this.hostPin = hostPin;
     this.targetPlank = targetPlank;
     this.plankPin = plankPin;
     this.type = type;
 }
コード例 #6
0
ファイル: BoardInfo.cs プロジェクト: arachnidlabs/loki
 public void EndEdit()
 {
     backup = null;
 }
コード例 #7
0
ファイル: BoardInfo.cs プロジェクト: arachnidlabs/loki
 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
ファイル: BoardInfo.cs プロジェクト: arachnidlabs/loki
 public void BeginEdit()
 {
     if (backup == null)
         backup = (BoardInfo) this.MemberwiseClone();
 }