The Model-controller interface describes the functions and classes that you can use to interact with the GridBee Framework. Using this interface you can create custom graphical user interfaces that handle user input, connect to boinc servers, and display data relevant to work execution.
Client model interface
The Client object offers the following interface functions to interact with.
setThreadNumber (n : Int) : Void
n The number of threads to enable.
Sets the number of enabled threads. If more threads are in progress, excess threads will be paused.
getThreadNumber () : Int
Returns the number of threads the framework attempts to start.
start () : Void
Enables work execution.
stop () : Void
Disables work execution.
addWorksource (worksource : WorkSource) : Void
worksource The worksource to be added to the pool.
removeWorksource (worksource : WorkSource) : Void
worksource The worksource to be removed.
getWorksources () : Array<WorkSource>
Returns an array of the current worksources in the WorkSourcePool.
WorkSource model interface
getWorkunits () : Array<WorkUnit>
onAddWorkunit : Event<WorkUnit>
onRemoveWorkunit : Event<WorkUnit>
BoincWorkSource model interface
BoincWorkSource (scheduler : String, authkey : String)
scheduler The address of the scheduler script. authkey The authkey identifying the user.
Constructor, that creates a new BoincWorkSource using the address of the BOINC scheduler and the authkey of the user.
var bws = new BoincWorkSource("http://example.com/project_cgi/cgi", "2962b0b8974c4ca693d253da648724cd"); myClient.addWorkSource(bws);
getSchedulerUrl () : String
Returns the Scheduler's URL.
getAuthkey () : String
Return the user's authkey.
These variables are persisted. Your GUI can use them to store and restore them when the framework is closed and reopened.
projecturl : String
The URL of the BOINC project.
projectname : String
The name of the project.
username : String
The BOINC username.
WorkUnit model interface
getProgress () : Float
Returns the last reported progress of the workunit represented by a float between 0 and 1.0.
getStatusString () : String
Returns a String describing the status of the WorkUnit ie. 'Active' or 'Passive'.
onProgressChange : Event<Void>;
Calls its subscribed functions when a WorkUnit reports progress change. Use the subscribe() member function to specify callbacks.
onStatusChange : Event<Void>;
Calls its subscribed functions when a WorkUnit's status changes.
Calls its subscribed functions when a WorkUnit creates sends a logmessage.