Click here to Skip to main content
15,921,840 members
Articles / Programming Languages / XML

UltraDynamo (Part 1) - It All Starts Here!

Rate me:
Please Sign up or sign in to vote.
5.00/5 (9 votes)
14 Jan 2013CPOL6 min read 46.7K   2.2K   25   12
In this section, we look at the basics to get going.
Fork me on GitHub

Note 1: The source code is marked V1.1+ as it contains the code used in the V1.1 release as well as some of the stuff still in development that is hidden in the background.

Note 2: The Build Event code for code signing has been removed as this contained paths and passwords relevant to my build only. There is a description later in the article of the build event code.

Note 3: Intel closed its AppUp store on March 11th 2014, associated downoad link removed from article.

Table Of Contents


This article series will be the new home of UltraDynamo. UltraDynamo was my entry to the Intel AppUp Ultrabook™ competition (October 2012) hosted by CodeProject. The original article for the competition can be found here.

In this article, I will hopefully take you through the various aspects of developing the application, as well as looking at some of the finer detail within the code. As I continue to develop the application (when time allows!), I will hopefully roll the changes/updates and any new interesting aspects back into this article.

Image 2

Originally, this started life as one long article, but I decided to split this up into functional aspects, as it became quite unmanageable. As the application develops over time, it will be easier to add in updates to the relevant part and make life slightly easier.

What is UltraDynamo

UltraDynamo is a Windows desktop application that makes use of the various sensors available in the next generation of Ultrabooks. These sensors include:

  • Accelerometer
  • Gyrometer
  • Inclinometer
  • Compass
  • GPS
  • Ambient Light

The intent of the application is to provide a Rolling Road environment for motor sport enthusiasts that can use the sensors to determine the performance of their vehicles. Technically, it should be possible to perform functions such as:

  • Reaction timers
  • Acceleration / Braking timers e.g., 0 to 60, 0 to 60 to 0
  • Distance timers e.g., quarter mile
  • Power Calculations e.g., Brake Horsepower
  • Mapping data to GPS locations and overlay onto maps (e.g., Google Maps)

The data can then be presented to the user in various formats, e.g., numerical, charts, pictures.

Is the Application Finished?

Far from it, this is very much a work in progress as time allows. As new features are added or existing features improved, I hope to keep this article series up to date and share the source and compiled applications with the community here on CodeProject.

Can I Contribute, Make Suggestions, Report Problems?

Of course you can, use the messaging features of Codeproject to leave a forum message at the bottom of the article sections.

Don't expect miracles though, time is limited and I have plenty of other things to be doing as well.

My Development Environment

In order to develop this application, I am using the following:

  • Primary development machine: Windows 8 Pro desktop computer, no sensors, Visual Studio 2012 Pro
  • Secondary development machine: Windows 8 Pro laptop computer, no sensors, Visual Studio 2012 Pro
  • Test machine: Windows 8 Pro, Ultrabook with Sensor platform, Visual Studio 2012 Pro
  • Source Code Repository: Windows 2008 R2 Server running VisualSVN Server

I received the Ultrabook as part of the competition, so did not have that for initial development or testing of the sensors. This made for an interesting work around which I will cover later on. In order to keep all the machines in check, I use VisualSVN Server as a source code repository hosted on my Windows 2008 R2 virtual machine at 1&1. In order to allow the Visual Studio 2012 IDEs to integrate and communicate with the source code repository, I use ankhsvn plugin for Visual Studio. It is a simple case of checking in any code changes on one machine following any edits, then updating source to latest version on the others. This works very well as a method of managing the source from a multi-machine single developer point of view.

The application UltraDynamo is a Windows8 Desktop application using Windows Forms written in C#.

For the code signing tools and access to the sensor diagnostic tools, etc., you need to install the Windows 8 Software Development Kit (SDK). It is available from here[^].

Preparing Visual Studio 2012

The first thing that must be done when developing for Windows 8 and the Windows Runtime (WinRT) was to make a couple of modifications to the project files created by Visual Studio.

The very first thing to do is create a new Windows Forms C# application and target the relevant .NET Framework, in my case, .NET 4.5.

Image 3

After this, you must unload the project. To do this, from the solution explorer, right click the project and select unload:

Image 4

Next, in Visual Studio, right click the project and select Edit insertyourprojectname.csproj.

Image 5

Insert the new PropertyGroup just under the main Project element as shown below:

Image 6

Save the changes, and close the editor window. Next in Solution explorer, reload the project again:

Image 7

The next thing we need to do is add the suitable references to the Windows Runtime and the sensor libraries. First, in solution explorer, under the project, right click on References and select Add Reference.

Image 8

Finally, we need to add the Sensor library (Windows.Devices.Sensors.dll) and the Introp library (System.Runtime.InteropServices.WindowsRuntime.dll). Repeat the Add Reference process again, but this time, select Browse and navigate to where the libraries are stored. See the image below for paths:

Image 9

External Controls

In the dashboard image above, you will see form makes use of dials. I didn't have a lot of time to go and start writing my own controls or finding different controls to try. Fortunately, I found a dial control here on CodeProject. Ambalavanar Thirugnanam had already written and made available for use a control called Aqua Gauge, this was very easy to implement and was a great control to use as an initial implementation.

The source code for the control was dropped into my application and as required, the header was left in place:

/// Aqua Gauge Control - A Windows User Control.
/// Author  : Ambalavanar Thirugnanam
/// Date    : 24th August 2007
/// email   : [email removed from article to protect from address sniffers]
/// This is control is for free. You can use for any commercial or non-commercial purposes.
/// [Please do no remove this header when using this control in your application.]

Release History

  • V1.1 - This used the improved sensor manager code, added the double buffering to the drawing aspects and re-instated the simulator code. The first test code of the reaction timers is present in the source, but not available to the user.
  • V1.0 - This was the first rushed out the door code. It had flickering displays, the simulator code was disabled and hidden from view.

On to the Next Part

In the next section, we will take a look at the sensors.

Part 2 - It is all about the sensors


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Written By
Scotland Scotland
I have been working in the Oil & Gas Industry for over 30 years now.

Core Discipline is Instrumentation and Control Systems.

Completed Bsc Honours Degree (B29 in Computing) with the Open University in 2012.

Currently, Offshore Installation Manager in the Al Shaheen oil field, which is located off the coast of Qatar. Prior to this, 25 years of North Sea Oil & Gas experience.

Comments and Discussions

QuestionHope a MFC source is available Pin
Jason.LYJ5-Sep-13 19:08
professionalJason.LYJ5-Sep-13 19:08 
GeneralHistorical Information Pin
Vivi Chellappa19-Jun-13 5:28
professionalVivi Chellappa19-Jun-13 5:28 
GeneralRe: Historical Information Pin
DaveAuld19-Jun-13 5:59
professionalDaveAuld19-Jun-13 5:59 
GeneralMy vote of 5 Pin
Ahmed Ibrahim Assaf27-Jan-13 22:15
professionalAhmed Ibrahim Assaf27-Jan-13 22:15 
QuestionHowz is it going at Intel perceptual Challenge? Pin
Abhishek Nandy14-Jan-13 18:01
professionalAbhishek Nandy14-Jan-13 18:01 
AnswerRe: Howz is it going at Intel perceptual Challenge? Pin
DaveAuld14-Jan-13 20:46
professionalDaveAuld14-Jan-13 20:46 
GeneralRe: Howz is it going at Intel perceptual Challenge? Pin
Abhishek Nandy27-Feb-13 17:58
professionalAbhishek Nandy27-Feb-13 17:58 
GeneralMy vote of 5 Pin
Abhishek Nandy14-Jan-13 17:56
professionalAbhishek Nandy14-Jan-13 17:56 
GeneralMy vote of 5 Pin
Ranjan.D14-Jan-13 9:46
professionalRanjan.D14-Jan-13 9:46 
GeneralMy vote of 5 Pin
Marc Clifton14-Jan-13 7:34
mvaMarc Clifton14-Jan-13 7:34 
GeneralRe: My vote of 5 Pin
DaveAuld14-Jan-13 8:02
professionalDaveAuld14-Jan-13 8:02 
GeneralRe: My vote of 5 Pin
Marc Clifton14-Jan-13 10:02
mvaMarc Clifton14-Jan-13 10:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.