Пример #1
0
        private void generateProjectToolStripMenuItem_Click(object sender, EventArgs e)
        {
            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())
            {
                toolStripCompileLabel.Text = "Generation successed";
                SetChangedState();
            }
        }
Пример #2
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);
            }
        }