Skip to content

Commit

Permalink
- Multiple fsl
Browse files Browse the repository at this point in the history
- Splash screen
  • Loading branch information
Graveflo committed Mar 7, 2021
1 parent 8c26240 commit e8c675d
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 26 deletions.
5 changes: 1 addition & 4 deletions Forms/Main_Window.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ def setupUi(self, MainWindow):
self.verticalLayout_11 = QtWidgets.QVBoxLayout(self.tab_enhanceforprofit)
self.verticalLayout_11.setObjectName("verticalLayout_11")
self.table_FS_2 = QtWidgets.QTableWidget(self.tab_enhanceforprofit)
self.table_FS_2.setEnabled(True)
self.table_FS_2.setEnabled(False)
self.table_FS_2.setAlternatingRowColors(True)
self.table_FS_2.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection)
self.table_FS_2.setObjectName("table_FS_2")
Expand Down Expand Up @@ -666,9 +666,6 @@ def setupUi(self, MainWindow):
self.menuFile.addAction(self.actionOpen_Settings_Directory)
self.menuFile.addAction(self.actionOpen_Log_File)
self.menuFile.addSeparator()
self.menuFile.addAction(self.actionExport_CSV)
self.menuFile.addAction(self.actionExport_Excel)
self.menuFile.addSeparator()
self.menuFile.addAction(self.actionExit)
self.menuView.addAction(self.actionOpen_Item_Store)
self.menuView.addAction(self.actionFail_Stack_Graph)
Expand Down
5 changes: 1 addition & 4 deletions Forms/Main_Window.ui
Original file line number Diff line number Diff line change
Expand Up @@ -1091,7 +1091,7 @@
<item>
<widget class="QTableWidget" name="table_FS_2">
<property name="enabled">
<bool>true</bool>
<bool>false</bool>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
Expand Down Expand Up @@ -1461,9 +1461,6 @@
<addaction name="actionOpen_Settings_Directory"/>
<addaction name="actionOpen_Log_File"/>
<addaction name="separator"/>
<addaction name="actionExport_CSV"/>
<addaction name="actionExport_Excel"/>
<addaction name="separator"/>
<addaction name="actionExit"/>
</widget>
<widget class="QMenu" name="menuView">
Expand Down
9 changes: 5 additions & 4 deletions FrmMain.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ def get_state_json(self):
super_state = super(FrmSettings, self).get_state_json()
tree_gnome = self.frmMain.ui.table_genome
fsl_l = []
fsl_l_c = self[self.P_GENOME_FS]
for i in range(0, tree_gnome.topLevelItemCount()):
tli = tree_gnome.topLevelItem(i)
if isinstance(tli, GenomeGroupTreeWidget):
Expand All @@ -96,8 +97,8 @@ def get_state_json(self):
child = tli.child(i)
if isinstance(child, EvolveSolutionWidget):
fsl = child.fsl
if fsl in self[self.P_GENOME_FS]:
_l.append(0)
if fsl in fsl_l_c:
_l.append(fsl_l_c.index(fsl))
else:
_l.append(fsl.get_state_json())
if len(_l) > 0:
Expand Down Expand Up @@ -243,8 +244,8 @@ def actionOpen_Log_File_triggered():
frmObj.actionWindow_Always_on_Top.triggered.connect(actionWindow_Always_on_Top_triggered)
frmObj.actionGitHub_README.triggered.connect(actionGitHub_README_triggered)
frmObj.actionDownload_Latest.triggered.connect(actionDownload_Latest_triggered)
frmObj.actionExport_CSV.triggered.connect(actionExport_CSV_triggered)
frmObj.actionExport_Excel.triggered.connect(actionExport_Excel_triggered)
#frmObj.actionExport_CSV.triggered.connect(actionExport_CSV_triggered)
#frmObj.actionExport_Excel.triggered.connect(actionExport_Excel_triggered)
frmObj.actionMarket_Tax_Calc.triggered.connect(actionMarket_Tax_Calc_triggered)
frmObj.actionSign_in_to_MP.triggered.connect(actionSign_in_to_MP_triggered)
frmObj.actionGear_Type_Probability_Table.triggered.connect(actionGear_Type_Probability_Table_triggered)
Expand Down
Binary file removed Images/Equipment.png
Binary file not shown.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ It still needs more testing and the code could be commented better, but I am po
the code so it isn't necessary to wait on me and you can alter it as you please.

<p align="center">
<img src="Images/Equipment.png">
<img src="SampleImages/Equipment.png">
</p>
<p align="center">
<img src="Images/compact_overlay.png">
<img src="SampleImages/compact_overlay.png">
</p>


Expand Down
Binary file added SampleImages/Equipment.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 9 additions & 6 deletions Widgets/tableFS_Cost_Secondary.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def make_menu(self, menu: QMenu):
def check_index_widget_menu(self, index:QModelIndex, menu:QMenu):
pass

def cmdFSRefresh_clicked(self, fsl):
def cmdFSRefresh_clicked(self, fsl:FailStackList):
model:Enhance_model = self.enh_model
settings = model.settings

Expand All @@ -55,8 +55,7 @@ def cmdFSRefresh_clicked(self, fsl):
if not fsl.validate():
return

if not fsl.validate():
clear_table(self)
clear_table(self)
try:
if model.fs_needs_update:
model.calcFS()
Expand All @@ -66,6 +65,10 @@ def cmdFSRefresh_clicked(self, fsl):
self.frmMain.show_warning_msg(str(e))
return

if not fsl.has_ran():
fsl.set_primary_data(model.primary_fs_gear, model.primary_fs_cost, model.primary_cum_fs_cost)
fsl.evaluate_map()

index_FS = self.get_header_index(HEADER_FS)
index_GEAR = self.get_header_index(HEADER_GEAR)
index_COST = self.get_header_index(HEADER_COST)
Expand All @@ -74,9 +77,9 @@ def cmdFSRefresh_clicked(self, fsl):
index_CUMULATIVE_PROBABILITY = self.get_header_index(HEADER_CUMULATIVE_PROBABILITY)

with SpeedUpTable(self):
fs_items = model.optimal_fs_items
fs_cost = model.fs_cost
cum_fs_cost = model.cum_fs_cost
fs_items = fsl.gear_list
fs_cost = fsl.fs_cost
cum_fs_cost = fsl.fs_cum_cost

this_gear = fsl.secondary_gear
bti_m_o = this_gear.gear_type.bt_start - 1
Expand Down
3 changes: 2 additions & 1 deletion Widgets/tableGenome.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ def set_gear(self, gear: Gear):
def update_data(self):
self.update_gw()
self.update_genome()
self.update_num_fs()

def update_num_fs(self):
tree = self.treeWidget()
Expand Down Expand Up @@ -454,7 +455,7 @@ class TableGenome(QTreeWidget, AbstractTable):
sig_thread_destroyed = pyqtSignal(object, name='sig_thread_destroyed')
sig_selected_genome_changed = pyqtSignal(name='sig_selected_genome_changed')
sig_item_clicked = pyqtSignal(object, name='sig_item_clicked')
HEADERS = [HEADER_NAME, HEADER_GENOME, HEADER_FITNESS]
HEADERS = [HEADER_NAME, HEADER_GENOME, HEADER_FITNESS, HEADER_NUM_FS]

def __init__(self, *args, **kwargs):
self.pool_size = 4
Expand Down
2 changes: 0 additions & 2 deletions Widgets/table_FS_Secondary.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ def refresh_strat(self):
continue
gmap[dis_gear] = fsl


for i in range(0, self.topLevelItemCount()):
item = self.topLevelItem(i)
this_gw = self.itemWidget(item, idx_NAME)
Expand Down Expand Up @@ -170,7 +169,6 @@ def refresh_strat(self):
except (KeyError, ItemStoreException, TypeError):
pass
prv_num += amount_fs
break

def reload_list(self):
super(TableFSSecondary, self).reload_list()
Expand Down
2 changes: 1 addition & 1 deletion model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1448,7 +1448,7 @@ def calc_fs_secondary(self):
fsl.set_primary_data(self.primary_fs_gear, self.primary_fs_cost, self.primary_cum_fs_cost)
if fsl.validate():
fsl.evaluate_map()
mintrix = numpy.argmin([self.cum_fs_cost, fsl.fs_cum_cost], axis=0)
mintrix = numpy.argmin([self.cum_fs_cost[:fsl.num_fs+1], fsl.fs_cum_cost], axis=0)
for i, p in enumerate(mintrix):
if p == 1:
self.optimal_fs_items[i] = fsl.gear_list[i]
Expand Down
10 changes: 8 additions & 2 deletions start_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
"""
import sys, os, time

from .qt_UI_Common import pix, BS_CHEER

from .DlgAddGear import imgs

from . import common
from PyQt5.QtWidgets import QApplication, QStyleFactory
from PyQt5.QtWidgets import QApplication, QStyleFactory, QSplashScreen
from .FrmMain import Frm_Main
from .common import USER_DATA_PATH

Expand All @@ -21,7 +23,7 @@
setIcon = Qt_common.setIcon
MAXIMUM_LOGFILE_SIZE = 500 * 1024

RELEASE_VER = '0.4.1a2'
RELEASE_VER = '0.4.1a3'


def launch():
Expand All @@ -44,6 +46,9 @@ def launch():
sys.stdout = tee
#os.environ['QTWEBENGINE_CHROMIUM_FLAGS'] = '--remote-debugging-port=4867 --reduced-referrer-granularity --disable-site-isolation-trials --disable-features=NetworkService,NetworkServiceInProcess'
app = QApplication(sys.argv)
splash = QSplashScreen(pix[BS_CHEER])
splash.show()
app.processEvents()
#app
# Basic app theme here
app.setStyle(QStyleFactory.create('Fusion'))
Expand All @@ -56,6 +61,7 @@ def launch():
#frmmain.load_file(common.DEFAULT_SETTINGS_PATH)

frmmain.show()
splash.finish(frmmain)
app.setQuitOnLastWindowClosed(False)
status_code = app.exec_()
imgs.kill_pool()
Expand Down

0 comments on commit e8c675d

Please sign in to comment.