Skip to content
Snippets Groups Projects
Commit 3c1c034a authored by martiivGylden's avatar martiivGylden
Browse files

Working on dashboard

parent 36a8dd3a
No related branches found
No related tags found
No related merge requests found
......@@ -70,17 +70,17 @@ class Attack:
@dataclass
class Diagram():
threats: dict
consequences : dict
attacks : dict
dynamics : dict
metrics : dict
threats: dict[Threat]
consequences : dict[Consequence]
attacks : dict[Attack]
dynamics : dict[DynamicComponent]
metrics : dict[Metric]
def __init__(self) -> None:
self.threats = {}
self.consequences = {}
self.attacks = {}
self.dynamics = pd.DataFrame()
self.dynamics = {}
self.metrics = {}
def getThreat(self, id) -> Threat:
......
from tkinter import *
from tkinter import ttk
from tkinter import filedialog
import ERFormatConstants as const
import diagramParser as parse
from components import Diagram
import diagramParser as parse
guiRoot = Tk()
# TODO Need to fix some metric parsing issues, only the metric from the bowtie gets added i think
guiRoot.title("Indicator Analyzer for SSC Risk")
guiRoot.geometry("1080x1920")
def openFile():
......@@ -15,13 +19,43 @@ def openFile():
filetypes=(("CSV Diagram file", "*.csv"),)
)
diagram = parse.parseDiagramFile(fileName)
print(diagram.threats)
guiRoot = Tk()
top = Toplevel()
top.title("Parsed diagram")
top.geometry("1500x1500")
lab = Label(top, text="Dynamic components in the diagrams")
lab.config(font= ("Comic Sans MS", 25, "bold"))
lab.pack(pady=20)
createDynamic(diagram, top)
return diagram
def createDynamic(diagram: Diagram, top):
for dynamic in diagram.dynamics.values():
if dynamic.type == "ER": # If the dynamic is of type ER
dynamicDescription = dynamic.description
entityRelationshipComps = dynamic.associatedERComponents
label = f"Architecture dynamic, Description: {dynamicDescription}"
textList = []
for i in entityRelationshipComps:
componentTitle = i[const.textArea1].item()
componentDescription = i[const.textArea2].item()
componentLabel1 = Label(top, text= f"Component: {componentTitle}")
componentLabel1.config(font=("Comic Sans MS", 15))
componentLabel1.pack()
guiRoot.title("Dynamics Analyzer for SSC Risk")
guiRoot.geometry("1000x600")
else: # If not it is a bowtie dynamic
pass
labelWindow = Label(guiRoot, text="Please select CSV export file containing ER diagram, BowTie diagram and dynamics matrix", font=("Arial", 20), width=100, height=2)
......
print("Description of dynamic: ", dynamicDescription, "Associated entity relationship components: ", textList)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment