public ActionsForm(BoardInterface board, String title, List <BoardAction> actions)
        {
            if (board == null)
            {
                throw new ArgumentNullException("board");
            }

            InitializeComponent();

            Board        = board;
            Text         = title;
            BoardActions = new BindingList <BoardAction>();

            if (actions != null)
            {
                foreach (BoardAction a in actions)
                {
                    BoardActions.Add(a);
                }
            }

            ActionsGridView.DataSource = BoardActions;

            DialogResult = DialogResult.OK;
        }
示例#2
0
        public virtual void SetBoardInterface(BoardInterface board)
        {
            _board = board;

            foreach (BaseComponent c in _components)
            {
                c.SetBoardInterface(_board);
            }
        }
示例#3
0
        private void BaseControllerForm_Load(Object sender, EventArgs e)
        {
            if (this.DesignMode)
            {
                return;
            }

            Logger.Init();

            _notifyIcon = CreateNotifyIcon();

            _board            = new BoardInterface(this);
            _board.Connected += Board_Connected;
            _board.InitializationComplete += Board_InitializationComplete;
            _board.Disconnected           += Board_Disconnected;
            _board.Log += Board_Log;

            _controller.SetBoardInterface(_board);

            LoadSettings();

            _board.Start();
        }
示例#4
0
        public ActionDialog(BoardInterface board, String title, BoardAction currentAction)
        {
            InitializeComponent();

            Text   = title;
            Board  = board;
            Action = currentAction;

            DialogResult = DialogResult.Cancel;

            NoAction.Tag        = NoActionLabel;
            SetLedAction.Tag    = SetLedActionOptions;
            SetPinAction.Tag    = SetPinActionOptions;
            TogglePinAction.Tag = TogglePinActionOptions;
            RunScriptAction.Tag = RunScriptActionOptions;
            SendTextAction.Tag  = SendTextActionOptions;

            NoActionLabel.Enabled          = false;
            SetLedActionOptions.Enabled    = false;
            SetPinActionOptions.Enabled    = false;
            TogglePinActionOptions.Enabled = false;
            RunScriptActionOptions.Enabled = false;
            SendTextActionOptions.Enabled  = false;

            if (Board != null)
            {
                Object[] pins = Board.OutputPins.Cast <Object>().ToArray();
                SetPinActionPinOption.Items.AddRange(pins);
                TogglePinActionPinOption.Items.AddRange(pins);
            }
            else
            {
                TestAction.Hide();
            }

            UpdateUiForAction(Action);
        }
 public ActionsForm(BoardInterface board) : this(board, "Actions")
 {
 }
 public ActionsForm(BoardInterface board, String title) : this(board, title, null)
 {
 }
示例#7
0
 public ActionDialog(BoardInterface board) : this(board, "Create Action")
 {
 }
示例#8
0
 public ActionDialog(BoardInterface board, String title) : this(board, title, null)
 {
 }