Ejemplo n.º 1
0
        private void generateAndUploadToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (Panels.Count(pnl => !pnl.GetModel().IsMenu) > 0)
            {
                if (JoyInfo == null)
                {
                    ShowError("Joystick infromation is absent!", "Check error");
                    return;
                }

                toolStripCompileLabel.Text = "Generating ...";

                if (!ExecuteStep(() => JoyInfo.Check()))
                {
                    return;
                }

                if (string.IsNullOrEmpty(Settings.OutputPath))
                {
                    ShowError("Output path is not set");
                    return;
                }

                var gen = new CodeGenerator(__Settings, __JoyInfo, Panels.ToArray(), ExecuteStep);

                if (!gen.GenerateProject())
                {
                    return;
                }


                toolStripCompileLabel.Text = "Generation successed";
                SetChangedState();

                var fUpload = new FlashBoardDialog();
                fUpload.ProgramCode = gen.ByteCode;

                fUpload.ShowDialog(this);
            }
            else
            {
                var fUpload = new FlashBoardDialog();
                fUpload.ProgramCode = null;
                fUpload.ShowDialog(this);
            }
        }
Ejemplo n.º 2
0
        private void uploadFirmwareToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var fUpload = new FlashBoardDialog();

            fUpload.ShowDialog(this);
        }