Skip to content

Commit

Permalink
#3 replace "tool" with "idea"
Browse files Browse the repository at this point in the history
  • Loading branch information
jschalk committed Aug 31, 2023
1 parent ca4ebcc commit 06c430d
Show file tree
Hide file tree
Showing 84 changed files with 4,491 additions and 4,491 deletions.
4 changes: 2 additions & 2 deletions EditAcptFactTime.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ def update_acptfact(self):
self.close()

def display_acptfact_time(self):
# minutes_tool = self.agent_x.get_tool_kid(
# minutes_idea = self.agent_x.get_idea_kid(
# road=f"{self.agent_x._desc},time,jajatime"
# )
minutes_acptfact = self.agent_x._toolroot._acptfactunits[
minutes_acptfact = self.agent_x._idearoot._acptfactunits[
f"{self.agent_x._desc},time,jajatime"
]

Expand Down
2 changes: 1 addition & 1 deletion EditAgenda.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from src.pyqt5_kit.pyqt_func import num2str, lw_diplay
from src.agent.hreg_time import (
SuffFactUnitHregTime,
_get_time_hreg_weekday_tool,
_get_time_hreg_weekday_idea,
convert1440toHHMM,
)

Expand Down
328 changes: 164 additions & 164 deletions EditToolUnit.py → EditIdeaUnit.py

Large diffs are not rendered by default.

40 changes: 20 additions & 20 deletions EditMain.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from PyQt5 import QtGui as qtg
from PyQt5 import QtCore as qtc
from PyQt5.QtWidgets import QTableWidgetItem as qtw1
from EditToolUnit import EditToolUnit
from EditIdeaUnit import EditIdeaUnit
from EditMember import EditMember
from src.pyqt5_kit.pyqt_func import (
lw_diplay,
Expand All @@ -21,13 +21,13 @@ class EditMainViewException(Exception):
class EditMainView(qtw.QWidget, Ui_Form):
"""The settings dialog window"""

refresh_toolunit_submitted = qtc.pyqtSignal(bool)
refresh_ideaunit_submitted = qtc.pyqtSignal(bool)

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.setupUi(self)
self.refresh_button.clicked.connect(self.refresh_all)
self.basetoolunit.itemClicked.connect(self.open_edittoolunit)
self.baseideaunit.itemClicked.connect(self.open_editideaunit)
self.member_list.itemClicked.connect(self.open_edit_member)
self.close_button.clicked.connect(self.close)
self.open_groupedit_button.clicked.connect(self.open_edit_member)
Expand Down Expand Up @@ -78,14 +78,14 @@ def get_acptfacts_list(self):
if self.display_problem_acptfacts_cb.checkState() == 2:
x_list.extend(
acptfact
for acptfact in self.agent_x._toolroot._acptfactunits.values()
for acptfact in self.agent_x._idearoot._acptfactunits.values()
if (
self.agent_x.get_tool_kid(road=acptfact.base)._problem_bool
or self.agent_x.get_tool_kid(road=acptfact.pick)._problem_bool
self.agent_x.get_idea_kid(road=acptfact.base)._problem_bool
or self.agent_x.get_idea_kid(road=acptfact.pick)._problem_bool
)
)
else:
x_list = self.agent_x._toolroot._acptfactunits.values()
x_list = self.agent_x._idearoot._acptfactunits.values()
return x_list

def acptfacts_table_load(self):
Expand Down Expand Up @@ -142,7 +142,7 @@ def acptfact_clear_fields(self):
def acptfact_table_select(self):
self.acptfact_base_update_combo.clear()
self.acptfact_base_update_combo.addItems(
self.agent_x.get_tool_tree_ordered_road_list()
self.agent_x.get_idea_tree_ordered_road_list()
)
self.acptfact_base_update_combo.setCurrentText(
self.acptfacts_table.item(self.acptfacts_table.currentRow(), 2).text()
Expand Down Expand Up @@ -184,7 +184,7 @@ def acptfact_update_heir(self, base_road):
):
raise EditMainViewException("No table selection for acptfact update.")
acptfact_update_combo_text = self.acptfact_update_combo.currentText()
self.agent_x._toolroot._acptfactunits[
self.agent_x._idearoot._acptfactunits[
base_road
].acptfact = acptfact_update_combo_text
self.base_road = None
Expand All @@ -193,7 +193,7 @@ def acptfact_update_heir(self, base_road):
def refresh_all(self):
if self.agent_x != None:
self.refresh_member_list()
self.refresh_tool_tree()
self.refresh_idea_tree()
self.acptfacts_table_load()

def refresh_member_list(self):
Expand All @@ -219,22 +219,22 @@ def refresh_member_list(self):
self.member_list.setItem(row - 1, 0, qtw.QTableWidgetItem(member.name))
self.member_list.setItem(row - 1, 1, qt_agent_credit)

def open_edittoolunit(self):
self.EditToolunit = EditToolUnit()
self.EditToolunit.agent_x = self.agent_x
self.EditToolunit.refresh_tree()
self.EditToolunit.show()
def open_editideaunit(self):
self.EditIdeaunit = EditIdeaUnit()
self.EditIdeaunit.agent_x = self.agent_x
self.EditIdeaunit.refresh_tree()
self.EditIdeaunit.show()

def open_edit_member(self):
self.edit_member = EditMember()
self.edit_member.agent_x = self.agent_x
self.edit_member.refresh_all()
self.edit_member.show()

def refresh_tool_tree(self):
tree_root = get_pyqttree(toolroot=self.agent_x._toolroot)
self.basetoolunit.clear()
self.basetoolunit.insertTopLevelItems(0, [tree_root])
def refresh_idea_tree(self):
tree_root = get_pyqttree(idearoot=self.agent_x._idearoot)
self.baseideaunit.clear()
self.baseideaunit.insertTopLevelItems(0, [tree_root])

# expand to depth set by agent
def yo_tree_setExpanded(root):
Expand All @@ -244,5 +244,5 @@ def yo_tree_setExpanded(root):
item.setExpanded(item.data(2, 20))
yo_tree_setExpanded(item)

root = self.basetoolunit.invisibleRootItem()
root = self.baseideaunit.invisibleRootItem()
yo_tree_setExpanded(root)
2 changes: 1 addition & 1 deletion EditMember2bd.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
class EditMember2bd(qtw.QWidget, Ui_Form):
"""The settings dialog window"""

refresh_toolunit_submitted = qtc.pyqtSignal(bool)
refresh_ideaunit_submitted = qtc.pyqtSignal(bool)

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
Expand Down
60 changes: 30 additions & 30 deletions EditProblem.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
from PyQt5 import QtGui as qtg
from PyQt5 import QtCore as qtc
from PyQt5.QtWidgets import QTableWidgetItem as qti
from EditToolUnit import EditToolUnit
from EditIdeaUnit import EditIdeaUnit
from EditMember import EditMember
from src.pyqt5_kit.pyqt_func import lw_diplay, get_pyqttree, num2str
from src.agent.group import groupunit_shop, grouplink_shop
from src.agent.tool import ToolKid
from src.agent.idea import IdeaKid
from src.agent.road import Road, get_walk_from_road, get_terminus_node_from_road
from sys import exit as sys_exit

Expand Down Expand Up @@ -39,15 +39,15 @@
class EditProblem(qtw.QWidget, Ui_Form):
"""The settings dialog window"""

refresh_toolunit_submitted = qtc.pyqtSignal(bool)
refresh_ideaunit_submitted = qtc.pyqtSignal(bool)

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.setupUi(self)
self.close_button.clicked.connect(self.close)
self.quit_button.clicked.connect(sys_exit)
self.refresh_button.clicked.connect(self.refresh_all)
self.basetoolunit.itemClicked.connect(self.open_edittoolunit)
self.baseideaunit.itemClicked.connect(self.open_editideaunit)
self.add_group_button.clicked.connect(self.add_group)
self.load_problem_button.clicked.connect(self.load_problem)

Expand Down Expand Up @@ -115,20 +115,20 @@ def create_grouplinks_list(self):
return grouplinks_x_list

def load_problem(self):
self.set_problem_dominate_action_tool(road=self.problem_name_text.text())
self.set_problem_dominate_action_tool(road=self.action1_text.text())
self.set_problem_dominate_action_tool(road=self.action2_text.text())
self.set_problem_dominate_action_tool(road=self.action3_text.text())
self.set_problem_dominate_action_idea(road=self.problem_name_text.text())
self.set_problem_dominate_action_idea(road=self.action1_text.text())
self.set_problem_dominate_action_idea(road=self.action2_text.text())
self.set_problem_dominate_action_idea(road=self.action3_text.text())
self.refresh_all()

def set_problem_dominate_action_tool(self, road):
def set_problem_dominate_action_idea(self, road):
if road != "":
prob_walk = get_walk_from_road(road)
prob_desc = get_terminus_node_from_road(road)
prob_tool = ToolKid(_desc=prob_desc, _walk=prob_walk)
prob_idea = IdeaKid(_desc=prob_desc, _walk=prob_walk)
for grouplink_x in self.create_grouplinks_list():
prob_tool.set_grouplink(grouplink_x)
self.agent_x.set_dominate_promise_tool(tool_kid=prob_tool)
prob_idea.set_grouplink(grouplink_x)
self.agent_x.set_dominate_promise_idea(idea_kid=prob_idea)

def add_group(self):
if self.add_group_text not in (None, ""):
Expand All @@ -148,15 +148,15 @@ def refresh_all(self):

if self.agent_x != None:
self.refresh_agenda_list()
self.refresh_tool_tree()
self.refresh_idea_tree()

tool_road_list = self.agent_x.get_tool_tree_ordered_road_list()
tool_road_list.insert(0, "")
idea_road_list = self.agent_x.get_idea_tree_ordered_road_list()
idea_road_list.insert(0, "")

self.problem_name_combo.clear()
self.problem_name_combo.addItems(tool_road_list)
self.problem_name_combo.addItems(idea_road_list)
self.problem_context_combo.clear()
self.problem_context_combo.addItems(tool_road_list)
self.problem_context_combo.addItems(idea_road_list)
self.group1_name_combo.clear()
self.group2_name_combo.clear()
self.group3_name_combo.clear()
Expand All @@ -166,9 +166,9 @@ def refresh_all(self):
self.action1_combo.clear()
self.action2_combo.clear()
self.action3_combo.clear()
self.action1_combo.addItems(tool_road_list)
self.action2_combo.addItems(tool_road_list)
self.action3_combo.addItems(tool_road_list)
self.action1_combo.addItems(idea_road_list)
self.action2_combo.addItems(idea_road_list)
self.action3_combo.addItems(idea_road_list)

def select_agenda_item(self):
pass
Expand Down Expand Up @@ -256,22 +256,22 @@ def set_agenda_table_gui_attr(self):
]
)

def open_edittoolunit(self):
self.EditToolunit = EditToolUnit()
self.EditToolunit.agent_x = self.agent_x
self.EditToolunit.refresh_tree()
self.EditToolunit.show()
def open_editideaunit(self):
self.EditIdeaunit = EditIdeaUnit()
self.EditIdeaunit.agent_x = self.agent_x
self.EditIdeaunit.refresh_tree()
self.EditIdeaunit.show()

def open_edit_member(self):
self.edit_member = EditMember()
self.edit_member.agent_x = self.agent_x
self.edit_member.refresh_all()
self.edit_member.show()

def refresh_tool_tree(self):
tree_root = get_pyqttree(toolroot=self.agent_x._toolroot)
self.basetoolunit.clear()
self.basetoolunit.insertTopLevelItems(0, [tree_root])
def refresh_idea_tree(self):
tree_root = get_pyqttree(idearoot=self.agent_x._idearoot)
self.baseideaunit.clear()
self.baseideaunit.insertTopLevelItems(0, [tree_root])

# expand to depth set by agent
def yo_tree_setExpanded(root):
Expand All @@ -281,5 +281,5 @@ def yo_tree_setExpanded(root):
item.setExpanded(item.data(2, 20))
yo_tree_setExpanded(item)

root = self.basetoolunit.invisibleRootItem()
root = self.baseideaunit.invisibleRootItem()
yo_tree_setExpanded(root)
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,25 +78,25 @@ AgentUnit MemberUnit objects

AgentUnit GroupUnit objects

AgentUnit ToolUnit objects
AgentUnit IdeaUnit objects

AgentUnit ToolUnit hierarchical structure
AgentUnit IdeaUnit hierarchical structure

AgentUnit ToolUnit GroupLink objects
AgentUnit IdeaUnit GroupLink objects

AgentUnit ToolUnit GroupLine objects
AgentUnit IdeaUnit GroupLine objects

AgentUnit ToolUnit GroupHeir objects
AgentUnit IdeaUnit GroupHeir objects

AgentUnit ToolUnit GroupHeir objects
AgentUnit IdeaUnit GroupHeir objects

AgentUnit ToolUnit RequiredFactUnit objects
AgentUnit IdeaUnit RequiredFactUnit objects

AgentUnit ToolUnit RequiredFactHeir objects
AgentUnit IdeaUnit RequiredFactHeir objects

AgentUnit ToolUnit AcptFactUnit objects
AgentUnit IdeaUnit AcptFactUnit objects

AgentUnit ToolUnit AcptFactHeir objects
AgentUnit IdeaUnit AcptFactHeir objects


## 1.3 Test-Driven-Development
Expand Down
16 changes: 8 additions & 8 deletions main_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,10 @@ def set_acptfact_time_open_5daysago(self):
def _set_acptfact_time_open_midnight_attr(self):
road_minute = f"{self.agent_x._desc},time,jajatime"
open_dt = self.agent_x.get_time_dt_from_min(
self.agent_x._toolroot._acptfactunits[road_minute].open
self.agent_x._idearoot._acptfactunits[road_minute].open
)
nigh_dt = self.agent_x.get_time_dt_from_min(
self.agent_x._toolroot._acptfactunits[road_minute].nigh
self.agent_x._idearoot._acptfactunits[road_minute].nigh
)
open_midnight = datetime(
year=open_dt.year,
Expand Down Expand Up @@ -302,7 +302,7 @@ def agent_new(self):
self.agent_x._set_acptfacts_empty_if_null()
self.agent_x.set_members_empty_if_null()
self.agent_x.set_groupunits_empty_if_null()
self.agent_x.set_time_hreg_tools(c400_count=7)
self.agent_x.set_time_hreg_ideas(c400_count=7)
road_minute = f"{self.agent_x._desc},time,jajatime"
self.agent_x.set_acptfact(
base=road_minute, pick=road_minute, open=1000000, nigh=1000000
Expand All @@ -312,10 +312,10 @@ def agent_new(self):
def refresh_datetime_display(self):
road_minute = f"{self.agent_x._desc},time,jajatime"
jajatime_open = self.agent_x.get_time_dt_from_min(
self.agent_x._toolroot._acptfactunits[road_minute].open
self.agent_x._idearoot._acptfactunits[road_minute].open
)
jajatime_nigh = self.agent_x.get_time_dt_from_min(
self.agent_x._toolroot._acptfactunits[road_minute].nigh
self.agent_x._idearoot._acptfactunits[road_minute].nigh
)
week_days = ("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun")
self.root_datetime_curr_label.setText(
Expand All @@ -340,7 +340,7 @@ def agent_load(self, lw_json: str):
self.refresh_all()

def get_acptfacts_list(self):
return self.agent_x._toolroot._acptfactunits.values()
return self.agent_x._idearoot._acptfactunits.values()

def acptfacts_table_load(self):
self.acptfacts_table.setRowCount(0)
Expand Down Expand Up @@ -395,7 +395,7 @@ def acptfact_update_heir(self, base_road):
):
raise MainAppException("No table selection for acptfact update.")
acptfact_update_combo_text = self.acptfact_update_combo.currentText()
self.agent_x._toolroot._acptfactunits[
self.agent_x._idearoot._acptfactunits[
base_road
].acptfact = acptfact_update_combo_text
self.base_road = None
Expand Down Expand Up @@ -478,7 +478,7 @@ def set_agenda_states_table_properties(self):
"jajatime",
"jaja_nigh",
"agent_importance",
"tool_road",
"idea_road",
"branch_percent",
]
)
Expand Down
Loading

0 comments on commit 06c430d

Please sign in to comment.