Pablo Antoln - PowerPoint PPT Presentation

1 / 10
About This Presentation
Title:

Pablo Antoln

Description:

If temperature is above 20 degrees the DiscoBall should be rotating. ... http://webcam.cnet.se/view/index.shtml. Run the application from a browser ... – PowerPoint PPT presentation

Number of Views:35
Avg rating:3.0/5.0
Slides: 11
Provided by: peterro8
Category:
Tags: antoln | cnet | downloads | pablo

less

Transcript and Presenter's Notes

Title: Pablo Antoln


1
  • Pablo AntolĂ­n
  • Francisco Milagro
  • TID

PHP EDITION!!
2
Application View
Windmeter
Disco Ball
Rain Sensor
Lamp
Fan
Phone
Thermometer
3
Your assignment
  • If temperature is above 20 degrees the DiscoBall
    should be rotating.
  • When windspeed exceeds 2 the Light should flash 3
    times.
  • Windspeed can be altered by turning on Fan in
    front of Windmeter.
  • When leaving application Fan and DiscoBall should
    be turned off.

4
1. Set up the environment
  • Install a web server with PHP support like
    Apache. You can try easy to install Apache
    distributions like XAMPP (Apache, PHP MySQL)
  • We will use Eclipse as the IDE to create the
    first Hydra application in Hydra
  • You can of course use any other IDE or text editor

5
2. Create a PHP project
  • Point your content to the htdocs folder in the
    server and create an index.php file

6
3. Web Service References
  • Use these endpoints to consume the services
  • DiscoBall http//212.214.80.1618080/3/BasicSwitc
    hWS
  • Fan http//212.214.80.1618080/4/BasicSwitchWS
  • Light http//212.214.80.1618080/2/EnhancedSwitch
    WS
  • Thermometer http//212.214.80.1618080/Thermomete
    rWS
  • Windmeter http//212.214.80.1618080/WindmeterWS

7
4 Start coding
//Create a PHP SOAP Client to access the
thermometer service clientT new
SoapClient("http//212.214.80.1618080/Thermometer
WS?wsdl") //Get temperature result
clientT-gtGetIndoorTemperature() indoorTemp
result-gtGetIndoorTemperatureResult if
(indoorTemp gt 20) //Rotate DiscoBall
clientD new SoapClient("http//212.214.80.1618
080/3/BasicSwitchWS?wsdl") result
clientD-gtTurnOn() //Turn on the fan clientF
new SoapClient("http//212.214.80.1618080/4/Bas
icSwitchWS?wsdl") result clientF-gtTurnOn()
8
5 Finalise your Code
//Check wind speed clientW new
SoapClient("http//212.214.80.1618080/WindmeterWS
?wsdl") windSpeed 0 while (windSpeed lt 2)
result clientW-gtGetWindSpeed()
windSpeed result-gtGetWindSpeedResult if
(windSpeed gt 2) //Blink light
clientL new SoapClient("http//212.214.80.1618
080/2/EnhancedSwitchWS?wsdl") result
clientL-gtFlash(3) //Turn off fan and
disco ball result clientF-gtTurnOff() result
clientD-gtTurnOff()
9
6. View Application when Executinghttp//webcam.c
net.se/view/index.shtml
  • Run the application from a browser
  • http//localhostserverport/HydraForDummies
  • Check that everything is working in the live
    webcam

10
Congratulations! You are now a Hydra Pro!
Write a Comment
User Comments (0)
About PowerShow.com