From 3b11b9d4f3eee5faa656d7ee61077e80726bdc36 Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Mon, 16 Jan 2023 14:55:48 +0100 Subject: Improve openings database code --- tools/openings.sh | 39 +++++++++++++++--------- tools/wxFrameBuilder.fbp | 78 +++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 96 insertions(+), 21 deletions(-) (limited to 'tools') diff --git a/tools/openings.sh b/tools/openings.sh index b0f1e04..40a0620 100755 --- a/tools/openings.sh +++ b/tools/openings.sh @@ -10,21 +10,32 @@ dst="${wai}/../src/binres/" # Fetch database git clone "$urldb" "$tmp" - -# Generate c_str from database cd $tmp -wxbin2c a.tsv a_tsv.hpp -wxbin2c b.tsv b_tsv.hpp -wxbin2c c.tsv c_tsv.hpp -wxbin2c d.tsv d_tsv.hpp -wxbin2c e.tsv e_tsv.hpp - -# Combine c_str files -cat a_tsv.hpp > openings.hpp -cat b_tsv.hpp >> openings.hpp -cat c_tsv.hpp >> openings.hpp -cat d_tsv.hpp >> openings.hpp -cat e_tsv.hpp >> openings.hpp + +# a.tsv +echo -n "static const char a_tsv[] =" > openings.hpp +sed -i '1d' a.tsv # remove header +cat a.tsv | sed -e "s/^/\"/g" -e "s/$/\\\n\"/g" -e '$ s/\\n"/";/g' >> openings.hpp; + +# b.tsv +echo -n "static const char b_tsv[] =" >> openings.hpp +sed -i '1d' b.tsv +cat b.tsv | sed -e "s/^/\"/g" -e "s/$/\\\n\"/g" -e '$ s/\\n"/";/g' >> openings.hpp; + +# c.tsv +echo -n "static const char c_tsv[] =" >> openings.hpp +sed -i '1d' c.tsv +cat c.tsv | sed -e "s/^/\"/g" -e "s/$/\\\n\"/g" -e '$ s/\\n"/";/g' >> openings.hpp; + +# d.tsv +echo -n "static const char d_tsv[] =" >> openings.hpp +sed -i '1d' d.tsv +cat d.tsv | sed -e "s/^/\"/g" -e "s/$/\\\n\"/g" -e '$ s/\\n"/";/g' >> openings.hpp; + +# e.tsv +echo -n "static const char e_tsv[] =" >> openings.hpp +sed -i '1d' e.tsv +cat e.tsv | sed -e "s/^/\"/g" -e "s/$/\\\n\"/g" -e '$ s/\\n"/";/g' >> openings.hpp; # Save mv openings.hpp "$dst" diff --git a/tools/wxFrameBuilder.fbp b/tools/wxFrameBuilder.fbp index 5120414..a161f69 100644 --- a/tools/wxFrameBuilder.fbp +++ b/tools/wxFrameBuilder.fbp @@ -4097,7 +4097,7 @@ - + 0 wxAUI_MGR_DEFAULT @@ -4120,16 +4120,16 @@ wxTAB_TRAVERSAL - + main_sizer wxVERTICAL none - + 5 wxEXPAND | wxALL 1 - + 1 1 1 @@ -4182,11 +4182,11 @@ - + Editor 0 - + 1 1 1 @@ -4237,11 +4237,75 @@ wxTAB_TRAVERSAL - + editor_page_sizer wxVERTICAL protected + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + opening_label + 1 + + + protected + 1 + + Resizable + 1 + + wxTE_READONLY + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + 5 wxEXPAND -- cgit v1.2.3