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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Armin Co
Smart Grid Modell
Commits
ff8aa0d6
Commit
ff8aa0d6
authored
4 years ago
by
Armin Co
Browse files
Options
Downloads
Patches
Plain Diff
Cleanup
parent
70fc86dc
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
+1
-1
1 addition, 1 deletion
src/SmartGridModell.cpp
src/main.cpp
+4
-7
4 additions, 7 deletions
src/main.cpp
with
5 additions
and
8 deletions
src/SmartGridModell.cpp
+
1
−
1
View file @
ff8aa0d6
...
...
@@ -105,7 +105,7 @@ void SmartGridModell::set_output_pin(Pin pin, uint8_t value)
bool
succ
=
m_modell
.
send
(
static_cast
<
uint8_t
>
(
pin
),
value
);
spdlog
::
debug
(
"Send: {} {}, success: {}"
,
pin
,
value
,
succ
);
using
namespace
std
;
this_thread
::
sleep_for
(
chrono
::
milliseconds
(
25
0
));
this_thread
::
sleep_for
(
chrono
::
milliseconds
(
1
0
));
}
void
SmartGridModell
::
set_house_color
(
House
number
,
uint8_t
red
,
uint8_t
green
)
...
...
This diff is collapsed.
Click to expand it.
src/main.cpp
+
4
−
7
View file @
ff8aa0d6
...
...
@@ -93,20 +93,17 @@ int main()
// sim mode
// run loop
i2c
::
Node
arduino
{
0x14
};
if
(
false
==
arduino
.
open_device
(
"/dev/i2c-1"
))
i2c
::
Node
i2c_device
{
0x14
};
if
(
false
==
i2c_device
.
open_device
(
"/dev/i2c-1"
))
{
spdlog
::
error
(
"Failed to open device. Exiting..."
);
exit
(
1
);
}
spdlog
::
debug
(
"Node created"
);
SmartGridModell
modell
{
arduino
};
SmartGridModell
modell
{
i2c_device
,
SmartGridModell
::
DefaultState
::
Fancy
};
spdlog
::
debug
(
"Modell created"
);
using
namespace
std
;
modell
.
set_power_plant
(
21
);
modell
.
set_solar_plant
(
21
);
// ModelState state {};
// bool simulation_is_running {true};
...
...
@@ -115,7 +112,7 @@ int main()
// state.next_step();
// }
modell
.
put_modell_into_state
(
SmartGridModell
::
DefaultState
::
Off
);
spdlog
::
info
(
"End"
);
return
0
;
}
\ No newline at end of file
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