# This script tests the displaying of custom messages and images. # Created by Toni Sagrista from time import sleep from gaia.cu9.ari.gaiaorbit.script import EventScriptingInterface gs = EventScriptingInterface() # Minimize interface, disable input, stop camera gs.disableInput() gs.cameraStop() gs.minimizeInterfaceWindow() # Add messages gs.displayMessageObject(0, "This is the zero message", 0.2, 0.0, 1.0, 0.0, 0.0, 8) sleep(1.5) gs.displayMessageObject(1, "This is the first message", 0.2, 0.2, 0.3, 0.4, 0.6, 10) sleep(1.5) gs.displayMessageObject(2, "This is the second message", 0.3, 0.1, 0.0, 1.0, 0.0, 11) sleep(1.5) gs.displayImageObject(10, "scripts/customobjects-test/profile.png", 0.1, 0.7) gs.displayMessageObject(3, "Monkey!", 0.7, 0.62, 0.9, 0.0, 1.0, 18) sleep(1.5) gs.displayMessageObject(4, "This is the fourth message", 0.4, 0.6, 1.0, 1.0, 0.0, 17) sleep(1.5) gs.displayMessageObject(5, "This is the fifth message", 0.5, 0.8, 1.0, 0.0, 1.0, 22) sleep(1.5) gs.removeObject(0) sleep(1.5) gs.removeObject(1)
# Test script. Tests GUI scroll movement commands. # Created by Toni Sagrista from time import sleep from gaia.cu9.ari.gaiaorbit.script import EventScriptingInterface gs = EventScriptingInterface() gs.disableInput() gs.cameraStop() gs.setGuiScrollPosition(20.0) sleep(1) gs.setGuiScrollPosition(40.0) sleep(1) gs.setGuiScrollPosition(60.0) sleep(1) gs.setGuiScrollPosition(80.0) sleep(1) gs.setGuiScrollPosition(100.0) sleep(1) gs.enableInput()
# This is the tutorial script. # Most icons used in this script are from the Tango icon library (http://tango.freedesktop.org/) # Created by Toni Sagrista from __future__ import division from time import sleep from gaia.cu9.ari.gaiaorbit.script import EventScriptingInterface headerSize = 25 textSize = 13 twdelay = 0.01 arrowH = 7 gs = EventScriptingInterface() version = gs.getVersionNumber() """ Adds a small arrow to screen. id - The id of the arrow. x - x coordinate of bottom-left corner in pixels, from left to right. y - y coordinate of bottom-left corner in pixels, from bottom to top. args - optional, red, green, blue and alpha components of color. """ def arrow_small(id, x, y, *args): w = gs.getScreenWidth() h = gs.getScreenHeight()
# Test script. Tests GUI position commands. # Created by Toni Sagrista from time import sleep from gaia.cu9.ari.gaiaorbit.script import EventScriptingInterface gs = EventScriptingInterface() gs.disableInput() gs.cameraStop() gs.maximizeInterfaceWindow() gs.setGuiPosition(0, 0) sleep(1) gs.minimizeInterfaceWindow() gs.setGuiPosition(0, 0) sleep(1) gs.maximizeInterfaceWindow() gs.setGuiPosition(0.5, 0.5) sleep(1) gs.setGuiPosition(1, 1) sleep(1) gs.setGuiPosition(0, 1) gs.enableInput()
# Most icons used in this script are from the Tango icon library (http://tango.freedesktop.org/) # Created by Toni Sagrista from __future__ import division from time import sleep from gaia.cu9.ari.gaiaorbit.script import EventScriptingInterface headerSize = 25 textSize = 13 twdelay = 0.007 arrowH = 7 gs = EventScriptingInterface() version = gs.getVersionNumber() """ Prints a notice on the screen and waits for any input. y - y coordinate of the notice in [0..1], from bottom to top idsToRemove - List with the ids to remove when input is received. """ def wait_input(y, idsToRemove): waitid = 3634 gs.displayMessageObject(waitid, "Press any key to continue...", 0.6, y, 0.9, 0.9, 0.0, 1.0, 15) gs.waitForInput() gs.removeObjects(idsToRemove) gs.removeObject(waitid)
# Welcome script to be run asynchronously. # This script is executed when the GaiaSandbox is first started. # Created by Toni Sagrista from time import sleep from gaia.cu9.ari.gaiaorbit.script import EventScriptingInterface gs = EventScriptingInterface() # Disable input gs.disableInput() gs.cameraStop() gs.minimizeInterfaceWindow() # Welcome gs.setHeadlineMessage("Welcome to the Gaia Sandbox") gs.setSubheadMessage("Explore Gaia, the Solar System and the whole Galaxy!") sleep(2.5) # Earth gs.setHeadlineMessage("Earth") gs.setSubheadMessage("This is our planet, the Earth") gs.setCameraFocus("Earth") sleep(3.5) # Sun gs.setHeadlineMessage("Sun") gs.setSubheadMessage("This is our star, the Sun") gs.setCameraFocus("Sol")
# This script tests the displaying of custom messages and images. # Created by Toni Sagrista from time import sleep from gaia.cu9.ari.gaiaorbit.script import EventScriptingInterface gs = EventScriptingInterface() """ Prints a notice on the screen and waits for any input. y - y coordinate of the notice in [0..1], from bottom to top idsToRemove - List with the ids to remove when input is received. """ def wait_input(y, idsToRemove): waitid = 3634 gs.displayMessageObject(waitid, "Press any key to continue...", 0.6, y, 0.9, 0.9, 0.0, 1.0, 15) gs.waitForInput() gs.removeObjects(idsToRemove) gs.removeObject(waitid) """ Creates a typewriter effect where text appears one letter at a time. The parameter delay indicates the time in seconds between each letter. """
# This script tests the go-to commands. To be run asynchronously. # Created by Toni Sagrista from time import sleep from gaia.cu9.ari.gaiaorbit.script import EventScriptingInterface gs = EventScriptingInterface() gs.disableInput() gs.cameraStop() gs.minimizeInterfaceWindow() gs.setRotationCameraSpeed(20) gs.setTurningCameraSpeed(20) gs.setCameraSpeed(20) gs.goToObject("Sol", -1, 2.5) gs.setHeadlineMessage("Sun") gs.setSubheadMessage("This is the Sun, our star") gs.sleep(5) gs.clearAllMessages() gs.goToObject("Earth", -1, 2.5) gs.setHeadlineMessage("Earth") gs.setSubheadMessage("This is the Earth, our home") gs.sleep(5) gs.clearAllMessages()
# Most icons used in this script are from the Tango icon library (http://tango.freedesktop.org/) # Created by Toni Sagrista from __future__ import division from time import sleep from gaia.cu9.ari.gaiaorbit.script import EventScriptingInterface headerSize = 25 textSize = 13 twdelay = 0.01 arrowH = 7 gs = EventScriptingInterface() version = gs.getVersionNumber() """ Adds a small arrow to screen. id - The id of the arrow. x - x coordinate of bottom-left corner in pixels, from left to right. y - y coordinate of bottom-left corner in pixels, from bottom to top. args - optional, red, green, blue and alpha components of color. """ def arrow_small(id, x, y, *args): w = gs.getScreenWidth() h = gs.getScreenHeight()
# This script tests the displaying of custom messages and images. # Created by Toni Sagrista from time import sleep from gaia.cu9.ari.gaiaorbit.script import EventScriptingInterface gs = EventScriptingInterface() """ Prints a notice on the screen and waits for any input. y - y coordinate of the notice in [0..1], from bottom to top idsToRemove - List with the ids to remove when input is received. """ def wait_input(y, idsToRemove): waitid = 3634 gs.displayMessageObject(waitid, "Press any key to continue...", 0.6, y, 0.9, 0.9, 0.0, 1.0, 15) gs.waitForInput() gs.removeObjects(idsToRemove) gs.removeObject(waitid) """ Creates a typewriter effect where text appears one letter at a time. The parameter delay indicates the time in seconds between each letter. """ def typewriter(id, text, x, y, width, height, r, g, b, a, delay): buffer = "" gs.displayTextObject(id, "", x, y, width, height, r, g, b, a, textSize) for letter in text:
# This script tests the go-to commands. To be run asynchronously. # Created by Toni Sagrista from time import sleep from gaia.cu9.ari.gaiaorbit.script import EventScriptingInterface gs = EventScriptingInterface() gs.disableInput() gs.cameraStop() gs.minimizeInterfaceWindow() gs.goToObject("Sol") gs.setHeadlineMessage("Sun") gs.setSubheadMessage("This is the Sun, our star") sleep(5) gs.clearAllMessages() gs.goToObject("Earth") gs.setHeadlineMessage("Earth") gs.setSubheadMessage("This is the Earth, our home") sleep(5) gs.clearAllMessages() gs.setCameraFocus("Sol")
# This script tests the go-to and capture frame commands. To be run asynchronously. # Created by Toni Sagrista from time import sleep from gaia.cu9.ari.gaiaorbit.script import EventScriptingInterface gs = EventScriptingInterface() gs.disableInput() gs.cameraStop() gs.minimizeInterfaceWindow() gs.setRotationCameraSpeed(40) gs.setTurningCameraSpeed(30) gs.setCameraSpeed(30) gs.configureRenderOutput(1280, 720, 60, '/home/tsagrista/.gaiasky/frames', 'scripting-test') gs.setFrameOutput(True) gs.goToObject("Sol", -1, 2.5) gs.setHeadlineMessage("Sun") gs.setSubheadMessage("This is the Sun, our star") gs.sleepFrames(120) gs.clearAllMessages() gs.goToObject("Earth", -1, 2.5) gs.setHeadlineMessage("Earth")
# Test script. Tests GUI expand and collapse. # Created by Toni Sagrista from gaia.cu9.ari.gaiaorbit.script import EventScriptingInterface gs = EventScriptingInterface.instance() gs.disableInput() gs.cameraStop() gs.maximizeInterfaceWindow() gs.sleep(1) gs.expandGuiComponent("CameraComponent") gs.sleep(1) gs.expandGuiComponent("VisibilityComponent") gs.sleep(1) gs.collapseGuiComponent("CameraComponent") gs.sleep(1) gs.collapseGuiComponent("VisibilityComponent") gs.sleep(1) gs.enableInput()
# This is the tutorial script. # Most icons used in this script are from the Tango icon library (http://tango.freedesktop.org/) # Created by Toni Sagrista from __future__ import division from time import sleep from gaia.cu9.ari.gaiaorbit.script import EventScriptingInterface headerSize = 25 textSize = 13 twdelay = 0.01 arrowH = 7 gs = EventScriptingInterface() version = gs.getVersionNumber() """ Prints a notice on the screen and waits for any input. y - y coordinate of the notice in [0..1], from bottom to top idsToRemove - List with the ids to remove when input is received. """ def wait_input(y, idsToRemove): waitid = 3634 gs.displayMessageObject(waitid, "Press any key to continue...", 0.6, y, 0.9, 0.9, 0.0, 1.0, 15) gs.waitForInput()
# This script tests the displaying of custom messages and images. # Created by Toni Sagrista from time import sleep from gaia.cu9.ari.gaiaorbit.script import EventScriptingInterface gs = EventScriptingInterface() # Minimize interface, disable input, stop camera gs.disableInput() gs.cameraStop() gs.minimizeInterfaceWindow() # Add messages gs.displayMessageObject(0, "This is the zero message", 0.2, 0.0, 1.0, 0.0, 0.0, 8) sleep(1.5) gs.displayMessageObject(1, "This is the first message", 0.2, 0.2, 0.3, 0.4, 0.6, 10) sleep(1.5) gs.displayMessageObject(2, "This is the second message", 0.3, 0.1, 0.0, 1.0, 0.0, 11) sleep(1.5) gs.displayImageObject(10, "scripts/customobjects-test/profile.png", 0.1, 0.7) gs.displayMessageObject(3, "Monkey!", 0.7, 0.62, 0.9, 0.0, 1.0, 18) sleep(1.5) gs.displayMessageObject(4, "This is the fourth message", 0.4, 0.6, 1.0, 1.0, 0.0, 17) sleep(1.5) gs.displayMessageObject(5, "This is the fifth message", 0.5, 0.8, 1.0, 0.0, 1.0, 22)