Class ScriptRunner
Inheritance
Namespace: Sensus.Probes.User.Scripts
Assembly: SensusAndroid.dll
Syntax
public class ScriptRunner : Object, INotifyPropertyChanged, IScriptRunner
Constructors
ScriptRunner(String, ScriptProbe)
Declaration
public ScriptRunner(string name, ScriptProbe probe)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | |
ScriptProbe | probe |
Properties
AllowCancel
Whether or not the user should be allowed to cancel the survey after starting it.
Declaration
[OnOffUiProperty("Allow Cancel:", true, 3)]
public bool AllowCancel { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Caption
Declaration
public string Caption { get; }
Property Value
Type | Description |
---|---|
System.String |
CompletionTimes
Declaration
public List<DateTime> CompletionTimes { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<System.DateTime> |
DelayToleranceAfterMS
Tolerance in milliseconds for running the Script after the scheduled time, if doing so will increase the number of batched actions and thereby decrease battery consumption.
Declaration
[EntryIntegerUiProperty("Delay Tolerance After (MS):", true, 20, true)]
public int DelayToleranceAfterMS { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The delay tolerance before. |
DelayToleranceBeforeMS
Tolerance in milliseconds for running the Script before the scheduled time, if doing so will increase the number of batched actions and thereby decrease battery consumption.
Declaration
[EntryIntegerUiProperty("Delay Tolerance Before (MS):", true, 19, true)]
public int DelayToleranceBeforeMS { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The delay tolerance before. |
DisplayProgress
Whether or not to display progress (% complete) to the user when they are working on the survey.
Declaration
[OnOffUiProperty("Display Progress:", true, 13)]
public bool DisplayProgress { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Enabled
Whether or not the survey is enabled.
Declaration
[OnOffUiProperty("Enabled:", true, 2)]
public bool Enabled { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
ForceRemoteStorageOnSurveySubmission
Whether or not to force a local-to-remote transfer to run each time this survey is submitted by the user.
Declaration
[OnOffUiProperty("Force Remote Storage On Submission:", true, 18)]
public bool ForceRemoteStorageOnSurveySubmission { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
FutureRunCount
Gets the number of future runs that are currently scheduled.
Declaration
public int FutureRunCount { get; }
Property Value
Type | Description |
---|---|
System.Int32 | The future run count. |
IncompleteSubmissionConfirmation
The message to display to the user if a required field is invalid.
Declaration
[EntryStringUiProperty("Incomplete Submission Confirmation:", true, 15, false)]
public string IncompleteSubmissionConfirmation { get; set; }
Property Value
Type | Description |
---|---|
System.String | The incomplete submission confirmation. |
IScript
Gets the IScript that this IScriptRunner is configured to run (for NuGet interfacing).
Declaration
public IScript IScript { get; }
Property Value
Type | Description |
---|---|
IScript | The script. |
MaxAgeMinutes
The maximum number of minutes, following delivery to the user, that this survey should remain available for completion.
Declaration
[EntryDoubleUiProperty("Maximum Age (Mins.):", true, 7, false)]
public Nullable<double> MaxAgeMinutes { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Double> | The max age minutes. |
Name
Name of the survey. If you would like to use the value of a
survey-triggering CurrentDatum within the survey's name, you can do so
by placing a {0}
within Name as a placeholder. The placeholder will be replaced with
the value of the triggering Datum at runtime. You can read more about the format of the
placeholder here.
Declaration
[EntryStringUiProperty("Name:", true, 1, true)]
public string Name { get; set; }
Property Value
Type | Description |
---|---|
System.String | The name. |
NonDowTriggerIntervalDays
For surveys that are not associated with a specific day of the week, this field indicates how
many days to should pass between subsequent surveys. For example, if this is set to 1 and
TriggerWindowsString is set to 9:00-10:00
, then the survey would be fired each
day at some time between 9am and 10am. If this field were set to 2, then the survey would be
fired every other day at some time between 9am and 10am.
Declaration
[EntryIntegerUiProperty("Non-DOW Trigger Interval (Days):", true, 9, true)]
public int NonDowTriggerIntervalDays { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The non-DOW trigger interval days. |
OneShot
Whether or not to run the survey exactly once.
Declaration
[OnOffUiProperty("One Shot:", true, 10)]
public bool OneShot { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Probe
Gets or sets the probe.
Declaration
public ScriptProbe Probe { get; set; }
Property Value
Type | Description |
---|---|
ScriptProbe | The probe. |
RunMode
How to handle multiple instances of the survey. Options are Multiple, SingleKeepNewest, and SingleKeepOldest.
Declaration
[ListUiProperty]
public RunMode RunMode { get; set; }
Property Value
Type | Description |
---|---|
RunMode | The run mode. |
RunOnStart
Whether or not to run the survey immediately upon starting the Protocol.
Declaration
[OnOffUiProperty("Run On Start:", true, 11)]
public bool RunOnStart { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
RunTimes
Declaration
public List<DateTime> RunTimes { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<System.DateTime> |
ScheduledCallbackDescriptions
Gets readable descriptions for the scheduled callbacks.
Declaration
public List<string> ScheduledCallbackDescriptions { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<System.String> | The scheduled callback descriptions. |
ScheduleTriggerReadableDescription
Declaration
public string ScheduleTriggerReadableDescription { get; }
Property Value
Type | Description |
---|---|
System.String |
Script
Gets or sets the script.
Declaration
public Script Script { get; set; }
Property Value
Type | Description |
---|---|
Script | The script. |
ShuffleInputGroups
Whether or not to shuffle the order of the survey's InputGroups prior to displaying them to the user. This only applies if none of the groups contain Inputs with display conditions. If display conditions are present, then it is not possible to shuffle the InputGroups and this setting will have no effect.
Declaration
[OnOffUiProperty("Shuffle Input Groups:", true, 16)]
public bool ShuffleInputGroups { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Triggers
Declaration
public ConcurrentObservableCollection<Trigger> Triggers { get; }
Property Value
Type | Description |
---|---|
ConcurrentObservableCollection<Trigger> |
TriggerWindowsString
A comma-separated list of times at (in the case of exact times) or during (in the case of time windows) which the survey should be delievered. For example, if you want the survey to be delivered twice per day, once randomly between 9am-10am (e.g., 9:32am) and once randomly between 1pm-2pm (e.g., 1:56pm), then you would enter the following into this field:
9:00-10:00,13:00-14:00
Note that the survey will be deployed at a random time during each future window (e.g., 9:32am and 1:56pm on day 1, 9:57am and 1:28pm on day 2, etc.). Alternatively, you may specify an exact time as follows:
9:00-10:00,11:32,13:00-14:00
The survey thus configured will also fire exactly at 11:32am each day. See NonDowTriggerIntervalDays for how to put additional days between each survey.
If you want the survey to be fired on particular days of the week, you can prepend the day of week ("Su", "Mo", "Tu", "We", "Th", "Fr", "Sa") to the time as follows:
9:00-10:00,Su-11:32,13:00-14:00
In contrast to the previous example, this one would would only fire at 11:32am on Sundays.
Declaration
[EntryStringUiProperty("Trigger Windows:", true, 8, false)]
public string TriggerWindowsString { get; set; }
Property Value
Type | Description |
---|---|
System.String | The trigger windows string. |
UseTriggerDatumTimestampInSubcaption
Whether or not to use the triggering Timestamp within the subcaption text displayed for surveys deployed by this ScriptRunner. This is important in scenarios where Birthdate differs from Timestamp (e.g., as is the case in iOS where readings collected by the activity probe lag by several minutes).
Declaration
[OnOffUiProperty("Use Trigger Timestamp In Subcaption:", true, 17)]
public bool UseTriggerDatumTimestampInSubcaption { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
WindowExpiration
Whether or not the survey should be removed from availability when the survey's window ends. See TriggerWindowsString for more information.
Declaration
[OnOffUiProperty("Expire Script When Window Ends:", true, 15)]
public bool WindowExpiration { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Methods
InitializeAsync()
Declaration
public Task InitializeAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
ResetAsync()
Declaration
public Task ResetAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
RestartAsync()
Declaration
public Task RestartAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
RunAsync(Script, Datum, Datum)
Declaration
public Task RunAsync(Script script, Datum previousDatum = null, Datum currentDatum = null)
Parameters
Type | Name | Description |
---|---|---|
Script | script | |
Datum | previousDatum | |
Datum | currentDatum |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
ScheduleScriptRunsAsync()
Declaration
public Task ScheduleScriptRunsAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
StartAsync()
Declaration
public Task StartAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
StopAsync()
Declaration
public Task StopAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
Events
PropertyChanged
Declaration
public event PropertyChangedEventHandler PropertyChanged
Event Type
Type | Description |
---|---|
System.ComponentModel.PropertyChangedEventHandler |