Skip to content

Commit

Permalink
Merge pull request #6 from OUCC/develop
Browse files Browse the repository at this point in the history
v1.1.0
  • Loading branch information
MrMocchy authored Apr 29, 2023
2 parents ac0166c + 41170b8 commit a63eb69
Show file tree
Hide file tree
Showing 21 changed files with 133 additions and 94 deletions.
124 changes: 73 additions & 51 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. 気に入ったら保存。

## 画面構成
Expand All @@ -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)

### 説明

Expand All @@ -54,7 +49,8 @@ OpenSiv3D 0.6.6
- plt Setting
詳細は後述
- plt File
作成したpltファイル
作成したpltファイル。
この画面で編集することも可能。
右上のSave asで保存できる。
- Image
作成したpltファイルから生成したグラフの画像
Expand All @@ -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
初リリース
内容は省略
12 changes: 6 additions & 6 deletions pltGUI.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@ 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
Debug|x64 = Debug|x64
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
Binary file not shown.
Binary file modified pltGUI/App/engine/font/noto-emoji/NotoColorEmoji.ttf.zstdcmp
Binary file not shown.
1 change: 1 addition & 0 deletions pltGUI/App/loadsample.plt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
set ylabel "loadsample"
1 change: 1 addition & 0 deletions pltGUI/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
void Main()
{
Window::SetTitle(U"pltGUI");
addLicense();
LicenseManager::DisableDefaultTrigger();

FontAsset::Register(U"main", 20);
Expand Down
12 changes: 6 additions & 6 deletions pltGUI/pltGUI.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>15.0</VCProjectVersion>
<ProjectGuid>{9eed0104-c93e-418d-9749-4c795d4d47d5}</ProjectGuid>
<ProjectGuid>{d454c2e6-d2c3-4332-8884-d920142d4701}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>pltGUI</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
Expand Down Expand Up @@ -49,16 +49,16 @@
<IntDir>$(SolutionDir)Intermediate\$(ProjectName)\Debug\Intermediate\</IntDir>
<TargetName>$(ProjectName)(debug)</TargetName>
<LocalDebuggerWorkingDirectory>$(ProjectDir)App</LocalDebuggerWorkingDirectory>
<IncludePath>$(SIV3D_0_6_6)\include;$(SIV3D_0_6_6)\include\ThirdParty;$(IncludePath)</IncludePath>
<LibraryPath>$(SIV3D_0_6_6)\lib\Windows;$(LibraryPath)</LibraryPath>
<IncludePath>$(SIV3D_0_6_9)\include;$(SIV3D_0_6_9)\include\ThirdParty;$(IncludePath)</IncludePath>
<LibraryPath>$(SIV3D_0_6_9)\lib\Windows;$(LibraryPath)</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)Intermediate\$(ProjectName)\Release\</OutDir>
<IntDir>$(SolutionDir)Intermediate\$(ProjectName)\Release\Intermediate\</IntDir>
<LocalDebuggerWorkingDirectory>$(ProjectDir)App</LocalDebuggerWorkingDirectory>
<IncludePath>$(SIV3D_0_6_6)\include;$(SIV3D_0_6_6)\include\ThirdParty;$(IncludePath)</IncludePath>
<LibraryPath>$(SIV3D_0_6_6)\lib\Windows;$(LibraryPath)</LibraryPath>
<IncludePath>$(SIV3D_0_6_9)\include;$(SIV3D_0_6_9)\include\ThirdParty;$(IncludePath)</IncludePath>
<LibraryPath>$(SIV3D_0_6_9)\lib\Windows;$(LibraryPath)</LibraryPath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
Expand Down Expand Up @@ -318,8 +318,8 @@
<ClInclude Include="plt_create.h" />
<ClInclude Include="plt_setting.h" />
<ClInclude Include="stdafx.h" />
<ClInclude Include="ui_controller.h" />
<ClInclude Include="ui_common.h" />
<ClInclude Include="ui_controller.h" />
<ClInclude Include="ui_plt_setting.h" />
</ItemGroup>
<ItemGroup>
Expand Down
14 changes: 7 additions & 7 deletions pltGUI/pltGUI.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -776,25 +776,25 @@
<ClInclude Include="stdafx.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="plt_setting.h">
<ClInclude Include="app_option.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="ui_plt_setting.h">
<ClInclude Include="my_gui.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="ui_controller.h">
<ClInclude Include="plt_create.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="ui_common.h">
<ClInclude Include="plt_setting.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="plt_create.h">
<ClInclude Include="ui_common.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="my_gui.h">
<ClInclude Include="ui_controller.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="app_option.h">
<ClInclude Include="ui_plt_setting.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
Expand Down
17 changes: 6 additions & 11 deletions pltGUI/plt_create.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ void CreatePltFile(WholeSettingUI& whole, Array<GraphSettingUI>& 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())) {
Expand Down Expand Up @@ -90,15 +95,5 @@ void CreatePltFile(WholeSettingUI& whole, Array<GraphSettingUI>& 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");
}
1 change: 1 addition & 0 deletions pltGUI/plt_setting.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class WholeSetting {
WithBool<void> logscale_x;
WithBool<void> logscale_y;
WithBool<TextEditState> sample;
WithBool<FilePath> loadfile;
};


Expand Down
9 changes: 9 additions & 0 deletions pltGUI/ui_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
29 changes: 16 additions & 13 deletions pltGUI/ui_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,16 @@ class UIController {
WholeSettingUI whole;
Array<GraphSettingUI> 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() {
Expand All @@ -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<String> path = Dialog::SaveFile(Array{ FileFilter{U"gnuplot",{U"plt"}} });
Optional<String> 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() {
Expand All @@ -56,7 +58,7 @@ class UIController {
readPltImage();
}
if (MyGUI::SaveIconButton(Vec2(700, 85))) {
Optional<String> path = Dialog::SaveFile(Array{ FileFilter::PNG() });
Optional<String> path = Dialog::SaveFile(Array{ FileFilter::PNG(),FileFilter::JPEG(), FileFilter::AllFiles() });
if (path) FileSystem::Copy(U"result.png", *path, CopyOption::OverwriteExisting);
}

Expand Down Expand Up @@ -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();
Expand Down
Loading

0 comments on commit a63eb69

Please sign in to comment.