Click here to Skip to main content
15,861,168 members
Articles / Web Development / HTML5

Engineering Calculator VOLTA-814

Rate me:
Please Sign up or sign in to vote.
4.91/5 (38 votes)
19 Dec 2016CPOL6 min read 123.8K   52   34
Engineering Calculator VOLTA-814 (Productivity Software contest submission) was originally developed as HTML5 web application and later converted into desktop app using Intel’s AppUp encapsulator. The latest version for Win 7/8 released in 2014 is built on .NET/WPF.

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.

Overview

This application software package was submitted to The Windows 8* & Ultrabook™ App Innovation Contest.

Category 1: Productivity

Category 2: Education

Platform: Windows 8 desktop (any edition)

Ultrabook-specific features

  • Touch-screen and standard PC mouse operation modes
  • GPS/Geolocation-based 'Find Job Agency' optional extension ("Jobrica-2013")
  • ALS auto-selection of color scheme (optional - see design notes in "Points of Interest" section)

Entire package (software "bundle") contains the core application, namely: Engineering Calculator "Volta-2013", and optional 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] (published on 11/27/2012). 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; (published on 11/29/2012 [8]).

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.

Volta-2014P

Image 1

Fig 1: Recently released Calculator VOLTA-201P for Win 7/8  (Professional Edition)

Volta-2013

Engineering Calculator Volta-2013 was implemented as a desktop version of online Calculator "VOLTA-2011". It's installer was generated using Intel AppUp encapsulator, which allows to convert HTML5 web app into Windows desktop installables.

Image 2

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

Image 3

Fig 3: Calculator Volta-2013 with rounded corner

Image 4

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

Using the code  

Several options have been added to new version VOLTA-2013, including dynamic styling using jQuery and CSS3 include files; dynamic style selection can be potentially 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)
CSS
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: 10px;
    -webkit-border-radius: 10px;
    border-radius: 10px;
}</</
Listing 2. jQuery code snippet to toggle Round Corners On/Off
JavaScript
// 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 corresponding to 'Light' background color scheme
CSS
div#eeMain {  background-color: #dedede; }

