Docstoc

gui-ada.ppt

Document Sample
gui-ada.ppt Powered By Docstoc
					                CS699: Professional Seminar in CS / Professor V. Riabov
                                   Keith Armentrout
                  Presentation #3 : Portable GUI in Ada and GtkAda




                               Report
                                  On
                Portable Graphical User Interface (GUI)
                                  In
                           Ada and GtkAda
                                (pgag)




2005 March 12                       Keith Armentrout                      1
                CS699: Professional Seminar in CS / Professor V. Riabov
                                   Keith Armentrout
                  Presentation #3 : Portable GUI in Ada and GtkAda

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
2005 March 12                       Keith Armentrout                      2
                CS699: Professional Seminar in CS / Professor V. Riabov
                                   Keith Armentrout
                  Presentation #3 : Portable GUI in Ada and GtkAda

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


2005 March 12                       Keith Armentrout                      3
                CS699: Professional Seminar in CS / Professor V. Riabov
                                   Keith Armentrout
                  Presentation #3 : Portable GUI in Ada and GtkAda

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

2005 March 12                       Keith Armentrout                      4
                CS699: Professional Seminar in CS / Professor V. Riabov call
                                                           control

                                   Keith Armentrout
                  Presentation #3 : Portable GUI in Ada and GtkAda status

System Design Approach                        pgag
                                                                   status
                                                                                                           application

  •Three Ada “Tasks”                                                                 Setting
                                                                                       &
                                                                                     Controls
  •Nine Encapsulated Packages                        startup

  •“Application” is only a simulation
                                                                       GUI




                                                          Status             Help               Question
                                                         Window             Window              Window




                                             Main                                                          Browser
                                            Window
                                                                                                           Window



2005 March 12                        Keith Armentrout                   User                                    5
                CS699: Professional Seminar in CS / Professor V. Riabov
                                   Keith Armentrout
                  Presentation #3 : Portable GUI in Ada and GtkAda

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

2005 March 12                       Keith Armentrout                      6
                CS699: Professional Seminar in CS / Professor V. Riabov
                                   Keith Armentrout
                  Presentation #3 : Portable GUI in Ada and GtkAda


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



2005 March 12                       Keith Armentrout                      7
                CS699: Professional Seminar in CS / Professor V. Riabov
                                   Keith Armentrout
                  Presentation #3 : Portable GUI in Ada and GtkAda

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)
2005 March 12                       Keith Armentrout                      8
                CS699: Professional Seminar in CS / Professor V. Riabov
                                   Keith Armentrout
                  Presentation #3 : Portable GUI in Ada and GtkAda

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;




2005 March 12                       Keith Armentrout                       9
                CS699: Professional Seminar in CS / Professor V. Riabov
                                   Keith Armentrout
                  Presentation #3 : Portable GUI in Ada and GtkAda

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)
2005 March 12                       Keith Armentrout                      10
                CS699: Professional Seminar in CS / Professor V. Riabov
                                   Keith Armentrout
                  Presentation #3 : Portable GUI in Ada and GtkAda

 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
2005 March 12                       Keith Armentrout                      11
                CS699: Professional Seminar in CS / Professor V. Riabov
                                   Keith Armentrout
                  Presentation #3 : Portable GUI in Ada and GtkAda

pgag on a PC




2005 March 12                       Keith Armentrout                      12
                CS699: Professional Seminar in CS / Professor V. Riabov
                                   Keith Armentrout
                  Presentation #3 : Portable GUI in Ada and GtkAda


 pgag on a SUN
      •SunOS (Solaris) 5.8




2005 March 12                       Keith Armentrout                      13
                CS699: Professional Seminar in CS / Professor V. Riabov
                                   Keith Armentrout
                  Presentation #3 : Portable GUI in Ada and GtkAda

pgag on a PC
      •with Status Window




2005 March 12                       Keith Armentrout                      14
                CS699: Professional Seminar in CS / Professor V. Riabov
                                   Keith Armentrout
                  Presentation #3 : Portable GUI in Ada and GtkAda

pgag on a PC
    •with Status Window
    •and Question Window
         •user selected “EXIT”




2005 March 12                       Keith Armentrout                      15
                CS699: Professional Seminar in CS / Professor V. Riabov
                                   Keith Armentrout
                  Presentation #3 : Portable GUI in Ada and GtkAda


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




2005 March 12                       Keith Armentrout                      16

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:26
posted:4/4/2012
language:English
pages:16