#! /bin/bash

cd ${1}

#
# ana
#

echo UTSUSEMI
echo

cd ana/ui

echo "ANA UI"

pyside2-uic SequencerQ_Main.ui    -o ui_SequencerQ.py
pyside2-uic SequencerQ_Save.ui    -o ui_tmp1.py
pyside2-uic SequencerQ_Vis.ui    -o ui_tmp2.py

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

cp ui_SequencerQ.py ..

rm ui_tmp*.py

cd ../..

#
# vis
#

cd vis/ui

echo "VIS UI"

pyside2-uic D4mat2SlicerQ_Main.ui -o ui_D4mat2SlicerQ.py
pyside2-uic D4mat2SlicerQ_Sub.ui  -o ui_tmp1.py

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

rm ui_tmp*.py

cp ui_D4mat2SlicerQ.py ..

pyside2-uic D4matSlicerQ_Main.ui         -o ui_D4matSlicerQ.py
pyside2-uic D4matSlicerQ_MakeNewD4mat.ui -o ui_tmp1.py
pyside2-uic D4matSlicerQ_Rebin.ui        -o ui_tmp2.py
pyside2-uic D4matSlicerQ_Sub.ui          -o ui_tmp3.py
pyside2-uic DgSaveAsText.ui              -o ui_tmp4.py

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

rm ui_tmp*.py

cp ui_D4matSlicerQ.py ..

pyside2-uic VisContQ_DataOperationDialog.ui -o ui_VisContQ.py
pyside2-uic VisContQ_Main.ui                -o ui_tmp1.py
# pyside2-uic VisContQ_MainWithTab.ui         -o ui_tmp2.py
pyside2-uic VisContQ_SettingDialog.ui       -o ui_tmp3.py

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

rm ui_tmp*.py

cp ui_VisContQ.py ..

cd ../..

