mindaptiv / Saul

Grabs system and user information in an Android context.
MIT License
1 stars 0 forks source link

Re-evaluate Virtual Devices #35

Open Scrubsauce opened 9 years ago

Scrubsauce commented 9 years ago

Determine if their retrieval and storage is necessary during testing.

Simulacrum0 commented 9 years ago

If its helpful as a reference, this is the code spec used to map devices based on 'features' that produce 'deed-events', such as buttons and buttonpress. It might be helpful, might be confusing? Just any fyi-

Each Ctrl (device controller ) is a collection of Src ( deed sources ) that are reported using one or more Pkg ( controller packages ). Ctrl get mapped to 'intents' using Pkg. Intents are groups by 'Skillz' to map to various 'Choices' which are references to state (slow,fast, destination value, amount increase) and Q-Code.

//===================================== // //===================================== Qual_Dsc__Begin( Ctrl, Src, "Control Source", "Types of control features such as buttons, sticks, and gestures.^ai_SiHua", "^ai_ShHua" ) { //@@@ // Synthetic Dsc_Add( Ctrl_Src, Synth, "Synthetic", "No source trait used, just data created.^ai_SiHua", "^ai_ShHua" )

//@@@
//Raw
Dsc_Add( Ctrl_Src, Btn, "Button", "An 'amount-pressed' value (perhaps a sensor w/ 1dimensional range ).^ai_SiHua", "^ai_ShHua" )
Dsc_Add( Ctrl_Src, Loc, "Axis",  "Absolute location (joystick, slider, GPS, touch location).^ai_SiHua", "^ai_ShHua" )
Dsc_Add( Ctrl_Src, Mot, "Motion",  "Relative movement (mouse movement, motion sensor, trackball, headtracker, touch movement ).^ai_SiHua", "^ai_ShHua" )
Dsc_Add( Ctrl_Src, Dir, "Direction",  "Absolute Orientation in space.^ai_SiHua", "^ai_ShHua" )
Dsc_Add( Ctrl_Src, Rot, "Rotation",  "Relative turning relative to previous orientation.^ai_SiHua", "^ai_ShHua" )

//@@@
//Post-processed
Dsc_Add( Ctrl_Src, Gest, "Gesture", "Detected pattern.^ai_SiHua", "^ai_ShHua" )
Dsc_Add( Ctrl_Src, Sig, "Signal", "EEG, Digital_Camera, Microphone, or other sensors.^ai_SiHua", "^ai_ShHua" )
Dsc_Add( Ctrl_Src, Txt, "Text", "Typed or voice-recognized word(s).^ai_SiHua", "^ai_ShHua" )

Dsc_Add( Ctrl_Src, Alt, "Alternate", "Reserved for future use.^ai_SiHua", "^ai_ShHua" )

} Qual_Dsc__End( Ctrl, Src )

//===================================== // //===================================== Qual_Dsc__Begin( Ctrl, Modifier, "Control Modifier State", "Describes a state that affects the output value according to the modifier.^ai_SiHua", "^ai_ShHua" ) { Dsc_Add( Ctrl_Modifier, None, "None", "No Modifier used.^ai_SiHua", "^ai_ShHua" ) Dsc_Add( Ctrl_Modifier, Neg, "Reversed", "This intent replaces the incoming value with a specific 'unit' of value.^ai_SiHua", "^ai_ShHua" ) Dsc_Add( Ctrl_Modifier, Fast, "Faster", "This intent affects other intents that are affected by the 'fast' modifier, which is useful to add analog variety to discrete on/off features like button presses.^ai_SiHua", "^ai_ShHua" ) Dsc_Add( Ctrl_Modifier, Slow, "Slower", "This intent affects other intents that are affected by the 'slow' modifier, which is useful to add analog variety to discrete on/off features like button presses.^ai_SiHua", "^ai_ShHua" )

Dsc_Cnt( Ctrl_Modifier )
Priv_Add__Wrt( Ctrl_Modifier, Factor_Min, 2 )

} Qual_Dsc__End( Ctrl, Modifier )