div#eeModel,
div#eeExtControl, 
div#eeStackControl,
div#eeStackRegister,
div#eeExtPanel, 
div.voltESeries { background-color: #eaeaea;  }

input#keyPad_Mem  { background-color: #f8f8f8;  }

button,
input,
div.eeCaption,
div.eeNotice,
div#eeExtControl,
div#eeStackControl,
div.eeSeriesTitle,
table.tabESeries { color: #202020; }

div#eeModel { color: #005500; }

button.keyPad_btnMemOp {  color: #005500;}

/* BACKSPACE/CLEAR INPUT KEYS*/
div#keyPad button#keyPad_btnBack,
div#keyPad button#keyPad_btnClr,
div#keyPad button#keyPad_btnAllClr {color:red;}

input,
button,
div.voltESeries { border: 1px solid #d0d0d0; }

button:hover { background: #d9d9d9; }

button:active {	border: solid 2px #909090; }

/* odd rows style */
table.tabESeries tr:nth-child(odd) { background-color: #f0f0f0; }

/* even rows style */
table.tabESeries tr:nth-child(even) { background-color: #eaeaea; }

/* Table hover style */
table.tabESeries tr:hover {background-color: #dadada; color: #101010;}
Listing 4.jQuery code snippet to dynamically switch between High/Low contrast and Light background  (can be linked to ALS sensor data feed)
JavaScript
// 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 and desktop installable app, that obtains geographical coordinates in real-time mode if geo-location service is available/enabled, and also allows manual entry of the search area central point, sending corresponding encoded web-query to the said page (see sample screenshots following):

Image 5

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

Image 6

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

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} and arbitrary "copy-pasted" text, 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 characters has been entered into Textbox, then input validation implemented in "Find Agency" button click event handle will throw exception and notify User of erroneous input either via TTS (Voice messaging), or standard message box (if TTS feature is disabled).

Listing 5. Numeric TextBox WPF  
C#
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;
}

Points of Interest

Speech Technology

Application extension 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

Application extension 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.

Speech Technology

Application extension Jobrica-2013 implements multi-modal Voice-enhanced User Interface, utilizing Microsoft Speech object library, in particular, TTS (Text-to-Speech) technology set, providing Voice instructions and error messaging to the User. This option can be turned On/Off; if disabled, standard message boxes will take place and carry the messages. As found in actual testing, TTS greatly benefits from Ultrabooks high internal data rate (due to sophisticated duo SSD/SATA), noticeably reducing the Voice response latency and increasing overall UI responsiveness.

ALS Sensor use-case

Core applications VOLTA-2013 is potentially capable of automated style selection, for example switching between High/Low contrast color scheme based upon data feed from the ambient light sensor (ALS), included in some high-end Ultrabooks. The possible implementation will require some sort of programmatic equivalent of "comparator w/hysteresis" (well- known in Electrical Engineering) observing ALS data stream and automatically switching between styles based upon some predefined luminance threshold(s). Upon serious design consideration and partial prototype testing, such automatic control feature was found unnecessary in this type of applications: "irrational exuberance", i.e. artificial overstretching of sensors use-cases can potentially result in continuous "styles jitter", thus increasing the annoyance/eye-irritation and degrading the overall user experience rather than improving it. Alternatively, style selection feature was implemented as a simple manual 'single-click' operation.

Using Intel's AppUp encapsulator 

Core application VOLTA-2013 has been developed originally as HTML5 web application, utilizing CSS3 (styling) and jQuery (functionality) technology set, and later converted into Windows desktop installable application using Intel's AppUp encapsulator.

History

  • HTML5 web application VOLTA-2011 has been released
  • VOLTA-2011 has been tested on new Apple iPad version (a.k.a. iPad 3).
  • Engineering Calculator VOLTA-2013 (v. 8.1.2) has been published on Intel's AppUp store
  • Application extension Jobrica-2013 (v. 8.1.1.) has been published on Intel's AppUp store
  • VOLTA-814 Full Version (14.2.03) has been released.

License

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


Written By
Engineer
United States United States
Dr. Alexander Bell (aka DrABell), a seasoned full-stack Software (Win/Web/Mobile) and Data Engineer holds PhD in Electrical and Computer Engineering, authored 37 inventions and published 100+ technical articles and developed multiple award-winning apps (App Innovation Contests AIC 2012/2013 submissions) Alexander is currently focused on Microsoft Azure Cloud and .NET 6/8 development projects.

  1. HTML5/CSS3 graphic enhancement: buttons, inputs
  2. HTML5 Tables Formatting: Alternate Rows, Color Gradients, Shadows
  3. Azure web app: Engineering Calculator VOLTMATTER
  4. Azure: NYC real-time bus tracking app
  5. Quiz Engine powered by Azure cloud
  6. 'enRoute': Real-time NY City Bus Tracking Web App
  7. Advanced CSS3 Styling of HTML5 SELECT Element
  8. Aggregate Product function extends SQL
  9. YouTube™ API for ASP.NET

Comments and Discussions

 
QuestionWhy? Pin
Sergey Alexandrovich Kryukov18-Feb-15 7:18
mvaSergey Alexandrovich Kryukov18-Feb-15 7:18 
GeneralMy vote of 5 Pin
majid torfi27-Oct-14 19:31
professionalmajid torfi27-Oct-14 19:31 
GeneralRe: My vote of 5 Pin
DrABELL28-Oct-14 2:50
DrABELL28-Oct-14 2:50 
GeneralMy vote of 5 Pin
Agent__00716-Oct-14 22:28
professionalAgent__00716-Oct-14 22:28 
GeneralRe: My vote of 5 Pin
DrABELL17-Oct-14 3:04
DrABELL17-Oct-14 3:04 
GeneralMy vote of 3 Pin
fredatcodeproject10-Oct-13 0:52
professionalfredatcodeproject10-Oct-13 0:52 
GeneralRe: My vote of 3 Pin
DrABELL10-Oct-13 2:09
DrABELL10-Oct-13 2:09 
GeneralRe: My vote of 3 Pin
fredatcodeproject10-Oct-13 23:45
professionalfredatcodeproject10-Oct-13 23:45 
QuestionProject and source code. Pin
Member 1029605226-Sep-13 21:56
Member 1029605226-Sep-13 21:56 
GeneralMy vote of 5 Pin
Azim Zahir9-Aug-13 22:29
Azim Zahir9-Aug-13 22:29 
GeneralRe: My vote of 5 Pin
DrABELL10-Aug-13 1:44
DrABELL10-Aug-13 1:44 
GeneralMy vote of 5 Pin
Art Tres8-Jul-13 7:56
Art Tres8-Jul-13 7:56 
GeneralRe: My vote of 5 Pin
DrABELL29-Oct-14 4:04
DrABELL29-Oct-14 4:04 
GeneralMy vote of 5 Pin
WebMaster26-Dec-12 22:48
WebMaster26-Dec-12 22:48 
GeneralRe: My vote of 5 Pin
DrABELL27-Dec-12 3:05
DrABELL27-Dec-12 3:05 
GeneralMy vote of 5 Pin
Abhishek Nandy10-Dec-12 21:25
professionalAbhishek Nandy10-Dec-12 21:25 
GeneralRe: My vote of 5 Pin
DrABELL11-Dec-12 3:46
DrABELL11-Dec-12 3:46 
GeneralRe: My vote of 5 Pin
Abhishek Nandy11-Dec-12 18:46
professionalAbhishek Nandy11-Dec-12 18:46 
GeneralMy vote of 5 Pin
Akram El Assas9-Oct-12 21:33
Akram El Assas9-Oct-12 21:33 
GeneralRe: My vote of 5 Pin
DrABELL10-Oct-12 2:05
DrABELL10-Oct-12 2:05 
GeneralMy vote of 5 Pin
Roshan D9-Oct-12 15:52
Roshan D9-Oct-12 15:52 
I love the UI , It's so wonderful
GeneralRe: My vote of 5 Pin
DrABELL9-Oct-12 17:46
DrABELL9-Oct-12 17:46 
GeneralMy vote of 5 Pin
Sergio Andrés Gutiérrez Rojas8-Oct-12 20:28
Sergio Andrés Gutiérrez Rojas8-Oct-12 20:28 
GeneralRe: My vote of 5 Pin
DrABELL9-Oct-12 4:16
DrABELL9-Oct-12 4:16 
GeneralMy vote of 5 Pin
Mohammad A Rahman8-Oct-12 20:01
Mohammad A Rahman8-Oct-12 20:01 

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.