Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
Smart Grid Modell
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Armin Co
Smart Grid Modell
Commits
09275c0e
Commit
09275c0e
authored
4 years ago
by
Armin Co
Browse files
Options
Downloads
Patches
Plain Diff
Updates to config
parent
9e1db5df
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/SmartGridModell.cpp
+3
-3
3 additions, 3 deletions
src/SmartGridModell.cpp
src/smg_server.cpp
+3
-3
3 additions, 3 deletions
src/smg_server.cpp
with
6 additions
and
6 deletions
src/SmartGridModell.cpp
+
3
−
3
View file @
09275c0e
...
...
@@ -58,13 +58,13 @@ void SmartGridModell::update_windmill_speed(uint8_t speed)
{
set_output_pin
(
Pin
::
WindmillMotor
,
speed
);
}
else
if
(
speed
>
2
0
)
else
if
(
speed
==
0
)
{
set_output_pin
(
Pin
::
WindmillMotor
,
min_motor_speed
);
set_output_pin
(
Pin
::
WindmillMotor
,
0
);
}
else
{
set_output_pin
(
Pin
::
WindmillMotor
,
0
);
set_output_pin
(
Pin
::
WindmillMotor
,
min_motor_speed
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/smg_server.cpp
+
3
−
3
View file @
09275c0e
...
...
@@ -109,8 +109,8 @@ private:
}
void
update_wind
()
{
double
wind_by_sun
=
m_sun
*
5
.0
/
100.0
;
// wind by sun should by 5 max.
auto
random_wind
=
((
std
::
rand
()
*
1.0
)
/
RAND_MAX
)
*
7
.0
;
double
wind_by_sun
=
m_sun
*
7
.0
/
100.0
;
// wind by sun should by 5 max.
auto
random_wind
=
((
std
::
rand
()
*
1.0
)
/
RAND_MAX
)
*
5
.0
;
m_wind
=
power_wind
[
static_cast
<
int
>
(
wind_by_sun
+
random_wind
)];
}
void
update_power_consumption
()
...
...
@@ -209,7 +209,7 @@ void run_sim()
while
(
active
)
{
day
.
next_hour
();
std
::
this_thread
::
sleep_for
(
std
::
chrono
::
seconds
(
1
));
std
::
this_thread
::
sleep_for
(
std
::
chrono
::
milli
seconds
(
500
));
}
}
...
...
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