//===================================== // //===================================== Qual_Dsc__Begin( Ctrl, Opt, "Control Option State", "Allows this intent to combine with other intents to form optional states which allows stacking of functionality on a single trait.^ai_SiHua", "^ai_ShHua" ) { Dsc_Add( Ctrl_Opt, Std, "Standard Controls", "No special options used.^ai_SiHua", "^ai_ShHua" ) Dsc_Add( Ctrl_Opt, Advanced, "Advanced Options", "Advanced options, generally combining multiple traits for superior control.^ai_SiHua", "^ai_ShHua" ) Dsc_Add( Ctrl_Opt, Expert, "Expert Options", "Expert options, often enabling complex combinations.^ai_SiHua", "^ai_ShHua" ) Dsc_Add( Ctrl_Opt, Elite, "Elite Options", "Elite options, often involving trickier hand placements.^ai_SiHua", "^ai_ShHua" )

Dsc_Add( Ctrl_Opt, Combo_A, "Combination A Options", "Additional options provided for complicated patterns.^ai_SiHua", "^ai_ShHua" )
Dsc_Add( Ctrl_Opt, Combo_B, "Combination B Options", "Additional options provided for complicated patterns.^ai_SiHua", "^ai_ShHua" )
Dsc_Add( Ctrl_Opt, Combo_C, "Combination C Options", "Additional options provided for complicated patterns.^ai_SiHua", "^ai_ShHua" )
Dsc_Add( Ctrl_Opt, Combo_D, "Combination D Options", "Additional options provided for complicated patterns.^ai_SiHua", "^ai_ShHua" )

} Qual_Dsc__End( Ctrl, Opt )

//===================================== // //===================================== Qual_Dsc__Begin( Ctrl, Deedevt, "Control Deed State", "Possible states that a control feature is in.^ai_SiHua", "^ai_ShHua" ) { Dsc_Add( Ctrl_Deedevt, Idle, "Idle", "Triggered when inactive for a given duration.^ai_SiHua", "^ai_ShHua" ) Dsc_Add( Ctrl_Deedevt, Begin, "Press", "Press.^ai_SiHua", "^ai_ShHua" ) Dsc_Add( Ctrl_Deedevt, Active, "Active", "After initial press, this control feature is actively held.^ai_SiHua", "^ai_ShHua" ) Dsc_Add( Ctrl_Deedevt, Chg, "Changing", "Only trigger this deed when values are changing and this trait is active ( not returning to the idle state ).^ai_SiHua", "^ai_ShHua" )

Dsc_Add( Ctrl_Deedevt, End, "Release", "Letting go of the button, lifting the finger or returning the stick to the deadzone position.^ai_SiHua", "^ai_ShHua" )
Dsc_Add( Ctrl_Deedevt, Tap1x, "Single Tap", "Generally a single activate and deactivate'.^ai_SiHua", "^ai_ShHua" )
Dsc_Add( Ctrl_Deedevt, Tap2x, "Double Tap", "Generally a rapid 'double activate/deactivate'.^ai_SiHua", "^ai_ShHua" )

Dsc_Add( Ctrl_Deedevt, Noreply, "No Response", "Device is not replying with updates per an agreed schedule or via request'.^ai_SiHua", "^ai_ShHua" ) } Qual_Dsc__End( Ctrl, Deedevt )

//===================================== // //===================================== Mask_Begin( Ctrl_State ) { Mask_Add__Yes( State, Active, 0 ) Mask_AddYes( State, Upd_Chg, 1 ) Mask_AddYes( State, Idle, 2 )

Mask_Add__Yes( State, Prv_Tap1x, 3 )
Mask_Add__Yes( State, Cur_Tap1x, 4 )
Mask_Add__Yes( State, Cur_Tap2x, 5 )

Mask_Add__Yes( State, Begin_Active, 6 )
Mask_Add__Yes( State, End_Active, 7 )

} Mask_End( Ctrl_State )

