160 likes | 304 Views
Report On Portable Graphical User Interface (GUI) In Ada and GtkAda (pgag). Executive Summary: Portability is the “holy grail” of computer science a GUI is the Most Difficult Area to Make Portable Windows (Win32) -vs- Unix/Linux (X-Windows) Ada is not a dead language
E N D
Report On Portable Graphical User Interface (GUI) In Ada and GtkAda (pgag) Keith Armentrout
Executive Summary: • Portability is the “holy grail” of computer science • a GUI is the Most Difficult Area to Make Portable • Windows (Win32) -vs- Unix/Linux (X-Windows) • Ada is not a dead language • Still Widely Used Throughout the World • A large, old, Application re-hosted from a Unisys Computer • Fortran Converted Line-by-Line to Ada • Remains Command Line Driven (difficult for non-programmers) • Needs a GUI Keith Armentrout
Introduction • Project Justification: • Old Command Line Driven Application • Input Formerly Specified via “JCL” • Inputs Now Edited into a Text Input File • Needs a GUI • Project Software Components: • Three Ada “Tasks” • Nine Encapsulated Packages Keith Armentrout
Functional Specification • Provide a GUI for the “Application” • Input of Path/File names • Directory Structure Browser Function • Selection of Input/Processing Options • Selection of Output Options • Display of Status/Error Messages • Control Buttons: • RUN RESET DEFAULTS • CLEAR HELP EXIT Keith Armentrout
call status status Setting & Controls GUI pgag startup control Status Window Help Window Question Window Main Window application User • System Design Approach • Three Ada “Tasks” • Nine Encapsulated Packages • “Application” is only a simulation Browser Window Keith Armentrout
Object-Oriented Design Issues • The Application (Old - Non OO) • Re-hosted Fortran to Ada, Line-by-Line • Retains Original Functionality, Structure, & Behavior • GtkAda (New - OO) • Nearly All Object-Oriented in its Design • Thick Binding to X-Windows and Win32 • pgag (A Mixture of the Old and the New) • Object-Oriented at its Highest Levels (the Ada Tasks) • Windows & Widgets Inherit from GtkAda Parents • Some Old-Time Functional Design Internally Keith Armentrout
Test Plan • Unit Test Not Possible • Programs Would Not Compile Without Type Definitions • No Visible Results Until Nearly All Pieces Assembled • The Plan: • Formally Test Only the Final Product • Follow Pre-Written Checklist • Record Screen Captures Keith Armentrout
Code Implementation • Ada • The World’s First Standardized OO Programming Language • GtkAda (Free Software) • A Graphical Toolkit which uses OO Features of Ada • A “Thick” Binding to X-Windows & Win32 • AdaGIDE (Free Software) • An Integrated Development Environment (IDE) for Ada • Developed by Faculty Members at US Air Force Academy • GNAT (Free Ada Compiler for Both PC and Sun) Keith Armentrout
Code Implementation (example) with Ada.Dynamic_Priorities; use Ada.Dynamic_Priorities; with pgag_Data; use pgag_Data; with pgag_GUI; use pgag_GUI; procedure pgag is begin -- pgag main Task Body Set_Priority( Task_Priority_Main ); GUI.StartUp; end pgag; Keith Armentrout
Problems Solved • Balancing the Tasks • Selection of Task Priority • Delay Statements • Problem Solved by GtkAda • 500 Millisecond Master Monitor • Dynamically Linked Libraries (DLL) on PC • Self-extracting Installation Program (future) • Libraries on Sun Solaris • Installation Procedure (search path setup) (future) Keith Armentrout
Issues For Future Study • Installation Problems (noted above) • Porting to Other Platforms (Linux, Mac) • The application May be Ported Soon • Status Reporting Between pgag and Application • Currently Implemented as a Simple/Limited Boolean Flag • Doesn’t Distinguish Between Minor and Severe Errors • Requires Significant Modifications to Application • Application is Changing • GUI Must Expand Keith Armentrout
pgag on a PC Keith Armentrout
pgag on a SUN • SunOS (Solaris) 5.8 Keith Armentrout
pgag on a PC • with Status Window Keith Armentrout
pgag on a PC • with Status Window • and Question Window • user selected “EXIT” Keith Armentrout
Conclusion • 1776 Lines of Code (3874 counting comments) • Meets Existing Requirements of the Real Application • Would Be Easy to Integrate with the Real Application • Could be Easily Upgraded to Meet New Requirements • Its Been Fun Keith Armentrout