wiki:HTMLGfx

Version 6 (modified by romw, 10 years ago) (diff)

--

TOC?

Introduction

HTML and JavaScript have become the predominate rendering technologies on the web. Used for everything from web browsing to mobile phone applications. HTMLGfx attempts to bring HTML rendering technologies into the BOINC graphics and screensaver environment.

By providing precompiled binaries the barrier to entry is greatly reduced allowing projects to deploy customized graphics for their applications. All projects would need to supply is the HTML/CSS/JavaScript required to display something about what is going on with the currently executing job.

In theory, volunteers could even get in on the act and create graphics for whatever applications suit their interests and share them with the community. It is conceivable that projects may even hold yearly competitions to include a volunteers graphics bundle to be deployed with the project's application.

Currently HTMLGfx is only supported on Windows at this time.

References: Making graphics applications for BOINC

System Overview

HTMLGfx leverages existing operating system dependent libraries for rendering HTML. By leveraging the operating systems HTML renderer HTMLGfx will be able to support whatever the latest technologies the operating systems browser supports.

Design Considerations

Assumptions and Dependencies

General Constraints

Goals and Guidelines

Development Methods

Detailed System Design

Configuration File

The graphics description file has the logical name of boinc_graphics.xml (its physical name should include a version number and other info). It has following structure:

<boinc_graphics>
    [ <default_url>filename</default_url> ]
    [ <running_url>filename</running_url> ]
    [ <suspended_url>filename</suspended_url> ]
    [ <network_suspended_url>filename</network_suspended_url> ]
    [ <exiting_url>filename</exiting_url> ]
</boinc_graphics>

Optional elements:

default_url
document to display if no state specific URL is defined.
running_url
document to display while the task is running.
suspended_url
document to display while the task is suspended.
network_suspended_url
document to display while the network is suspended.
exiting_url
document to display before the task exits in 5 seconds or less.

Graphics Status File

The graphics status file has the name of boinc_graphics_status.xml.

It is read once a second and is generally managed via the worker application via the boinc_write_graphics_status() BOINC API.

It has following structure:

<graphics_status>
    <updated_time>X</updated_time>
    <cpu_time>X</cpu_time>
    <elapsed_time>X</elapsed_time>
    <fraction_done>X</fraction_done>
    <boinc_status>
        <no_heartbeat>0|1</no_heartbeat>
        <suspended>0|1</suspended>
        <quit_request>0|1</quit_request>
        <reread_init_data_file>0|1</reread_init_data_file>
        <abort_request>0|1</abort_request>
        <network_suspended>0|1</network_suspended>
    </boinc_status>
</graphics_status>

Required elements:

updated_time
UNIX time of the last time this file was updated.
cpu_time
Amount of CPU time this task has consumed, in seconds.
elapsed_time
Amount of wall clock time this task has consumed, in seconds.
fraction_done
What percentage of the overall task is complete, values between 0..1.
no_heartbeat
Whether or not the task has received a heartbeat as of the last update.
suspended
Whether or not the task is suspended.
quit_request
Whether or not the task has been requested to exit.
reread_init_data_file
Whether or not the task should reread all initialization data.
abort_request
Whether or not the task has been requested to abort.
network_suspended
Whether or not the task has been told the network has been suspended.

Vboxwrapper WebAPI Port

Reference: vbox_webapi.xml

Vboxwrapper Remote Desktop Port

Reference: vbox_remote_desktop.xml

JavaScript Extension on Windows

Currently HTMLGfx can pass information to the HTML DOM via the 'window.external' extension.

Methods

Name Returns Description
IsAppInitDataUpdated Boolean Informs the HTML document to refresh all the UI state information
IsScreensaver Boolean Was the graphics application launched in screensaver mode
IsSuspended Boolean Whether the task is currently suspended
IsNetworkSuspended Boolean Should the UI suspend Internet activity
IsExiting Boolean Should the UI prepare to exit
IsVboxwrapperJob Boolean Is this task a vboxwrapper task?
SetAppInitDataUpdate void Sets the Boolean value to the specified input

Properties

Name Data Type Description
ApplicationName string
ApplicationVersion long
WorkunitName string
ResultName string
TeamName string
UserName string
UserCreditTotal float
UserCreditAverage float
HostCreditTotal float
HostCreditAverage float
ExitCountdown float
CPUTime float
ElapsedTime float
FractionDone float
RemoteDesktopPort long
WebAPIPort long

Examples

Example of refreshing the state of various controls:

    refresh() {
        if (window.external.IsAppInitDataUpdated()) {
            window.external.SetAppInitDataUpdate(false);
            username = window.external.UserName;
            teamname = window.external.TeamName;
        }
        fractiondone = window.external.FractionDone;
    }