#! /bin/bash

cd ${1}/uis

#
# M2PlotPlus
#

echo UGAO
echo
echo M2PLOTPLUS

cd M2PlotPlus

pyside2-uic M2PlotPlus.ui         -o ui_M2PlotPlus.py

cd ..

#
# MPlot
#

echo MPLOT

cd MPlot

pyside2-uic FastPlot.ui           -o ui_FastPlotQt.py
pyside2-uic DgPlotPtn.ui          -o ui_tmp01.py
pyside2-uic DgScaleLabel.ui       -o ui_tmp02.py
pyside2-uic DgSetting.ui          -o ui_tmp03.py
pyside2-uic DgTitle.ui            -o ui_tmp04.py
pyside2-uic FloatBox.ui           -o ui_tmp05.py
pyside2-uic DgSaveAsText.ui       -o ui_tmp06.py
pyside2-uic DgFitting.ui          -o ui_tmp07.py
pyside2-uic DgGridSetting.ui      -o ui_tmp08.py
pyside2-uic DgTickStyleSetting.ui -o ui_tmp09.py
pyside2-uic DgCalcDS.ui           -o ui_tmp10.py

cat ui_tmp01.py | grep -v "coding: utf-8" | grep -v "from PySide2 import QtCore, QtGui" >> ui_FastPlotQt.py
cat ui_tmp02.py | grep -v "coding: utf-8" | grep -v "from PySide2 import QtCore, QtGui" >> ui_FastPlotQt.py
cat ui_tmp03.py | grep -v "coding: utf-8" | grep -v "from PySide2 import QtCore, QtGui" >> ui_FastPlotQt.py
cat ui_tmp04.py | grep -v "coding: utf-8" | grep -v "from PySide2 import QtCore, QtGui" >> ui_FastPlotQt.py
cat ui_tmp05.py | grep -v "coding: utf-8" | grep -v "from PySide2 import QtCore, QtGui" >> ui_FastPlotQt.py
cat ui_tmp06.py | grep -v "coding: utf-8" | grep -v "from PySide2 import QtCore, QtGui" >> ui_FastPlotQt.py
cat ui_tmp07.py | grep -v "coding: utf-8" | grep -v "from PySide2 import QtCore, QtGui" >> ui_FastPlotQt.py
cat ui_tmp08.py | grep -v "coding: utf-8" | grep -v "from PySide2 import QtCore, QtGui" >> ui_FastPlotQt.py
cat ui_tmp09.py | grep -v "coding: utf-8" | grep -v "from PySide2 import QtCore, QtGui" >> ui_FastPlotQt.py
cat ui_tmp10.py | grep -v "coding: utf-8" | grep -v "from PySide2 import QtCore, QtGui" >> ui_FastPlotQt.py

rm ui_tmp*.py

cd ..

#
# u2dplot
#

echo u2dplot

cd u2dplot

pyside2-uic u2dplot.ui            -o ui_u2dplot.py
pyside2-uic dg_overplot.ui        -o ui_tmp1.py
pyside2-uic dg_region.ui          -o ui_tmp2.py
pyside2-uic dg_slice.ui           -o ui_tmp3.py
pyside2-uic dg_view_prms.ui       -o ui_tmp4.py

cat ui_tmp1.py | grep -v "coding: utf-8" | grep -v "from PySide2 import QtCore, QtGui" >> ui_u2dplot.py
cat ui_tmp2.py | grep -v "coding: utf-8" | grep -v "from PySide2 import QtCore, QtGui" >> ui_u2dplot.py
cat ui_tmp3.py | grep -v "coding: utf-8" | grep -v "from PySide2 import QtCore, QtGui" >> ui_u2dplot.py
cat ui_tmp4.py | grep -v "coding: utf-8" | grep -v "from PySide2 import QtCore, QtGui" >> ui_u2dplot.py

rm ui_tmp*.py

cd ..

#
# cp
#

cp */ui_*.py ..


