from ImageScripter import *
from elan import *






#Layout#################################################
Say("Checking the layout page")
Configurator.layout.Click()
Configurator.layoutpage.SetThreshold(.98)
Configurator.layoutpage.Wait(seconds=10)
Say("Checking the layout page looks great")

Configurator.buildings.Click()
Configurator.buildingspage.SetThreshold(.98)
Configurator.buildingspage.Wait(seconds=10)

Configurator.planlayoutviews.Click()
Configurator.planlayoutviewspage.SetThreshold(.98)
Configurator.planlayoutviewspage.Wait(seconds=10)

Configurator.securitysystem.Click()
Configurator.securitysystempage.SetThreshold(.98)
Configurator.securitysystempage.Wait(seconds=10)

Configurator.climatesystem.Click()
Configurator.climatesystempage.SetThreshold(.98)
Configurator.climatesystempage.Wait(seconds=10)

Configurator.lightyingsystem.Click()

sleep(3)
Configurator.lightyingsyempage.SetThreshold(.98)
Configurator.lightyingsyempage.Wait(seconds=10)

Configurator.mediasystem.Click()

Configurator.mediasystempage.SetThreshold(.98)
Configurator.mediasystempage.Wait(seconds=10)

Configurator.videosystem.Click()

Configurator.videosystempage.SetThreshold(.98)
Configurator.videosystempage.Wait(seconds=10)

Configurator.irrigationsystem.Click()
Configurator.irrigationsystempage.SetThreshold(.98)
Configurator.irrigationsystempage.Wait(seconds=10)

###Layout#########################################

Configurator.system.Click()
Configurator.layout.Click()
Configurator.buildings.RightClick()
Configurator.buildingsrightclickmenu2.Wait()
Configurator.grey.Click()

Configurator.securitysystem.RightClick()
Configurator.securitysystemrightclickmenu.Wait()
Configurator.grey.Click()

Configurator.climatesystem.RightClick()
Configurator.climatesystemrightclickmenu.Wait()
Configurator.grey.Click()

Configurator.lightingsystem.RightClick()
Configurator.lightingsystemrightclickmenu.Wait()
Configurator.grey.Click()


Configurator.mediasystem.RightClick()
Configurator.mediasystemrightclickmenu.Wait()
Configurator.grey.Click()


Configurator.videosystem.RightClick()
Configurator.videosystemrightclickmenu.Wait()
Configurator.grey.Click()

try:
    Configurator.irrigationsystem.RightClick()
except:
    Configurator.messaging.Click()
    Configurator.layout.Click()
    sleep(2)
    Configurator.irrigationsystem.RightClick()
Configurator.irrigationsystemrightclickmenu.Wait()
Configurator.grey.Click()
####################################################WINDOW
##########################Buildings
Configurator.system.Click()
Configurator.layout.Click()
Configurator.buildings.RightClick()
Configurator.addnewbuilding.RealClick()
Configurator.addnewbuildingwindow.Wait()
AddNew.PushButton.Click('Cancel')
Press('enter')
###################################################
##########################Security System
Configurator.system.Click()
Configurator.layout.Click()
Configurator.securitysystem.RightClick()
Configurator.addnewview.RealClick()
Configurator.addnewviewwindow.Wait()
AddNew.PushButton.Click('Cancel')
Press('enter')
###################################################
##########################climate System
Configurator.system.Click()
Configurator.layout.Click()
Configurator.climatesystem.RightClick()
Configurator.addnewview.RealClick()
Configurator.addnewviewwindow.Wait()
AddNew.PushButton.Click('Cancel')
Press('enter')
###################################################
##########################lighting System
Configurator.system.Click()
Configurator.layout.Click()
Configurator.lightingsystem.RightClick()
Configurator.addnewview.RealClick()
Configurator.addnewviewwindow.Wait()
AddNew.PushButton.Click('Cancel')
Press('enter')
###################################################
##########################media System
Configurator.system.Click()
Configurator.layout.Click()
Configurator.mediasystem.RightClick()
Configurator.addnewview.RealClick()
Configurator.addnewviewwindow.Wait()
AddNew.PushButton.Click('Cancel')
Press('enter')
###################################################
##########################video System
Configurator.system.Click()
Configurator.layout.Click()
Configurator.videosystem.RightClick()
Configurator.addnewview.RealClick()
Configurator.addnewviewwindow.Wait()
AddNew.PushButton.Click('Cancel')
Press('enter')
###################################################
##########################irrigation System
Configurator.system.Click()
Configurator.layout.Click()
Configurator.irrigationsystem.RightClick()
Configurator.addnewview.RealClick()
Configurator.addnewviewwindow.Wait()
AddNew.PushButton.Click('Cancel')
Press('enter')
###################################################




Configurator.media.Click()
Configurator.system.Click()