Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
DynamicRiskManagementforSSC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Martin Iversen
DynamicRiskManagementforSSC
Commits
3c1c034a
Commit
3c1c034a
authored
1 year ago
by
martiivGylden
Browse files
Options
Downloads
Patches
Plain Diff
Working on dashboard
parent
36a8dd3a
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
components.py
+6
-6
6 additions, 6 deletions
components.py
dashBoard.py
+40
-6
40 additions, 6 deletions
dashBoard.py
tempCodeRunnerFile.py
+1
-0
1 addition, 0 deletions
tempCodeRunnerFile.py
with
47 additions
and
12 deletions
components.py
+
6
−
6
View file @
3c1c034a
...
...
@@ -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
:
...
...
This diff is collapsed.
Click to expand it.
dashBoard.py
+
40
−
6
View file @
3c1c034a
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
)
...
...
This diff is collapsed.
Click to expand it.
tempCodeRunnerFile.py
0 → 100644
+
1
−
0
View file @
3c1c034a
print
(
"
Description of dynamic:
"
,
dynamicDescription
,
"
Associated entity relationship components:
"
,
textList
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment