mirror of
https://github.com/RolandWH/SIPPCompare.git
synced 2025-04-20 00:11:48 +01:00
Compare commits
No commits in common. "b62518875f407b7b361d2cb4a5e6115075c869af" and "1748fb849fe0f5c686df545cfa41b3e7e48b4806" have entirely different histories.
b62518875f
...
1748fb849f
@ -7,19 +7,19 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>420</width>
|
||||
<height>228</height>
|
||||
<height>250</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>420</width>
|
||||
<height>228</height>
|
||||
<height>250</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>420</width>
|
||||
<height>228</height>
|
||||
<height>250</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@ -35,7 +35,7 @@
|
||||
<x>10</x>
|
||||
<y>0</y>
|
||||
<width>401</width>
|
||||
<height>171</height>
|
||||
<height>191</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
@ -58,28 +58,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QDoubleSpinBox" name="value_input">
|
||||
<property name="frame">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="buttonSymbols">
|
||||
<enum>QAbstractSpinBox::ButtonSymbols::NoButtons</enum>
|
||||
</property>
|
||||
<property name="specialValueText">
|
||||
<string>£</string>
|
||||
</property>
|
||||
<property name="correctionMode">
|
||||
<enum>QAbstractSpinBox::CorrectionMode::CorrectToNearestValue</enum>
|
||||
</property>
|
||||
<property name="prefix">
|
||||
<string>£</string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>999999999.990000009536743</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QLabel" name="mix_lab">
|
||||
<property name="text">
|
||||
@ -113,6 +91,13 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QComboBox" name="share_trades_combo">
|
||||
<property name="editable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="fund_trades_lab">
|
||||
<property name="text">
|
||||
@ -129,19 +114,31 @@
|
||||
</item>
|
||||
<item row="5" column="0" colspan="2">
|
||||
<widget class="QPushButton" name="calc_but">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Calculate</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QComboBox" name="share_trades_combo">
|
||||
<property name="editable">
|
||||
<item row="0" column="1">
|
||||
<widget class="QDoubleSpinBox" name="value_input">
|
||||
<property name="frame">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="buttonSymbols">
|
||||
<enum>QAbstractSpinBox::ButtonSymbols::NoButtons</enum>
|
||||
</property>
|
||||
<property name="specialValueText">
|
||||
<string>£</string>
|
||||
</property>
|
||||
<property name="correctionMode">
|
||||
<enum>QAbstractSpinBox::CorrectionMode::CorrectToNearestValue</enum>
|
||||
</property>
|
||||
<property name="prefix">
|
||||
<string>£</string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>999999999.990000009536743</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
@ -175,13 +172,6 @@
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>value_input</tabstop>
|
||||
<tabstop>mix_slider</tabstop>
|
||||
<tabstop>share_trades_combo</tabstop>
|
||||
<tabstop>fund_trades_combo</tabstop>
|
||||
<tabstop>calc_but</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
@ -62,11 +62,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>output</tabstop>
|
||||
<tabstop>res_save_but</tabstop>
|
||||
<tabstop>res_ok_but</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
|
@ -6,22 +6,10 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>480</width>
|
||||
<width>481</width>
|
||||
<height>305</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>480</width>
|
||||
<height>305</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>480</width>
|
||||
<height>305</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Platform Editor</string>
|
||||
</property>
|
||||
@ -218,7 +206,6 @@
|
||||
<tabstop>share_plat_fee_box</tabstop>
|
||||
<tabstop>share_plat_max_fee_box</tabstop>
|
||||
<tabstop>share_deal_fee_box</tabstop>
|
||||
<tabstop>share_deal_reduce_trades_box</tabstop>
|
||||
<tabstop>share_deal_reduce_amount_box</tabstop>
|
||||
<tabstop>save_but</tabstop>
|
||||
</tabstops>
|
||||
|
@ -1,5 +1,5 @@
|
||||
from PyQt6.QtGui import QIntValidator
|
||||
from PyQt6.QtWidgets import QMainWindow, QWidget
|
||||
from PyQt6.QtWidgets import QMainWindow
|
||||
from PyQt6 import uic
|
||||
|
||||
import output_window
|
||||
@ -7,7 +7,7 @@ import output_window
|
||||
|
||||
class SIPPCompare(QMainWindow):
|
||||
# Receive instance of PlatformEdit() as parameter
|
||||
def __init__(self, plat_edit_win: QWidget):
|
||||
def __init__(self, plat_edit_win):
|
||||
super().__init__()
|
||||
# Import Qt Designer UI XML file
|
||||
uic.loadUi("gui/main_gui.ui", self)
|
||||
@ -39,9 +39,6 @@ class SIPPCompare(QMainWindow):
|
||||
self.actionEdit_Platforms.triggered.connect(self.show_platform_edit)
|
||||
# Update percentage mix label when slider moved
|
||||
self.mix_slider.valueChanged.connect(self.update_slider_lab)
|
||||
#self.value_input.valueChanged.connect(self.check_valid)
|
||||
self.share_trades_combo.currentTextChanged.connect(self.check_valid)
|
||||
self.fund_trades_combo.currentTextChanged.connect(self.check_valid)
|
||||
|
||||
# Set validators
|
||||
self.share_trades_combo.setValidator(QIntValidator(0, 999))
|
||||
@ -53,13 +50,6 @@ class SIPPCompare(QMainWindow):
|
||||
mix_lab_str = f"Investment mix (funds {slider_val}% / shares {100 - slider_val}%)"
|
||||
self.mix_lab.setText(mix_lab_str)
|
||||
|
||||
def check_valid(self):
|
||||
if self.share_trades_combo.currentText() != "" \
|
||||
and self.fund_trades_combo.currentText() != "":
|
||||
self.calc_but.setEnabled(True)
|
||||
else:
|
||||
self.calc_but.setEnabled(False)
|
||||
|
||||
# Get variables from platform editor input fields
|
||||
def init_variables(self):
|
||||
self.plat_name = self.platform_win.get_plat_name()
|
||||
@ -79,7 +69,7 @@ class SIPPCompare(QMainWindow):
|
||||
self.fund_plat_fees = 0
|
||||
value_num = float(self.value_input.value())
|
||||
# Funds/shares mix
|
||||
slider_val: int = self.mix_slider.value()
|
||||
slider_val = self.mix_slider.value()
|
||||
funds_value = (slider_val / 100) * value_num
|
||||
fund_trades_num = int(self.fund_trades_combo.currentText())
|
||||
self.fund_deal_fees = fund_trades_num * self.fund_deal_fee
|
||||
|
@ -24,7 +24,7 @@ class OutputWindow(QWidget):
|
||||
if not os.path.exists("output"):
|
||||
os.makedirs("output")
|
||||
filename_str = f"output/{self.platform_name}-{cur_time.year}.{cur_time.month}.{cur_time.day}.txt"
|
||||
output_file = open(filename_str, "wt", encoding = "utf-8")
|
||||
output_file = open(filename_str, "wt")
|
||||
output_file.write(self.results_str)
|
||||
|
||||
# Display fees in output window as plaintext readout
|
||||
|
@ -27,8 +27,6 @@ class PlatformEdit(QWidget):
|
||||
self.share_deal_reduce_amount = 0.0
|
||||
# Debugging feature: set with "--DEBUG_AUTOFILL" cmd argument
|
||||
self.autofill = autofill
|
||||
if autofill:
|
||||
self.save_but.setEnabled(True)
|
||||
|
||||
# Create main window object, passing this instance as param
|
||||
self.main_win = main_window.SIPPCompare(self)
|
||||
|
Loading…
x
Reference in New Issue
Block a user