//===================================== // //===================================== Ida_Begin( Ctrl, State, "Control State", "State that a control feature is in.^ai_SiHua", "^ai_ShHua" ) { Ida_Hasa__U( Upd, "State Update ID", "How many updates have been taken of this state.^ai_SiHua", "^ai_ShHua" )

Ida_Reserve__Uq( State )
Ida_Bits__Yes2( 0, "Active", "Are we active^ai_SiHua", "^ai_ShHua" )
Ida_Bits__Yes2( 1, "Upd_Chg", "Have we made changes to the state.^ai_SiHua", "^ai_ShHua" )
Ida_Bits__Yes2( 2, "Idle", "We are not active nor changing from the previous state nor has a single press occurred that could lead to a double.^ai_SiHua", "^ai_ShHua" )

Ida_Bits__Yes2( 3, "Prv_Tap1x", "If this is yes, then there was previously a press and release which could now lead to a double press.^ai_SiHua", "^ai_ShHua" )

Ida_Bits__Yes2( 4, "Cur_Tap1x", "If this is yes, then we just single tapped a press and release which could now lead to a double press.^ai_SiHua", "^ai_ShHua" )
Ida_Bits__Yes2( 5, "Cur_Tap2x", "If this is yes, then we just 'double tapped' by being active and then not active inside the threshold.^ai_SiHua", "^ai_ShHua" )

Ida_Bits__Yes2( 6, "Begin_Active", "Are we active now but not previously.^ai_SiHua", "^ai_ShHua" )
Ida_Bits__Yes2( 7, "End_Active", "Are we no longer active but we previously were.^ai_SiHua", "^ai_ShHua" )

Ida_Hasa__F( Threshold, "Detection Threshold", "What level of change is not considered a trigger for the active threshold.^ai_SiHua", "^ai_ShHua" )
Ida_Hasa__Time_Msec( Duration, "Duration", "How long was this choice made prior to this Choice being issued.^ai_SiHua", "^ai_ShHua" )

Ida_Hasa__Fn4( Val, "State Value", "What is the current raw control state.^ai_SiHua", "^ai_ShHua" )
Ida_Hasa__Fn4( Chg, "State Change", "What is the change in raw control state from the previous deed.^ai_SiHua", "^ai_ShHua" )

} Ida_End( Ctrl, State )

//===================================== // //===================================== Mask_Begin( Ctrl__Trait_Cfg ) { Mask_Add( Trait_Cfg, Pkg, 0, 8 ) Mask_Add( Trait_Cfg, Src, 8, 6 )

Mask_Add( Trait_Cfg, Dim_Cnt, 14, 2 )

Mask_Add__Yes( Trait_Cfg, Unit, 16 )
Mask_Add__Yes( Trait_Cfg, Signed, 17 )
Mask_Add__Yes( Trait_Cfg, Discrete, 18 )
Mask_Add__Yes( Trait_Cfg, Alt, 19 )

//Defaults
Mask_Add( Trait_Cfg, Default__Skillmode, 24, 5 )
Mask_Add( Trait_Cfg, Default__Activity_Dir, 29, 3 )

} Mask_End( Ctrl__Trait_Cfg )

//===================================== // //===================================== Ida_Begin( Ctrl, Trait_Match, "Trait_Match", "Describes how to match a device trait, also called a feature.^ai_SiHua", "^ai_ShHua" ) { Ida_ReserveUq( Trait_Cfg ) Ida_BitsDsc2( 0, "Pkg", "Controller Package is used to match this trait to another device's trait when the expected device is not present.^ai_SiHua", "^ai_ShHua", Ctrl, Pkg ) Ida_Bits__Dsc2( 8, "Src", "What is the source of this feature.^ai_SiHua", "^ai_ShHua", Ctrl, Src )

Ida_Bits__Dsc2( 14, "Dim_Cnt", "How many dimensions of data does this feature return...between 1 and 4.^ai_SiHua", "^ai_ShHua",  Nmb, Dim )
Ida_Bits__Yes2( 16, "Unit", "Is this unit data or real values.^ai_SiHua", "^ai_ShHua" )
Ida_Bits__Yes2( 17, "Signed", "Is this signed data normalized into -1 to 1 or just 0...1.^ai_SiHua", "^ai_ShHua" )
Ida_Bits__Yes2( 18, "Discrete", "Is this an on or off discrete value.^ai_SiHua", "^ai_ShHua" )
Ida_Bits__Yes2( 19, "Alt", "Is this trait intended to use the alternate hand, such as left or right.^ai_SiHua", "^ai_ShHua" )

Ida_Bits__Dsc2( 24, "Default__Skillmode", "What is the default activity map used by this trait.  Helps to suggest an assignement.^ai_SiHua", "^ai_ShHua",  Ctrl, Skillmode )
Ida_Bits__Dsc2( 29, "Src_Neg__Choiceaxisdir", "Into which activity choice direction do negative results go.^ai_SiHua", "^ai_ShHua", Nmb, Axisdir )

Ida_Hasa__Su( Dev_Trait__Idx, "Device's Trait Index", "Trait index value on this device model.^ai_SiHua", "^ai_ShHua" )
Ida_Hasa__Su( Src_Idx, "Source Index", "Source index for all buttons or locations or other match-able control sources on the device model.^ai_SiHua", "^ai_ShHua" )

} Ida_End( Ctrl, Trait_Match )

//===================================== // //===================================== Ida_Begin( Ctrl, Trait, "Trait", "Describes a device feature and a means of portraying its use.^ai_SiHua", "^ai_ShHua" ) { Ida_Hasa__Subida( State, "State", "What is the current state of raw device values for this trait.^ai_SiHua", "^ai_ShHua", Ctrl, State ) Ida_Hasa__Subida( Trait_Match, "Trait_Match", "How to match this trait to existing device capabilities.^ai_SiHua", "^ai_ShHua", Ctrl, Trait_Match )

Ida_Hasa__Dphrs( Name, "Name", "Name of this feature or text word to match.^ai_SiHua", "^ai_ShHua" )
Ida_Hasa__Seq( Art, "Art", "What this feature looks like and where it is located on the device.^ai_SiHua", "^ai_ShHua", Art, Unit )

Ida_Hasa__Frm( Hist, "History", "Where we output the raw values for a history view of this feature.^ai_SiHua", "^ai_ShHua", Nmb_Smp, Loc_Siz )

} Ida_End( Ctrl, Trait )

//===================================== // //===================================== Ida_Begin( Ctrl, Deed, "Control Deed", "The results of a Control State being processed into an 'intent' with a given intensity. A thinking action or a control device feature made a choice with a specific amount.^ai_SiHua", "^ai_ShHua" ) { Ida_Hasa__F4( Effort, "Effort", "How strongly was this choice made.^ai_SiHua", "^ai_ShHua" ) } Ida_End( Ctrl, Deed )

//===================================== // //===================================== Ida_Begin( Ctrl, Ramp, "Intent Ramp", "How the input curve ramps up to provide values as needed.^ai_SiHua", "^ai_ShHua" ) { Ida_HasaBa2( Lo, "Ramp Begin", "A input ramp that marks the lower part of the spline.^ai_SiHua", "^ai_ShHua" ) Ida_Hasa__Ba2( Midlo, "Ramp Early", "A input ramp that marks the middle-low part of the spline.^ai_SiHua", "^ai_ShHua" ) Ida_HasaBa2( Midhi, "Ramp Late", "A input ramp that marks the middle-high part of the spline.^ai_SiHua", "^ai_ShHua" ) Ida_Hasa__Ba2( Hi, "Ramp End", "A input ramp that marks the upper part of the spline.^ai_SiHua", "^ai_ShHua" )

Ida_Hasa__Time_Msec( Wait_Trigger, "Waiting Trigger", "How long does it take to trigger this intent, either in idle-waiting or active deed pending state.^ai_SiHua", "^ai_ShHua" )
Ida_Hasa__Time_Msec( Envelope_Duration, "Envelope Duration", "If this value exists it indicates using the duration active instead of the effort to sample the ramp.  Can be used to create Attack-Sustain-Decay-Release (ASDR) envelopes or smooth ramps for discrete inputs like buttons.^ai_SiHua", "^ai_ShHua" )

} Ida_End( Ctrl, Ramp )

//===================================== // //===================================== Mask_Begin( Ctrlcnd ) { Mask_Add( Ctrlcnd, Deedevt, 0, 3 )

Mask_Add( Ctrlcnd, Is_Modifier, 4, 2 )
Mask_Add__Yes( Ctrlcnd, Use_Modifiers, 6 )

Mask_Add( Ctrlcnd, Is_Opt, 7, 2 )
Mask_Add( Ctrlcnd, Need_Opt, 9, 3 )

Mask_Add( Ctrlcnd, State_Dim, 12, 2 )

Mask_Add__Yes( Ctrlcnd, Src_Pos__Use, 14 )
Mask_Add( Ctrlcnd, Src_Pos__Skillmode, 15, 5 )
Mask_Add( Ctrlcnd, Src_Pos__Choiceaxisdir, 20, 3 )

Mask_Add__Yes( Ctrlcnd, Src_Neg__Use, 23 )
Mask_Add( Ctrlcnd, Src_Neg__Skillmode, 24, 5 )
Mask_Add( Ctrlcnd, Src_Neg__Choiceaxisdir, 29, 3 )

} Mask_End( Ctrlcnd )

//===================================== // //===================================== Ida_Begin( Ctrl, Intent, " Intent", "Maps a combination of device features to a choice they represents (activity, dimension, scale of amount, and modifiers).^ai_SiHua", "^ai_ShHua" ) { Ida_Hasa__Fct( Trait, "Trait", "Which device and feature of said device encapsulates this intent.^ai_SiHua", "^ai_ShHua", Ctrl, Trait ) Ida_Hasa__Fct( Ramp, "Ramp", "how does the input ramp of these values change.^ai_SiHua", "^ai_ShHua", Ctrl, Ramp )

Ida_Reserve__Uq( Ctrlcnd )
Ida_Bits__Dsc2( 0, "Deedevt", "What stream event must occur to activate this intent.^ai_SiHua", "^ai_ShHua", Ctrl, Deedevt )

Ida_Bits__Dsc2( 4, "Is_Modifier", "Does this intent solely act as the modifier to affect others intents?^ai_SiHua", "^ai_ShHua", Ctrl, Modifier )
Ida_Bits__Yes2( 6, "Use_Modifiers", "Is this intent only triggered if another modifier is active.^ai_SiHua", "^ai_ShHua" )

Ida_Bits__Dsc2( 7, "Is_Opt", "Does this intent solely act as an option to trigger others intents?^ai_SiHua", "^ai_ShHua", Ctrl, Opt )
Ida_Bits__Dsc2( 9, "Need_Opt", "Does this intent require an option.^ai_SiHua", "^ai_ShHua", Ctrl, Opt )

Ida_Bits__Dsc2( 12, "State_Dim", "From which state dimension does this intent gain its value.^ai_SiHua", "^ai_ShHua", Nmb, Dim )

Ida_Bits__Yes2( 14, "Src_Pos__Use", "Indicates if we use positive results from the source dimension.^ai_SiHua", "^ai_ShHua" )
Ida_Bits__Dsc2( 15, "Src_Pos__Skillmode", "What is the source of this feature for positive results.^ai_SiHua", "^ai_ShHua", Ctrl, Skillmode )
Ida_Bits__Dsc2( 20, "Src_Pos__Choiceaxisdir", "Into which activity choice direction do positive results go.^ai_SiHua", "^ai_ShHua", Nmb, Axisdir )

