Click here to Skip to main content
Click here to Skip to main content

Engineering Calculator VOLTA-2013

, 1 Dec 2012
Rate this:
Please Sign up or sign in to vote.
Productivity software implemented as pure HTML5/CSS3/Javascript solution, encapsulated in a single text file does not require any image files. Can run in all major browsers, and also is intended to add ability of standalone operations under Windows OS on Ultrabooks.
This is an old version of the currently published article.

Please note

This article is an entry in our AppInnovation Contest. Articles in this sub-section are not required to be full articles so care should be taken when voting.

Introduction

This project was submitted to The Windows 8* & Ultrabook™ App Innovation Contest.

Category 1: Productivity 

Category 2: Education

Platform: Windows 8 desktop 

Ultrabook-specific features  

  • Touch-screen and standard PC mouse operation  modes
  • GPS/Geolocation-based 'Find Job Agency' application extension ("Jobrica-2013")

Entire package (software "bundle") contains the core application, namely: Engineering Calculator "Volta-2013", and application extension "Jobrica-2013" that allows finding the Job Agencies in particular search areas, either specified by the User manually, or by using real-time geolocation services.

Core application Volta-2013 is Windows 7/8 compatible and can run in touch-screen or standard mouse/keyboard desktop mode. It can be downloaded free of charge from Intel's AppUp store [1]. User Manual is available at [2].

Application extension "Jobrica-2013" can also run in Windows 7/8, but its real-time geolocation features are available only in Ultrabooks/Win8; it implements multi-modal User Interface providing Voice messaging via TTS technology. It's corresponding web page utilizes Microsoft Bing mapping technology and search engine, extended with Company's (Infosoft International Inc, NY) proprietary database of more than 200 Job Agencies in the US, mostly in hi-tech area.  The application is available free of charge on Intel's AppUp store.  

Background   

Engineering Calculator VOLTA-2013 for Microsoft Windows ([1,2]) extends the capability and application scope of its predecessor "VOLTA-2011" previously published online [3] and discussed on Codeproject [4]. 

Original Calculator 'VOLTA-2011' was implemented as HTML5 web application adhering to modern software paradigm of separation of programming concerns, namely:  

  • Content: HTML5
  • Presentation: CSS3
  • Functionality: Javascript/jQuery

Entire project was encapsulated in a single text file of rather small digital footprint (less than 10kB). It did not use any graphic files, like .jpg or .png, etc. All aesthetic enhancements, like: rounded corners, color gradients, borders and shadows were achieved exclusively via CSS3 styling, thus resulting in that very small application footprint and fast web page load.  

Working Demo of Engineering Calculator VOLTA-2011 implemented as HTML5/CSS3/jQuery web application is available online: click on the snapshot image shown below to open fully-functional calculator demo page:

Fig.1: Engineering Calculator VOLTA-2011

Fig 1: HTML5 web application 'Volta-2011', sample screenshot 

Volta-2013

Engineering Calculator Volta-2013 is an updated/revised desktop version of "VOLTA-2011". It's installer was generated using Intel AppUp encapsulator [5], which allows to convert HTML5 web app into Windows desktop installables. Online User Manual [2] covers all essential use cases, pertinent to the previous and current models. Following sample screenshots demonstrates various styling options available in Volta-2013, namely: Rounded corners, High/Low contrast, and Light background.

Fig 2: Engineering Calculator Volta-2013 for Win 8 desktop 

Fig 3: Calculator Volta-2013 with rounded corner

Fig 4: Calculator Volta-2013 with 'Light' background 

Fig 5: Calculator Volta-2013 app icon 

Using the code  

The code base of existing Calculator VOLTA-2011 has been well documented and discussed online [3,4]. Several options have been added to new version VOLTA-2013, including dynamic styling using jQuery and CSS3 include files; dynamic style selection can be potentialy linked to ambient light sensor output. Following example (Listing 1 and 2) demonstrates coding technique of rounded corners toggle On/Off:

