Demo 13 Project (Knob Control)

Turning a knob to set the value on a Window application.

What you will see

You should see the view on your iOS device as shown above. Turn the knob (1) and see the value changes on the Windows application.

What you should do

Launch demo 13.exe and iQuipment PC. If you need help on this, review the demo 1 help chapter.

Plug the credit card reader* into your iOS device.

Enter http url: Go to iQuipment PC, File menu to open the file "Demo13.xml." Identify the "viewUrl" node and its sub node "security.none" (2, above). Enter the URL carefully into your iQupiment iOS app. If you need help on this, review Demo1 Project help.

Highlights of the code

Launch Demo13 Visual Studio project from the SDK. Open Form1.cs and locate the line below:

void DataExchangeService_clientSetData_ID_Event(string clientIP, string viewName, string dataName, object dataValue, long processID)
{
switch (viewName)
{
case myViewName:
if (dataName == exposedVariable_volume)
{
//UI Thread safe way of setting the text box value from your iOS device
UpdateTextGUIObject(textBox_volume, (string)dataValue);
}
break;
default:
break;
}
}

The delegate function "DataExchangeService_clientSetData_ID_Event" is called whenever you dial the knob on your iOS device. An exposed variable called "exposedVariable_volume" carries the data. Since this event may not be on a UI thread when setting the new value on the Windows textbox, It is important to call the function "UpdateTextGUIObject" to ensure it is UI thread safe.

Previous Lesson: Demo 12 Project (Credit Card Reader) Table of Contents Next Lesson: The RGA example