HTP Low Level

Toolkits.HTPLowLevel History

Hide minor edits - Show changes to output

August 08, 2011, at 04:33 PM by 136.159.18.9 -
Changed lines 29-32 from:
HTP htp = manager.GetHTP(0xEF);

manager.ManualControl = true;
to:
HTP htp = HTPManager.GetHTP(0xEF);

HTPManager.ManualControl = true;
May 25, 2011, at 04:15 PM by 136.159.7.194 -
Changed lines 35-36 from:
Console.WriteLine(h.Pressure);
h.Height = 1 h.Pressure;
to:
Console.WriteLine(htp.Pressure);
htp.Height = 1 htp.Pressure;
May 24, 2011, at 03:47 PM by 136.159.18.9 -
Deleted line 51:
May 24, 2011, at 03:47 PM by 136.159.18.9 -
Changed lines 41-62 from:
The following example makes use of the location of an HTP on the table and changes its height accordingly
to:
The following example makes use of the location of an HTP on the table and changes its height accordingly.
(:source lang=csharp tabwidth=2 linenum=1 :) [=
public HTPWindow()
{
InitializeComponent();

// Add handlers for Application activation events
AddActivationHandlers();
// Default Window Registration
this.manager.RegisterWindow(this, this.HTPCanvas);


this.manager.ManualControl = true;
this.ContactDown += new ContactEventHandler(HTPWindow_ContactDown);
this.ContactChanged += new ContactEventHandler(HTPWindow_ContactDown);
}

void HTPWindow_ContactDown(object sender, ContactEventArgs e)
{
manager.GetHTP(0x10).Height = e.GetPosition(this.HTPCanvas).X / 1024;
}
=]
May 24, 2011, at 02:44 AM by 70.73.43.45 -
Added line 2:
May 24, 2011, at 02:44 AM by 70.73.43.45 -
Added line 1:
\\
May 24, 2011, at 02:44 AM by 70.73.43.45 -
Changed line 18 from:
[#programming]
to:
[[#programming]]
May 24, 2011, at 02:43 AM by 70.73.43.45 -
Added lines 1-39:
>>frame<<
!!!'''Contents'''
* [[#explanation | Low Level Concepts]]
* [[#programming | Programming with the Low Level]]
**[[#example1 | Basic Example]]
**[[#example2 | Example Using the Tabletop]]
>><<
\\

[[#explanation]]
!!Low Level Concepts
Programming with the low level of the HTP API represents the most versatility behind using the device, but at the same time introduces more complex programming for the user. The haptic tabletop puck makes use of three main aspects: height, pressure and friction, ranging between 0 and 1, all which can be accessed and modified (except for pressure, which cannot be changed).

When using the low level, the user is not granted the common events of an HTP being down, moved or lifted up, so they will have to make use of regular contact events provided by the Microsoft Surface SDK.

Low level programming is disabled by default, but the user can enable it by activating the manual control flag (refer to examples for more information).

[#programming]
!!Programming with the Low Level
Low level programming can be more complicated, but at the same time allows for fine grained, detailed operations that may not be possible with the higher levels. In these examples, we illustrate some simple uses of the low level.
[[#example1]]
!!!Basic Example
The following example makes use of the low level to change the height of the rod of the HTP while the user applies pressure.
(:source lang=csharp tabwidth=2 linenum=1 :) [=
HTPManager manager = HTPManager.Instance;
// Retrieve HTP
HTP htp = manager.GetHTP(0xEF);

manager.ManualControl = true;

while(true)
{
Console.WriteLine(h.Pressure);
h.Height = 1 h.Pressure;
}
=]

!!!Example Using the Tabletop
The following example makes use of the location of an HTP on the table and changes its height accordingly