Listing 1. Round Corners Style (CSS3)  
div#eeMain,
div#keyPad button,
div#keyPad input,
div#eeMain div.eeStyleControl,
div#eeMain div#eeRounded,
div#eeModel,
div#eeExtControl,
div#eeExtPanel,
div#eeStackControl,
div#eeStackRegister
{
    -moz-border-radius<span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none">: 10px<span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none">;
    -webkit-border-radius<span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none">: 10px<span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none">;
    border-radius<span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none">: 10px<span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none">;
<span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none">} 
</span> </</span></span></span></span></span></span></</span>
Listing 2. jQuery code snippet to toggle Round Corners On/Off 
// ROUNDED CORNER On/Off ********************
$("div#eeRounded").click(function () {
   //get all stylesheets
   var styleSheets = document.styleSheets;
   // toggle stylesheet identified by href
   var href = 'RoundedCorner.css';
   for (var i = 0; i < styleSheets.length; i++) {
       if (styleSheets[i].href.toString().indexOf(href) >= 0) {
            styleSheets[1].disabled = !(styleSheets[1].disabled);
            break;
       }
   }
});

Another jQuery technique was used for dynamic loading/unloading of CSS3 files related to Low/High contrast and background selection (see code snippets in the following Listing. 3 and 4) 

Listing 3. CSS stylesheet file pertinent to 'Light' background palette
/******************************************************************************
Project          :  Engineering Calculator VOLTA-2013
Module           :  Light.css
Description      :  CSS3 color properties to produce 'Light' background
******************************************************************************
Author           :  Alexander Bell
Copyright        :  2011-12 Infosoft International Inc
Date Created     :  01/20/2011
Last Modified    :  11/14/2012
******************************************************************************
DISCLAIMER: This Application is provide on AS IS basis without any warranty
You can use it at your sole risk.
******************************************************************************
TERMS OF USE     :  This module is copyrighted.
******************************************************************************/

div#eeMain {  background-color<span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none">: #dedede<span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none">; <span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none">}

div#eeModel,
div#eeExtControl, 
div#eeStackControl,
div#eeStackRegister,
div#eeExtPanel, 
div.voltESeries <span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none">{ background-color<span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none">: #eaeaea<span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none">;  <span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none">}

input#keyPad_Mem  <span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none">{ background-color<span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none">: #f8f8f8<span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none">;  <span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none">}

button,
input,
div.eeCaption,
div.eeNotice,
div#eeExtControl,
div#eeStackControl,
div.eeSeriesTitle,
table.tabESeries <span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none">{ color<span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none">: #202020<span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none">; <span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none">}

div#eeModel <span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none">{ color<span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none">: #005500<span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none">; <span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none">}

button.keyPad_btnMemOp <span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none">{  color<span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none">: #005500<span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none">;<span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none">}

<span class="code-comment"><span class="code-comment"><span class="code-comment"><span class="code-comment"><span class="code-comment">/* BACKSPACE/CLEAR INPUT KEYS*/
div#keyPad button#keyPad_btnBack,
div#keyPad button#keyPad_btnClr,
div#keyPad button#keyPad_btnAllClr {color<span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none">:red<span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none">;<span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none">}

input,
button,
div.voltESeries <span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none">{ border<span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none">: 1px solid #d0d0d0<span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none">; <span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none">}

button:hover <span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none">{ background<span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none">: #d9d9d9<span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none">; <span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none">}

button:active <span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none">{	border<span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none">: solid 2px #909090<span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none">; <span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none">}

<span class="code-comment"><span class="code-comment"><span class="code-comment"><span class="code-comment"><span class="code-comment">/* odd rows style */
table.tabESeries tr:nth-child(odd) { background-color<span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none">: #f0f0f0<span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none">; <span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none">}

<span class="code-comment"><span class="code-comment"><span class="code-comment"><span class="code-comment"><span class="code-comment">/* even rows style */
table.tabESeries tr:nth-child(even) { background-color<span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none">: #eaeaea<span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none">; <span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none">}

<span class="code-comment"><span class="code-comment"><span class="code-comment"><span class="code-comment"><span class="code-comment">/* Table hover style */
table.tabESeries tr:hover {background-color<span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none">: #dadada<span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none">; color<span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none">: #101010<span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none">;<span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none"><span class="code-none">}
</span></</span></span></span></span></</span>span></</span></span></span>span></</span>span></</span></span></span>span></</span></</span></span></span>span>span></</span></</span></span></span>span></</span>span></</span></span></span>span>span></</span></</span></span></span>span>span></</span></</span></span></span>span></</span>span></</span></span></span>span>span></</span></</span></span></span>span></</span></</span></span></span>span></</span>span></</span></span></span>span>span>span></</span></</span></span></span>span></</span>
Listing 4.jQuery code snippet to select High/Low contrast and background
// SELECT COLOR PALETTE ************************
$("div.eeStyleControl").click(function () {

        // disable all color styles
        $('link[rel=stylesheet][href~="Style/ContrastNormal.css"]').remove();
        $('link[rel=stylesheet][href~="Style/Light.css"]').remove();
        $('link[rel=stylesheet][href~="Style/ContrastHigh.css"]').remove();

        // add appropriate color style
        switch (this.id) {
            case 'eeNContrast': $('head').append('<link type="text/css" href="Style/ContrastNormal.css" rel="stylesheet" />'); break;
            case 'eeHContrast': $('head').append('<link type="text/css" href="Style/ContrastHigh.css" rel="stylesheet" />'); break;
            case 'eeLight': $('head').append('<link type="text/css" href="Style/Light.css" rel="stylesheet" />'); break;
            default: break;
        }
    });

Jobrica-2013

Jobrica-2013 is Windows 8 desktop/Ultrabooks application extension using GPS/Geolocation service in order to find Job Agencies in a search area nearby. It implements dedicated web page powered by Microsoft Bing technology [6] and desktop installable app, that allows obtaining geo-coordinates either in real-time mode (in case geo-location service is enabled) or manual entry, and, correspondingly, composing a web-query to the said page (see the sample screenshots following):

Sample coding solution: Numeric WPF TextBox  

Restricting WPF TextBox entry to just numbers and selected special characters is not a trivial task. Unlike its counterpart in Win Forms, which expose KeyCode (accessible as e.KeyCode in, for example, KeyDown event handle), WPF ones provides only e.Key property, which, if converted to String, returns, for example, something like "D0", "Back" or "OemPeriod". Quick workaround was found as shown in the following Listing 5. Solution allows entering in WPF TextBoxes numbers 0...9 and special keys: backspace, delete, period and minus sign. Relevant to mention that it could be extended by adding more 'allowed' cases with || operator, and also intercepting the combination of "Shift" + {Key}, but detailed coverage of this coding technique goes beyond the reasonable boundaries of this particular article. Just to notice, that even in the 'worst-case' scenario, provided that some invalid charactes has been entered into the Textbox, then on "Find Job Agency" button-click event the validation logic will throw exception and notify User of erroneous input either via TTS (Voice messaging), or standard message box (if TTS is disabled).

Listing 5. Numeric TextBox WPF
private void txtBox_PreviewKeyDown(object sender, KeyEventArgs e)
{
    // allow "Backspace", "Delete", "Period" and "Minus" keys;
    // the list can be extended, for e.g. with OemComma
    if ( e.Key.ToString() == "Back" ||
            e.Key.ToString() == "Delete" ||
            e.Key.ToString() == "OemPeriod" ||
            e.Key.ToString() == "OemMinus")  return;
            
    // cast e.Key to int
    int _key = (int)e.Key;

    // restrict any key except for numerics: 0...9
    e.Handled = _key > 43 || _key < 34;
}

Fig 6: Jobrica-2013 desktop app for Win8/Ultrabooks, sample screenshot

Fig 7: Interactive map shows Job Agencies nearby, sample screenshot 

Points of Interest

Speech Technology

Jobrica-2013 implements multi-modal Voice-enhanced User Interface utilizing Windows 8 Speech object library, in particular, TTS (Text-to-Speech) options.  It provides Voice instructions and error messaging to User. This option can be turned On/Off; if disabled, standard message boxes will take place and carry the messages.

Geolocation/GPS

Jobrica-2013 utilizes real-time GPS/Geolocation features available in GPS-equipped Ultrabooks, providing the option to "Find Job Agency" in the search area provided by User either manually, or via real-time geolocation service.

ALS Sensor use-case

Even though the core application VOLTA-2013 is potentially capable of automated style selection, for example switching between High/Low contrast stylesheets based upon the input from ambient light sensor (i.e. ALS, included in some high-end Ultrabooks), but upon serious design consideration and prototype testing, this feature was found unnecessary in these type of business application. Potential "styles jitter" in such fully-automated solution can cause  annoyance/eye-irritation, thus degrading the overall user experience, raher than improving it. Alternatively, the style selection feature was implemented as simple manual 'single-click' operation.

History 

  • HTML5 web application Engineering Calculator VOLTA-2011 has been released in the year 2011 [3.4] and tested in all major web browsers on PC platform
  • Calculator VOLTA-2011 has been tested on new Apple iPad version (a.k.a. iPad 3) [6].
  • Engineering Calculator VOLTA-2013 desktop version 8.1.2 was on Intel's AppUp [1]
  • Application extension Jobrica-2013 has been published on Intel's upp store []

References   

  1. Engineering Calculator Volta-2013, Download from Intel AppUp store
  2. Engineering Calculator Volta-2013, User Manual 
  3. Online Engineering Calculator Volta-2011, Design Notes
  4. Engineering Calculator VOLTA-2011
  5. Intel AppUp encapsulator
  6. New iPad 3 is here: quick notes from Apple store on Fifth Ave (Mar 17, 2012)
  7. Jobrica-2013 interactive geo-map online, powered by Microsoft Bing

License

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

About the Author

DrABELL
President Infosoft International Inc
United States United States
Dr. A. Bell has 20+ years of Software and Electrical Engineering experience. He is Win/Web veteran, published 200+ articles and authored 37 inventions, currently focused on: Windows 7/8, HTML5, CSS3, jQuery, SQL, .NET, ASP.NET, WPF, C#, Speech Technology and Mobile apps. He's been among recent App submission winners (The Windows 8* & Ultrabook™ App Innovation Contest 2012). Sample pubs:
  1. Edumatter M12: School Math Calculators and Equation Solvers (contest winner)
  2. Engineering Calculator VOLTA-2013 (contest winner)
  3. HTML5 Best Practices: Table formatting via CSS3
  4. Edumatter-M12 for Windows, app overview
  5. Engineering Calculator VOLTA-814D
  6. CoolPhone: phone numbers-to-text converter
  7. SQL generates large data sequence
  8. Aggregate Product function extends SQL
  9. Top-50 Digital Cameras
  10. WebTV Project: Embedded YouTube Player (Goog #1 YouTube API for ASP.NET)
Dr. Bell is personally credited for 10+ Enterprise level projects (Finance/Investment, Engineering, Edu) w/total code base exceeding 250k lines; doing consulting in NYC for 20 yrs.
Follow on   Twitter

Comments and Discussions


Discussions posted for the Published version of this article. Posting a message here will take you to the publicly available article in order to continue your conversation in public.
 
GeneralMy vote of 5 PinmemberRoshan D9-Oct-12 15:52 
GeneralRe: My vote of 5 PinmemberDrABELL9-Oct-12 17:46 

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

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

| Advertise | Privacy | Mobile
Web03 | 2.8.140709.1 | Last Updated 1 Dec 2012
Article Copyright 2013 by DrABELL
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid