Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
raspberry
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
af3
raspberry
Commits
2e5c40a9
Commit
2e5c40a9
authored
6 years ago
by
Martin Eisenmann
Browse files
Options
Downloads
Patches
Plain Diff
Implemented LCD support
parent
6f3bbe3b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
org.fortiss.af3.platform.modelsconference/src/org/fortiss/af3/platform/modelsconference/generator/LCDGeneratorExtension.java
+37
-2
37 additions, 2 deletions
...orm/modelsconference/generator/LCDGeneratorExtension.java
with
37 additions
and
2 deletions
org.fortiss.af3.platform.modelsconference/src/org/fortiss/af3/platform/modelsconference/generator/LCDGeneratorExtension.java
+
37
−
2
View file @
2e5c40a9
...
...
@@ -15,6 +15,10 @@
+--------------------------------------------------------------------------*/
package
org.fortiss.af3.platform.modelsconference.generator
;
import
static
java
.
util
.
Arrays
.
asList
;
import
java.util.List
;
import
org.fortiss.af3.component.model.OutputPort
;
import
org.fortiss.af3.platform.modelsconference.model.LCD
;
import
org.fortiss.af3.platform.raspberry.generator.framework.IWriteableGeneratorExtension
;
...
...
@@ -31,15 +35,46 @@ public final class LCDGeneratorExtension extends WiringPiLibraryGeneratorExtensi
super
(
modelElement
);
}
/** {@inheritDoc} */
@Override
public
List
<
String
>
getHeaderIncludes
()
{
return
asList
(
"OLED_Display.h"
);
}
/** {@inheritDoc} */
@Override
public
String
getSingletonIdentifier
()
{
return
"OLED_Display.h"
;
}
/** {@inheritDoc} */
@Override
public
void
setSingletonPostfix
(
String
singletonPostfix
)
{
this
.
singletonPostfix
=
singletonPostfix
==
null
?
""
:
singletonPostfix
;
}
/** {@inheritDoc} */
@Override
public
String
getSingletonVariableDeclarationCode
()
{
return
"char oled_text[50];\n"
;
}
/** {@inheritDoc} */
@Override
public
String
getSingletonInitializationCode
()
{
return
"initDisplay();\n"
;
}
/** {@inheritDoc} */
@Override
public
String
getWriteCode
(
OutputPort
logicalSignal
,
String
value
)
{
return
"// FIXME: LCD support not implemented yet.\n"
;
return
"clearDisplay();\nsprintf(oled_text, \"Speed: %G km/h\", "
+
value
+
");\nprintTextPos(oled_text, 0, 0);\nshowDisplay();\n"
;
}
/** {@inheritDoc} */
@Override
public
String
getNoValWriteCode
(
OutputPort
logicalSignal
)
{
return
null
;
return
"clearDisplay();\nsprintf(oled_text, \"Speed: 0.0 km/h\");\nprintTextPos(oled_text, 0, 0);\nshowDisplay();\n"
;
}
}
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