Skip to content

Commit

Permalink
Merge pull request #18 from QGrain-Organization/dev0.3
Browse files Browse the repository at this point in the history
v0.2.6.1
  • Loading branch information
Yuming Liu authored Feb 10, 2020
2 parents 02e23f6 + 9012b52 commit 07ef6d4
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,4 @@ venv.bak/
/logs
/temp
settings/ui.ini
/docs/*/*.pdf
3 changes: 2 additions & 1 deletion build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ cd %USERPROFILE%\Desktop\QGrain\dist\ && ^
rename qgrain QGrain && ^
cd QGrain && ^
rename qgrain.exe QGrain.exe && ^
rename qgrain.exe.manifest QGrain.exe.manifest && ^
xcopy /IYE %USERPROFILE%\Desktop\QGrain\i18n %USERPROFILE%\Desktop\QGrain\dist\QGrain\i18n && ^
xcopy /IYE %USERPROFILE%\Desktop\QGrain\settings %USERPROFILE%\Desktop\QGrain\dist\QGrain\settings && ^
xcopy /IYE %USERPROFILE%\Desktop\QGrain\docs %USERPROFILE%\Desktop\QGrain\dist\QGrain\docs && ^
xcopy /IYE %USERPROFILE%\Desktop\QGrain\samples %USERPROFILE%\Desktop\QGrain\dist\QGrain\samples && ^
xcopy /IYE %USERPROFILE%\BuildQGrain\Lib\site-packages\palettable\colorbrewer\data %USERPROFILE%\Desktop\QGrain\dist\QGrain\palettable\colorbrewer\data && ^
copy %USERPROFILE%\Desktop\QGrain\LICENSE.rtf %USERPROFILE%\Desktop\QGrain\dist\QGrain\ && ^
copy %USERPROFILE%\Desktop\QGrain\docs\tutorials\document.pdf %USERPROFILE%\Desktop\QGrain\dist\QGrain\document.pdf && ^
del %USERPROFILE%\Desktop\QGrain\dist\QGrain\settings\ui.ini && ^
echo 6. back to desktop directory && ^
cd %USERPROFILE%\Desktop\QGrain && ^
Expand Down
40 changes: 40 additions & 0 deletions docs/tutorials/document.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# QGrain

QGrain is an easy to use software that can unmix the multi-modal grain size distribution to some single modals.

It's written by Python. This makes it can benefit from the great open source and scientific computation communities.

QGrain is still during the rapid development stage, its functionalities and usages may changes many and many times. And of course, there probably are some bugs. We are very sorry for its immaturity.

We are really hope to receive your feedbacks. Whatever it's bug report, request of new feature, disscusion on algorithms.

Moreover, we are looking forward that there are some partners to join the development of QGrain.

If you have any idea, you can contact the authors below.

## Authors

* Yuming Liu

<a href="mailto:\\liuyuming@ieecas.cn">liuyuming@ieecas.cn</a>

<!-- Paging -->
<div class="page"/>

:[How to install QGrain](./install.md)
<div class="page"/>

:[Overview of UI](./overview_of_ui.md)
<div class="page"/>

:[How to load grain size distribution data](./load_data.md)
<div class="page"/>

:[The algorithms of QGrain](./algorithm.md)
<div class="page"/>

:[How to fit the samples](./fit.md)
<div class="page"/>

:[How to adjust algorithm](./adjust_algorithm.md)
<div class="page"/>
13 changes: 13 additions & 0 deletions docs/tutorials/overview_of_ui.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,17 @@ The dock to dynamically display the distribution of raw data and fitting result

![Appearance of Distribution Canvas](../figures/distribution_canvas.png)

For the dock which contains canvas, you can follow the following mouse interaction to adjust the figure.

* **Left button**: Interacts with items in the scene (select/move objects, etc). If there are no movable objects under the mouse cursor, then dragging with the left button will pan the scene instead.
* **Right button drag**: Scales the scene. Dragging left/right scales horizontally; dragging up/down scales vertically (although some scenes will have their x/y scales locked together). If there are x/y axes fisible in the scene, then right-dragging over the axis will _only_ affect that axis.
* **Right button click**: Clicking the right button in most cases will show a context menu with a variety of options depending on the object(s) under the mouse cursor.
* **Middle button (or wheel) drag**: Dragging the mouse with the wheel pressed down will always pan the scene (this is useful in instances where panning with the left button is prevented by other objects in the scene).
* **Wheel spin**: Zooms the scene in and out.

Moreover, you can check the `temp` folder of QGrain to get the files of canvas.
Note: If the size of `temp` folder is larger than 1 GB, it will be cleared when the app is initialized.

### Control Panel

The dock to control the fitting behaviours.
Expand Down Expand Up @@ -57,6 +68,8 @@ The dock to control the fitting behaviours.

The dock to show the GSD data of samples.

By clicking the row of sample, you can set this sample as current sample and process it.

![Appearance of Raw Data Table](../figures/raw_data_table.png)

### Recorded Data Table
Expand Down
10 changes: 9 additions & 1 deletion qgrain.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@
from PySide2.QtGui import QIcon, QPixmap
from PySide2.QtWidgets import QApplication, QSplashScreen

import pyqtgraph as pg
pg.setConfigOptions(antialias=True)

from ui.MainWindow import GUILogHandler, MainWindow

QGRAIN_VERSION = "0.2.6"
QGRAIN_VERSION = "0.2.6.1"

# 1 GB
TEMP_FOLDER_LIMIT_SIZE = 1024 * 1024 * 1024
Expand All @@ -30,6 +33,7 @@ def check_temp_folder():

def create_necessary_folders():
necessary_folders = ("./logs/", "./temp/",
"./temp/pca_panel", "./temp/pca_panel/png", "./temp/pca_panel/svg",
"./temp/distribution_canvas", "./temp/distribution_canvas/png", "./temp/distribution_canvas/svg",
"./temp/loss_canvas", "./temp/loss_canvas/png", "./temp/loss_canvas/svg")
for folder in necessary_folders:
Expand Down Expand Up @@ -63,12 +67,16 @@ def setup_theme(app: QApplication) -> bool:
app.setStyleSheet(template_styles+custom_style)

if theme == "Aqua":
pg.setConfigOptions(background=pg.mkColor("#ececec"))
return True
elif theme == "Ubuntu":
pg.setConfigOptions(background=pg.mkColor("#f0f0f0"))
return True
elif theme == "ElegantDark":
pg.setConfigOptions(background=pg.mkColor("#525252"))
return False
elif theme == "MaterialDark":
pg.setConfigOptions(background=pg.mkColor("#1e1d23"))
return False
else:
raise NotImplementedError(theme)
Expand Down
2 changes: 0 additions & 2 deletions ui/DistributionCanvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
from models.FittingResult import FittingResult
from models.SampleData import SampleData

pg.setConfigOptions(background=pg.mkColor("#FFFFFF00"), antialias=True)

@unique
class XAxisSpace(Enum):
Raw = 0
Expand Down
4 changes: 4 additions & 0 deletions ui/PCAPanel.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,10 @@ def on_perform_clicked(self):

self.transformed = transformed
self.logger.debug("PCA algorithm performed.")
# export chart to file
self.png_exporter.export("./temp/pca_panel/png/pca.png")
self.svg_exporter.export("./temp/pca_panel/svg/pca.svg")


def on_save_clicked(self):
if self.transformed is None:
Expand Down

0 comments on commit 07ef6d4

Please sign in to comment.