Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Simulator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
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
Container 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
letsgoING
ArduBlock Source
Simulator
Commits
cb4e9119
Commit
cb4e9119
authored
Mar 17, 2021
by
Leon Dieter
Browse files
Options
Downloads
Patches
Plain Diff
minor changes
parent
db1cbe71
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/tec/letsgoing/ardublock/simulator/Simulator.java
+5
-1
5 additions, 1 deletion
src/tec/letsgoing/ardublock/simulator/Simulator.java
src/tec/letsgoing/ardublock/simulator/view/GUI.java
+27
-8
27 additions, 8 deletions
src/tec/letsgoing/ardublock/simulator/view/GUI.java
with
32 additions
and
9 deletions
src/tec/letsgoing/ardublock/simulator/Simulator.java
+
5
−
1
View file @
cb4e9119
...
...
@@ -171,12 +171,16 @@ public class Simulator implements Runnable, ActionListener{
}
}
Point
locationWindow
=
gui
.
getLocation
();
//int WidthWindow = gui.getxscale();
//int HeightWindow = gui.getyscale();
gui
.
stopThread
();
gui
.
dispose
();
createSubClasses
();
//gui.updateGUI(WidthWindow, HeightWindow);
gui
.
setLocation
(
locationWindow
);
for
(
SimCodeFunction
function
:
functionsCode
)
{
arduino
.
addFunction
(
function
);
}
...
...
This diff is collapsed.
Click to expand it.
src/tec/letsgoing/ardublock/simulator/view/GUI.java
+
27
−
8
View file @
cb4e9119
...
...
@@ -63,11 +63,11 @@ public class GUI extends JFrame implements Runnable, ActionListener {
private
JButton
clearButton
;
private
JCheckBox
checkBox
;
private
JScrollPane
scrollPane
;
private
int
xscale
=
968
;
private
int
xscale
=
800
;
private
int
yscale
=
968
;
private
JPanel
modulPanel
;
private
Container
mainPane
;
private
int
WindowHeight
=
1000
,
WindowWidth
=
9
50
,
topPanelHeight
,
topPanelWidth
;
private
int
WindowHeight
=
968
,
WindowWidth
=
9
68
,
topPanelHeight
,
topPanelWidth
;
/**
* Konstruktor der Klasse GUI
...
...
@@ -136,6 +136,9 @@ public class GUI extends JFrame implements Runnable, ActionListener {
@Override
public
void
componentResized
(
ComponentEvent
e
)
{
//Das Fenster soll erst dann upgedatet werden wenn eine Grennderung grer 30 stattgefunden hat
//um zu verhindern dass die update Funktion durch ein zu hufiges Aufrufen das Programm aufhngt.
if
((
Math
.
abs
(
WindowHeight
-
getHeight
())
>
5
)
||
(
Math
.
abs
(
WindowWidth
-
getWidth
())
>
5
))
{
...
...
@@ -161,6 +164,7 @@ public class GUI extends JFrame implements Runnable, ActionListener {
}
}
@Override
...
...
@@ -206,12 +210,15 @@ public class GUI extends JFrame implements Runnable, ActionListener {
// modules[3].updateGUI(_xscale, _yscale);
updateSerialLog
(
getHeight
()-
topPanel
.
getHeight
());
super
.
setVisible
(
true
);
panel
.
setVisible
(
true
);
updateSerialLog
(
getHeight
()-
topPanel
.
getHeight
());
}
...
...
@@ -320,7 +327,7 @@ public class GUI extends JFrame implements Runnable, ActionListener {
int
numRows
=
Math
.
min
(
Math
.
max
(((
int
)
size
/
20
)-
3
,
3
),
20
);
serialLog
.
setRows
(
numRows
);
System
.
out
.
println
(
numRows
);
this
.
setVisible
(
true
);
}
/**
...
...
@@ -462,5 +469,17 @@ public class GUI extends JFrame implements Runnable, ActionListener {
}
public
int
getxscale
()
{
return
xscale
;
}
public
int
getyscale
()
{
return
yscale
;
}
}
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
sign in
to comment