From 67c59e9e417d663390eb10f3351cf90302d79cb2 Mon Sep 17 00:00:00 2001 From: stissing Date: Wed, 2 Mar 2016 11:33:19 +0100 Subject: [PATCH] pull request comments considered reacting to comments, most have been accepted, one actively rejected --- scripts/screen_tool/README.md | 36 +++++++++++++++++++ .../scripts => scripts/screen_tool}/screen.rb | 2 +- .../FrontendApplication.goto.cpp.template | 0 .../templates/Presenter.cpp.template | 0 .../templates/Presenter.hpp.template | 0 .../screen_tool}/templates/View.cpp.template | 0 .../screen_tool}/templates/View.hpp.template | 0 7 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 scripts/screen_tool/README.md rename {app/template/EmptyApplication/scripts => scripts/screen_tool}/screen.rb (98%) rename {app/template/EmptyApplication/scripts => scripts/screen_tool}/templates/FrontendApplication.goto.cpp.template (100%) rename {app/template/EmptyApplication/scripts => scripts/screen_tool}/templates/Presenter.cpp.template (100%) rename {app/template/EmptyApplication/scripts => scripts/screen_tool}/templates/Presenter.hpp.template (100%) rename {app/template/EmptyApplication/scripts => scripts/screen_tool}/templates/View.cpp.template (100%) rename {app/template/EmptyApplication/scripts => scripts/screen_tool}/templates/View.hpp.template (100%) diff --git a/scripts/screen_tool/README.md b/scripts/screen_tool/README.md new file mode 100644 index 0000000..933ac93 --- /dev/null +++ b/scripts/screen_tool/README.md @@ -0,0 +1,36 @@ +# screen.rb + +Script to generate a TouchGFX View and Presenter pair. +The script will generate new header and source files for these and +update the FrontendHeap and FrontendApplication accordingly. +Visual Studio project files will be updated to include the new files. + +# Usage + +Copy the screen_tool folder to your application root. +Run the tool from touchgfx-env by invoking the command + +``` +./screen_tool/screen.rb ScreenName +``` + +Replace ScreenName with the desired name of your screen. + +# Example + +``` +cd app/template/EmptyApplication +./screen_tool/screen.rb Temperature +``` + +This will result in the following files being added and changed + +* gui/include/gui/temperature_screen/TemperaturePresenter.hpp +* gui/include/gui/temperature_screen/TemperatureView.hpp +* gui/src/temperature_screen/TemperaturePresenter.cpp +* gui/src/temperature_screen/TemperatureView.cpp +* gui/include/gui/common/FrontendApplication.hpp +* gui/include/gui/common/FrontendHeap.hpp +* gui/src/common/FrontendApplication.cpp +* simulator/msvs/Application.vcxproj +* simulator/msvs/Application.vcxproj.filters diff --git a/app/template/EmptyApplication/scripts/screen.rb b/scripts/screen_tool/screen.rb similarity index 98% rename from app/template/EmptyApplication/scripts/screen.rb rename to scripts/screen_tool/screen.rb index f0136c5..9217a12 100644 --- a/app/template/EmptyApplication/scripts/screen.rb +++ b/scripts/screen_tool/screen.rb @@ -61,7 +61,7 @@ def change_file(file_name, output = true) name = ARGV.shift if name.match(/[^A-Za-z]/) - puts "screen name should contain A-Z, a-z characters"; exit + puts "screen name must consist of characters A-Z and a-z only"; exit end the_name = name.snake_case diff --git a/app/template/EmptyApplication/scripts/templates/FrontendApplication.goto.cpp.template b/scripts/screen_tool/templates/FrontendApplication.goto.cpp.template similarity index 100% rename from app/template/EmptyApplication/scripts/templates/FrontendApplication.goto.cpp.template rename to scripts/screen_tool/templates/FrontendApplication.goto.cpp.template diff --git a/app/template/EmptyApplication/scripts/templates/Presenter.cpp.template b/scripts/screen_tool/templates/Presenter.cpp.template similarity index 100% rename from app/template/EmptyApplication/scripts/templates/Presenter.cpp.template rename to scripts/screen_tool/templates/Presenter.cpp.template diff --git a/app/template/EmptyApplication/scripts/templates/Presenter.hpp.template b/scripts/screen_tool/templates/Presenter.hpp.template similarity index 100% rename from app/template/EmptyApplication/scripts/templates/Presenter.hpp.template rename to scripts/screen_tool/templates/Presenter.hpp.template diff --git a/app/template/EmptyApplication/scripts/templates/View.cpp.template b/scripts/screen_tool/templates/View.cpp.template similarity index 100% rename from app/template/EmptyApplication/scripts/templates/View.cpp.template rename to scripts/screen_tool/templates/View.cpp.template diff --git a/app/template/EmptyApplication/scripts/templates/View.hpp.template b/scripts/screen_tool/templates/View.hpp.template similarity index 100% rename from app/template/EmptyApplication/scripts/templates/View.hpp.template rename to scripts/screen_tool/templates/View.hpp.template