Пример #1
0
        private void generate(string application, string device, string language)
        {
            this._window.updateStatus("Generating...");
            using (var db = new DatabaseCon())
            {
                var dbApp  = db.getFromDescription <application>(application);
                var dbLang = db.getFromDescription <language>(language);
                var errors = db.getFilteredErrors(application, device).ToList();

                this.showExportedErrors(db, errors);

                switch (dbLang.description)
                {
                case "C++":
                    this.copyTemplates(
                        dbLang.path_to_templates,
                        dbApp.path_to_output_file,
                        this.generateCPP(db, errors),
                        (uint)errors.Count(),
                        "Template.cpp",
                        "Template.h"
                        );
                    break;

                default:
                    throw new Exception($"Unsupported language: {language}");
                }
            }
        }