diff --git a/README.md b/README.md index 01d1444..fa82cab 100644 --- a/README.md +++ b/README.md @@ -7,13 +7,13 @@ gnuplot 5.4 patchlevel 6 OpenSiv3D 0.6.6 ## 使い方 -0. https://github.com/OUCC/pltGUI/releases よりzipファイルをダウンロード、展開。 -1. plt Settingのwhole,graphに入力していく。 +0. https://github.com/OUCC/pltGUI/releases よりzipファイルをダウンロード、展開、`pltGUI.exe`を実行。 +1. plt Settingのwhole,graphに入力していく。 (複数のグラフを重ねて描写したいなら+マークで増やす) 2. plt Settingからplt Fileへの矢印を押してpltファイルを生成。 -3. (plt Fileのタブをクリックして中身を確認、保存) +3. plt Fileのタブをクリックして中身を確認、必要に応じて保存。 4. plt FileからImageへの矢印を押して画像を生成。 -5. 画像を確認、1.に戻って修正。 +5. Imageから画像を確認、1.に戻って修正。 6. 気に入ったら保存。 ## 画面構成 @@ -26,15 +26,10 @@ OpenSiv3D 0.6.6 ![see readme_images/graph1.png](readme_images/graph1.png) - graph2 ![see readme_images/graph2.png](readme_images/graph2.png) - - graph3 - ![see readme_images/graph3.png](readme_images/graph3.png) - plt File ![see readme_images/pltfile.png](readme_images/pltfile.png) - plt File ![see readme_images/pltimage.png](readme_images/pltimage.png) -- app options -![see readme_images/appoption.png](readme_images/appoption.png) -![see readme_images/appoption_theme.png](readme_images/appoption_theme.png) ### 説明 @@ -54,7 +49,8 @@ OpenSiv3D 0.6.6 - plt Setting 詳細は後述 - plt File -作成したpltファイル +作成したpltファイル。 +この画面で編集することも可能。 右上のSave asで保存できる。 - Image 作成したpltファイルから生成したグラフの画像 @@ -77,54 +73,80 @@ whole,graph の中身は下記入力項目を参照。 **注意**:データファイルを指定して描画する場合、生成されるplt Fileでは絶対パスで書かれるため、ユーザー名の流出などに注意。 ### 入力項目 -チェックなしは今後追加したいもの +チェックなしは今後追加したいもの。 +`vX.X.X`は追加されたバージョン、無表記は`v1.0.0`。 - plt setting - whole - - [x] title - - [x] xrange, yrange - - [x] logscale x, y - - [x] sample - - [x] xlabel, ylabel + - title + - xrange, yrange + - logscale x, y + - sample + - xlabel, ylabel + - load `v1.1.0` - graph - - [x] 削除ボタン - - [x] plot - - [x] plot "datafile" - - [x] using x:y - - [ ] splot - - [x] title - - [x] with lines - - [x] linecolor - - [x] linetype - - [x] linewidth - - [x] with points - - [x] linecolor - - [x] pointtype - - [x] pointsize + - 削除ボタン + - plot (function) + - plot "datafile" + - using x:y + - title + - with lines + - linecolor + - linetype + - linewidth + - with points + - linecolor + - pointtype + - pointsize ※with linesとwith pointsは同時に指定できる(with linespoints) また、linecolorはwith pointsとwith linesで共通のため、両方に存在するが中身は同じ。 - plt file - - [x] reload - - [x] save as + - save as - image - - [x] reload - - [x] save as + - reload + - save as - app options - - [x] ライセンスの表示 - - [x] pltファイルでの色の指定がrgbかhsvか - - [x] キーワードの省略 - - [x] アプリのテーマカラーの指定(Base,Main,Accent) -- その他UI - - [x] (plt setting -> plt file)のボタン - - [x] (plt file -> image)のボタン - - [x] optionsのタブをアイコンに - - [x] チェック範囲拡大でつけやすく - - [x] スクロールの範囲 - - [x] タブ部分と重なったときのクリック排除 - - [ ] データファイルのドラッグ&ドロップ - - [ ] 拡張子の設定 - - [ ] plt Fileの編集、スクロール - - [ ] テーマカラーなどの保存 - - [ ] ボタン一つでplt生成と画像生成を行うオプション - + - ライセンスの表示 + - pltファイルでの色の指定がrgbかhsvか + - キーワードの省略(部分的) + - アプリのテーマカラーの指定(Base,Main,Accent)(サポート終了) +- その他 + - (plt setting -> plt file)のボタン + - (plt file -> image)のボタン + + +## 今後の予定 +要望があれば積極的に取り入れます。 +上のやつからやるつもり。 +- 凡例の有無と位置の調整 +- グリッド +- logscaleの指数表記 +- UI周りのコードの整理 +- カラーテピッカーのスペース改善 +- 矢印ボタンを右クリックでplt生成と画像生成を自動で続けて行う +- 入力欄に大量の文字を入れるとはみ出る対策 +- データファイルのドラッグ&ドロップ +- カラーテーマの完全削除 +- アプリの大きさを変えられるようにする +- with linesとかの開くやつの閉じる機能 +- フォント指定 +- 複数pltファイル読み込み +- グルーピング機能 +- ドキュメント作成...要る? +- splot + + +## 更新履歴 +#### v1.1.0 2023-04-30 +Siv3Dバージョンアップ (v0.6.6 → v0.6.9) +pltファイルを編集可能に +pltファイルの実行を公式機能で行えるように +ライセンス更新 +plt Filesのreloadを削除 +Save asの拡張子選択でAll Filesを選択可能に +カラーテーマ変更機能のサポート終了(今回以降追加の機能にカラーテーマは適用されない) + +#### v1.0.0 2023-04-13 +初リリース +内容は省略 \ No newline at end of file diff --git a/pltGUI.sln b/pltGUI.sln index ac848ff..9cc30d4 100644 --- a/pltGUI.sln +++ b/pltGUI.sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.4.33205.214 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pltGUI", "pltGUI\pltGUI.vcxproj", "{9EED0104-C93E-418D-9749-4C795D4D47D5}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pltGUI", "pltGUI\pltGUI.vcxproj", "{D454C2E6-D2C3-4332-8884-D920142D4701}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -11,15 +11,15 @@ Global Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {9EED0104-C93E-418D-9749-4C795D4D47D5}.Debug|x64.ActiveCfg = Debug|x64 - {9EED0104-C93E-418D-9749-4C795D4D47D5}.Debug|x64.Build.0 = Debug|x64 - {9EED0104-C93E-418D-9749-4C795D4D47D5}.Release|x64.ActiveCfg = Release|x64 - {9EED0104-C93E-418D-9749-4C795D4D47D5}.Release|x64.Build.0 = Release|x64 + {D454C2E6-D2C3-4332-8884-D920142D4701}.Debug|x64.ActiveCfg = Debug|x64 + {D454C2E6-D2C3-4332-8884-D920142D4701}.Debug|x64.Build.0 = Debug|x64 + {D454C2E6-D2C3-4332-8884-D920142D4701}.Release|x64.ActiveCfg = Release|x64 + {D454C2E6-D2C3-4332-8884-D920142D4701}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {69FA6E5B-1DB8-4EB4-973D-419CBA50966F} + SolutionGuid = {3561CCE8-71D6-481E-A01D-99673DE695AA} EndGlobalSection EndGlobal diff --git a/pltGUI/App/engine/font/materialdesignicons/materialdesignicons-webfont.ttf.zstdcmp b/pltGUI/App/engine/font/materialdesignicons/materialdesignicons-webfont.ttf.zstdcmp index c7f18fa..f2281af 100644 Binary files a/pltGUI/App/engine/font/materialdesignicons/materialdesignicons-webfont.ttf.zstdcmp and b/pltGUI/App/engine/font/materialdesignicons/materialdesignicons-webfont.ttf.zstdcmp differ diff --git a/pltGUI/App/engine/font/noto-emoji/NotoColorEmoji.ttf.zstdcmp b/pltGUI/App/engine/font/noto-emoji/NotoColorEmoji.ttf.zstdcmp index ff36a11..89a17bb 100644 Binary files a/pltGUI/App/engine/font/noto-emoji/NotoColorEmoji.ttf.zstdcmp and b/pltGUI/App/engine/font/noto-emoji/NotoColorEmoji.ttf.zstdcmp differ diff --git a/pltGUI/App/loadsample.plt b/pltGUI/App/loadsample.plt new file mode 100644 index 0000000..806c1b5 --- /dev/null +++ b/pltGUI/App/loadsample.plt @@ -0,0 +1 @@ +set ylabel "loadsample" \ No newline at end of file diff --git a/pltGUI/Main.cpp b/pltGUI/Main.cpp index 5bec3f1..947dd2e 100644 --- a/pltGUI/Main.cpp +++ b/pltGUI/Main.cpp @@ -5,6 +5,7 @@ void Main() { Window::SetTitle(U"pltGUI"); + addLicense(); LicenseManager::DisableDefaultTrigger(); FontAsset::Register(U"main", 20); diff --git a/pltGUI/pltGUI.vcxproj b/pltGUI/pltGUI.vcxproj index 2111718..35da7d5 100644 --- a/pltGUI/pltGUI.vcxproj +++ b/pltGUI/pltGUI.vcxproj @@ -12,7 +12,7 @@ 15.0 - {9eed0104-c93e-418d-9749-4c795d4d47d5} + {d454c2e6-d2c3-4332-8884-d920142d4701} Win32Proj pltGUI 10.0 @@ -49,16 +49,16 @@ $(SolutionDir)Intermediate\$(ProjectName)\Debug\Intermediate\ $(ProjectName)(debug) $(ProjectDir)App - $(SIV3D_0_6_6)\include;$(SIV3D_0_6_6)\include\ThirdParty;$(IncludePath) - $(SIV3D_0_6_6)\lib\Windows;$(LibraryPath) + $(SIV3D_0_6_9)\include;$(SIV3D_0_6_9)\include\ThirdParty;$(IncludePath) + $(SIV3D_0_6_9)\lib\Windows;$(LibraryPath) false $(SolutionDir)Intermediate\$(ProjectName)\Release\ $(SolutionDir)Intermediate\$(ProjectName)\Release\Intermediate\ $(ProjectDir)App - $(SIV3D_0_6_6)\include;$(SIV3D_0_6_6)\include\ThirdParty;$(IncludePath) - $(SIV3D_0_6_6)\lib\Windows;$(LibraryPath) + $(SIV3D_0_6_9)\include;$(SIV3D_0_6_9)\include\ThirdParty;$(IncludePath) + $(SIV3D_0_6_9)\lib\Windows;$(LibraryPath) @@ -318,8 +318,8 @@ - + diff --git a/pltGUI/pltGUI.vcxproj.filters b/pltGUI/pltGUI.vcxproj.filters index caff863..edf5b2f 100644 --- a/pltGUI/pltGUI.vcxproj.filters +++ b/pltGUI/pltGUI.vcxproj.filters @@ -776,25 +776,25 @@ Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files diff --git a/pltGUI/plt_create.h b/pltGUI/plt_create.h index 5577e88..b771658 100644 --- a/pltGUI/plt_create.h +++ b/pltGUI/plt_create.h @@ -31,6 +31,11 @@ void CreatePltFile(WholeSettingUI& whole, Array& graphs) { if (ws.logscale_y.b) writer << U"set logscale y"; if (ws.sample.b) writer << U"set sample " << ws.sample.v.text; + + // 全体設定の最後 + if (ws.loadfile.b) writer << U"load \"" << ws.loadfile.v << U"\""; + + String command = U""; // 個別のグラフの書き込み for (auto i : step(graphs.size())) { @@ -90,15 +95,5 @@ void CreatePltFile(WholeSettingUI& whole, Array& graphs) { /// @brief pltファイルを実行する。 /// @brief 実行にかかる時間も特に停止しないので注意 void executePltFile() { - //system("result.plt"); - - //LPCSTR file = "C:\\path\\to\\file.txt"; //開くファイルのパス - LPCWSTR operation = NULL; //"open"; //アクション(open、edit、printなど) - LPCWSTR parameters = NULL; //パラメータ(任意) - LPCWSTR directory = NULL; //作業ディレクトリ(既定値を使用する場合はNULL) - int size = MultiByteToWideChar(CP_UTF8, 0, "result.plt", -1, NULL, 0); - wchar_t* wstr = new wchar_t[size]; - MultiByteToWideChar(CP_UTF8, 0, "result.plt", -1, wstr, size); - ShellExecute(NULL, operation, wstr, parameters, directory, SW_HIDE); - delete[] wstr; + System::LaunchFile(U"result.plt"); } diff --git a/pltGUI/plt_setting.h b/pltGUI/plt_setting.h index d6e0f2b..d6337c5 100644 --- a/pltGUI/plt_setting.h +++ b/pltGUI/plt_setting.h @@ -31,6 +31,7 @@ class WholeSetting { WithBool logscale_x; WithBool logscale_y; WithBool sample; + WithBool loadfile; }; diff --git a/pltGUI/ui_common.h b/pltGUI/ui_common.h index 7540411..e91cfbd 100644 --- a/pltGUI/ui_common.h +++ b/pltGUI/ui_common.h @@ -151,3 +151,12 @@ class ScrollableUI { Rect tabSpaceRect{ 0,0,800,110 }; Rect scrollSpaceRect{ 0,111,800,490 }; Color tabSpaceColor; + + +void addLicense() { + LicenseInfo info; + info.title = U"pltGUI"; + info.copyright = U"Copyright (c) 2023 OUCC"; + info.text = U"Permission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files(the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and /or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions : \n\nThe above copyright noticeand this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE."; + LicenseManager::AddLicense(info); +} diff --git a/pltGUI/ui_controller.h b/pltGUI/ui_controller.h index fd9f90e..68de730 100644 --- a/pltGUI/ui_controller.h +++ b/pltGUI/ui_controller.h @@ -17,17 +17,16 @@ class UIController { WholeSettingUI whole; Array graphs{ 1 }; - String pltFileString; + TextAreaEditState pltFileTES; Texture pltImageTexture; void readPltFile() { TextReader reader(U"result.plt"); - if (reader && reader.readAll(pltFileString)) { - return; - } - else { - pltFileString = U"Failed to read result.plt"; + + if (reader){ + reader.readAll(pltFileTES.text); + pltFileTES.rebuildGlyphs(); } } void readPltImage() { @@ -37,16 +36,19 @@ class UIController { void drawPltViewPage() { tabSpaceRect.draw(tabSpaceColor); - if (MyGUI::ReloadIconButton(Vec2(550, 85))) { - readPltFile(); - } if (MyGUI::SaveIconButton(Vec2(700, 85))) { - Optional path = Dialog::SaveFile(Array{ FileFilter{U"gnuplot",{U"plt"}} }); + Optional path = Dialog::SaveFile(Array{ FileFilter{U"gnuplot",{U"plt"}},FileFilter::AllFiles() }); if (path) FileSystem::Copy(U"result.plt", *path, CopyOption::OverwriteExisting); } - // pltファイルの中身表示。要改良 - FontAsset(U"main")(pltFileString).draw(Rect(50, 130, 700, 500), UIColor::text()); + if (SimpleGUI::TextArea(pltFileTES, Vec2(50, 130), Size(700, 450), 1e10)) { + TextWriter writer(U"result.plt", TextEncoding::UTF8_NO_BOM); + if (not writer) { + throw Error{ U"Failed to open `result.plt`" }; + } + writer.write(pltFileTES.text); + } + } void drawImageViewPage() { @@ -56,7 +58,7 @@ class UIController { readPltImage(); } if (MyGUI::SaveIconButton(Vec2(700, 85))) { - Optional path = Dialog::SaveFile(Array{ FileFilter::PNG() }); + Optional path = Dialog::SaveFile(Array{ FileFilter::PNG(),FileFilter::JPEG(), FileFilter::AllFiles() }); if (path) FileSystem::Copy(U"result.png", *path, CopyOption::OverwriteExisting); } @@ -118,6 +120,7 @@ class UIController { if (MyGUI::ArrowIconButton(Vec2(230, 35), watch1)) { CreatePltFile(whole, graphs); + readPltFile(); } if (MyGUI::ArrowIconButton(Vec2(480, 35), watch2)) { executePltFile(); diff --git a/pltGUI/ui_plt_setting.h b/pltGUI/ui_plt_setting.h index f604dab..f954a6d 100644 --- a/pltGUI/ui_plt_setting.h +++ b/pltGUI/ui_plt_setting.h @@ -50,6 +50,13 @@ class WholeSettingUI : public ScrollableUI { MyGUI::Text(U"sample", dpos.x(180)); MyGUI::TextBox(s.sample, dpos.y(55)); + MyGUI::CheckBoxArea(s.loadfile.b, dpos.x(20), Vec2(600, 50)); + MyGUI::Text(U"load", dpos.x(180)); + MyGUI::Text(FileSystem::FileName(s.loadfile.v), dpos.x(380)); + if (MyGUI::FolderIconButton(dpos.y(55))) { + Optional file = Dialog::OpenFile(Array{ FileFilter{U"gnuplot",{U"plt"}},FileFilter::AllFiles() }); + if (file) s.loadfile.v = *file; + } } }; diff --git a/readme_images/appoption.png b/readme_images/appoption.png deleted file mode 100644 index 7fe0301..0000000 Binary files a/readme_images/appoption.png and /dev/null differ diff --git a/readme_images/appoption_theme.png b/readme_images/appoption_theme.png deleted file mode 100644 index ef63296..0000000 Binary files a/readme_images/appoption_theme.png and /dev/null differ diff --git a/readme_images/graph1.png b/readme_images/graph1.png index a209680..eef80a1 100644 Binary files a/readme_images/graph1.png and b/readme_images/graph1.png differ diff --git a/readme_images/graph2.png b/readme_images/graph2.png index 8868937..75d7c90 100644 Binary files a/readme_images/graph2.png and b/readme_images/graph2.png differ diff --git a/readme_images/graph3.png b/readme_images/graph3.png deleted file mode 100644 index 1a47451..0000000 Binary files a/readme_images/graph3.png and /dev/null differ diff --git a/readme_images/pltfile.png b/readme_images/pltfile.png index 96842ac..eb037db 100644 Binary files a/readme_images/pltfile.png and b/readme_images/pltfile.png differ diff --git a/readme_images/pltimage.png b/readme_images/pltimage.png index 85ebf93..1493e7c 100644 Binary files a/readme_images/pltimage.png and b/readme_images/pltimage.png differ diff --git a/readme_images/whole.png b/readme_images/whole.png index 56073ac..49d2271 100644 Binary files a/readme_images/whole.png and b/readme_images/whole.png differ