Ida_Bits__Yes2( 23, "Src_Neg__Use", "Indicates if we use positive results from the source dimension.^ai_SiHua", "^ai_ShHua" )
Ida_Bits__Dsc2( 24, "Src_Neg__Skillmode", "What is the source of this feature for positive results.^ai_SiHua", "^ai_ShHua", Ctrl, Skillmode )
Ida_Bits__Dsc2( 29, "Src_Neg__Choiceaxisdir", "Into which activity choice direction do negative results go.^ai_SiHua", "^ai_ShHua", Nmb, Axisdir )

Ida_Hasa__Subida( Trait_Match, "Trait_Match", "How to match this trait to intents.^ai_SiHua", "^ai_ShHua", Ctrl, Trait_Match )

Ida_Hasa__Su( Dev__Ctrl__Idx, "Device Index", "Helps to match our user intent to a particular device model amongst similar device models.^ai_SiHua", "^ai_ShHua" )
Ida_Hasa__Bu( Same_Pkg__Idx, "Model Index", "Helps to match our user intent to a particular device model amongst similar device models.^ai_SiHua", "^ai_ShHua" )
Ida_Hasa__Bu_Rng( Modifier_Factor, "Modifier Factor", "How much to multiply or divide the value if this intent is used as a Modifier.^ai_SiHua", "^ai_ShHua", 2, 100 )

} Ida_End( Ctrl, Intent )

//===================================== // //===================================== Ida_Begin( Ctrl, Choice, "Control Choice", "Choice.^ai_SiHua", "^ai_ShHua" ) { Ida_Hasa__Subida( Val, "Value", "Describes the information unit, any attributes, changes and actions used by this tool.^ai_SiHua", "^ai_ShHua", Psb, Val )

Ida_HasaFct( Aud_Tool, "Hear", "Audial tool to use sonify this choice.^ai_SiHua", "^ai_ShHua", Art_Tool, Any ) Ida_Hasa__Fct( Vis_Tool, "See", "Visual tool to use visualize this choice.^ai_SiHua", "^ai_ShHua", Art_Tool, Any ) Ida_HasaFct( Lex_Tool, "Read", "Lexical tool to use to explain this choice.^ai_SiHua", "^ai_ShHua", Art_Tool, Any ) } Ida_End( Ctrl, Choice )

//===================================== // //===================================== Ida_Begin( Ctrl, Skillz, "Choice Map", "A dimensional map of action choices to express intents from thinking, controller buttons, sticks, gestures, etc.^ai_SiHua", "^ai_ShHua" ) { Ida_Hasa__Dphrs( Name, "Name", "Name for this Activity Map.^ai_SiHua", "^ai_ShHua" ) Ida_Pad__8()

Ida_Hasa__Fct( Xp, ">", "+X: Right.^ai_SiHua", "^ai_ShHua", Ctrl, Choice )
Ida_Hasa__Fct( Xn, "<", "-X: Left.^ai_SiHua", "^ai_ShHua", Ctrl, Choice )

Ida_Hasa__Fct( Yp, "^", "+Y: Up.^ai_SiHua", "^ai_ShHua", Ctrl, Choice )
Ida_Hasa__Fct( Yn, "v", "-Y: Down.^ai_SiHua", "^ai_ShHua", Ctrl, Choice )

Ida_Hasa__Fct( Zp, "(", "+Z: Front.^ai_SiHua", "^ai_ShHua", Ctrl, Choice )
Ida_Hasa__Fct( Zn, " )", "-Z: Back.^ai_SiHua", "^ai_ShHua", Ctrl, Choice )

Ida_Hasa__Fct( Wp, "]", "+W: Next.^ai_SiHua", "^ai_ShHua", Ctrl, Choice )
Ida_Hasa__Fct( Wn, "[", "-W: Previous.^ai_SiHua", "^ai_ShHua", Ctrl, Choice )

} Ida_End( Ctrl, Skillz )