Programming - First steps
P.
88 of 349
[EibPC]
//// Declarations
// Initializing the PageIDs for the Visualization Wizard
GeneralWeatherPageID = 1
//Initialization of the web element IDs
WindID = 1
WolkenID = 2
ClockID = 3
DateID = 4
In order to be able to work faster in the future, it is recommended to select function-oriented ID
designations.
The local elements are created directly in the web server configuration with IDs from (0 to 39), but
are just like the global elements for the time being without functionality.
The difference between button and shifter is just the size of the elements. While a button has a
simple width, the shifter is displayed with a double width.
These elements are configured as follows:
shifter(ID)[Graphics1, Graphics2, Graphics3, Graphics4]$Text$
button(ID) [Graphics] $Text$
pshifter(ID)[Graphics1, Graphics2, Graphics3, Graphics4]$Text$
pbutton(ID) [Graphics] $Text$
Graphic 2 to graphic 4 are optional
Now we know how the elements are integrated into the [
WebServer
] section of our site. They can be
arranged in various ways as chessboard patterns. The fixed configuration of built-in icons, lengths
and variables means that the configuration can be done purely text-based without the need for any
graphics.
[
WebServer
]
//Web elements for the weather page in the category General:
page(GeneralWeatherPageID)[$General$,$WeatherPage$]
design $black$[$/upload/EnertexLogoSilber2.jpg$]
header(0)
footer(0)
// First Line
button(WINDID)[WIND]$Wind in km/h$ \\
pbutton(31)[TEMPERATURE]$Outdoor temperature$\\
pshifter(17)[TEMPERATURE,TEMPERATURE]$Outer temp.: Min and Max in °C$\\
pbutton(5)[OKCIRCLE]$Status HG$
// Second Line
pbutton(15)[WEATHER]$Light in Lux$ \\
button(WolkenID)[WEATHER]$current weather$\\
pshifter(14)[WEATHER,NIGHT]$Sunrise- and Sunset$\\
pbutton(6)[OKCIRCLE]$Status NG$
// Third Line
shifter(ClockID)[CLOCK] $Time$\\
pshifter(13)[INFO]$Online$\\
shifter(DateID)[DATE]$Datum$
If we compile our previous program, the following representation is shown in the web server.
Figure 43:Elements in chessboard pattern
The arrangement of the elements is shown as desired. However, our logo can not be seen on the
background graphics because it is partly hidden by the elements, but we also scaled it for a
representation of 6x8 fields in the middle.
To create something for the eye, but also to get more information, we embed two graphical weather
forecasts. These should frame our background artwork on the side and stand above the created
global footer of time and date. For the integration we use the following function:
picture(ID)[
Height,Type
]
($Description$,$www-LINK$)
For the selected links, care should be taken that these are independent of time and date. Thus the
pages are updated independently and it does not need any other code to generate a refresh.
HandbuchEibPC_USA-30.odt, 2017-05-11
Enertex
®
Bayern GmbH - Erlachstraße 13 - 91301 Forchheim - [email protected]