Docstoc

NOTES_

Document Sample
NOTES_ Powered By Docstoc
					                                           Confidential


                                    Hach Company
                                    Palm Simplicity

                          Detailed Design Specification
                                        Revision 1.1




Hach Company Palm Simplicity Detailed Design                  Prepared by: Poliac Research Corporation
                                               Page 1 of 49
                                             Confidential



                                         Revision History
 Rev.       Date     ECO     Author        Modifications
 No.
 X.01      9/12/03           G. Blanch     Created Doc.
 X.02      9/15/03           G. Blanch     Created Doc.
  1.0      9/22/03           G. Blanch     Updated draft with changes agreed on in conversation with
                                           Bill Bonner. Changed document to Rev 1.0
  1.1      1/8/04            G. Blanch     Final update.




Hach Company Palm Simplicity Detailed Design                  Prepared by: Poliac Research Corporation
                                               Page 2 of 49
                                                                              Confidential



                                                                     TABLE OF CONTENTS




                      Modifications .............................................................................................................................................. 2


1.         INTRODUCTION ..................................................................................................................................... 5

1.1        OVERVIEW .......................................................................................................................................................... 5

1.2        REFERENCE DOCUMENTS ............................................................................................................................. 5

1.3        Terminology -Naming Conventions / Definitions ............................................................................................... 6

2.         DEVELOPMENT PLAN .......................................................................................................................... 7

2.1    Platform ................................................................................................................................................................. 7
  2.1.1     Programming Language .................................................................................................................................. 7
  2.1.2     Tools ............................................................................................................................................................... 7
  2.1.3     Architecture .................................................................................................................................................... 7
  2.1.4     Code guidelines............................................................................................................................................... 8
     2.1.4.1 Hungarian Notation ..................................................................................................................................... 8
  2.1.5     Source Files .................................................................................................................................................. 9
  2.1.6     Modularity .................................................................................................................................................... 9
  2.1.7     Global Variables .......................................................................................................................................... 9
  2.1.8     Interfaces ....................................................................................................................................................... 9
  2.1.9     Code Documentation ................................................................................................................................... 9
  2.1.10 Case Sensitivity .......................................................................................................................................... 10
  2.1.11 Unit Test...................................................................................................................................................... 10

2.2 Design Documentation.................................................................................................................................... 10
  2.2.1 Code and Design Document Review ...................................................................................................... 10

2.3        Version Control ................................................................................................................................................ 10

2.4        Software Version Numbers ........................................................................................................................... 11

2.5        Software RELEASE PROCESS .................................................................................................................. 11

2.6        Integration ......................................................................................................................................................... 11

3.         SOFTWARE DESIGN ........................................................................................................................... 12

3.1        Diagram NoTATION .......................................................................................................................................... 12
     3.1.1     Use Case Diagrams .................................................................................................................................... 12
     3.1.2     Sequence Diagrams ................................................................................................................................... 12
     3.1.3     Class Structure Diagrams ......................................................................................................................... 12

3.2    Palm Simplicity Use Case Diagram ................................................................................................................... 13
  3.2.1    Use Case Diagram Communication Links .................................................................................................... 14

Hach Company Palm Simplicity Detailed Design                                                          Prepared by: Poliac Research Corporation
                                                                               Page 3 of 49
                                                                            Confidential

3.3     Palm Simplicity Sequence Diagrams ................................................................................................................. 15
   3.3.1     General Location Sequence Diagram Overview ................................................................................... 15
        3.3.1.1.1 Diagram Overview, Sequence: 1, List Locations ............................................................................... 16
        3.3.1.1.2 Diagram Overview, Add Location, Sequence: 6 ................................................................................ 16
        3.3.1.1.3 Diagram Overview, Sequence: 10, Delete Location .......................................................................... 17
   3.3.2     General Device Overview ............................................................................................................................. 18
        3.3.2.1.1 General Device Overview, Device Screen, Sequence: 1 ................................................................... 19
        3.3.2.1.2 General Device Overview, Discover Devices, Sequence: 9 ............................................................... 20
        3.3.2.1.3 General Device Overview, Delete Devices, Sequence: 15 ................................................................. 21
        3.3.2.1.4 General Device Overview, Download Logs, Sequence: 19 ................................................................ 21
   3.3.3     Discover Device Sequence Diagram ............................................................................................................. 22
        3.3.3.1.1 Discover Device, Sequence: 1............................................................................................................ 23
   3.3.4     Log Sequence Diagram ................................................................................................................................. 25
        3.3.4.1.1 Log Sequence Diagram: Sequence 1, Download Logs....................................................................... 26
   3.3.5     Connection (SerialConnection) Sequence Diagram ...................................................................................... 27
        3.3.5.1.1 CSerialConnection Sequence Diagram: SerialConnection Sequence, 1 ............................................. 28

3.4    Palm Simplicity Class diagram .......................................................................................................................... 29
  3.4.1     Class Details ................................................................................................................................................. 29
     3.4.1.1 Class: Location ......................................................................................................................................... 30
       3.4.1.1.1 Class: Attribute Detail ........................................................................................................................ 31
       3.4.1.1.2 FindName ........................................................................................................................................... 31
       3.4.1.1.3 Add .................................................................................................................................................... 31
       3.4.1.1.4 Add .................................................................................................................................................... 32
       3.4.1.1.5 uiDelete .............................................................................................................................................. 33
       3.4.1.1.6 Get...................................................................................................................................................... 34
       3.4.1.1.7 GetFirstNext ....................................................................................................................................... 34
       3.4.1.1.8 GetDbRecordByIndex ........................................................................................................................ 35
       3.4.1.1.9 GetDbRecordByKey .......................................................................................................................... 35
       3.4.1.1.10 IsDevNameUnique ........................................................................................................................... 35
       3.4.1.1.11 AddDevice ....................................................................................................................................... 36
       3.4.1.1.12 UpdateDevice ................................................................................................................................... 36
       3.4.1.1.13 DeleteDevice .................................................................................................................................... 37
       3.4.1.1.14 GetDeviceCount ............................................................................................................................... 37
       3.4.1.1.15 ClearLogs ......................................................................................................................................... 37
     3.4.1.2 CDevice .................................................................................................................................................... 38
       3.4.1.2.1 FindName ........................................................................................................................................... 40
       3.4.1.2.2 Add .................................................................................................................................................... 41
       3.4.1.2.3 Update ................................................................................................................................................ 41
       3.4.1.2.4 Get...................................................................................................................................................... 42
       3.4.1.2.5 GetFirstNext ....................................................................................................................................... 42
       3.4.1.2.6 GetDbRecordByIndex ........................................................................................................................ 42
       3.4.1.2.7 GetDbRecordByKey .......................................................................................................................... 43
       3.4.1.2.8 GetDbRecordByKey .......................................................................................................................... 43
       3.4.1.2.9 DeleteLog........................................................................................................................................... 44
       3.4.1.2.10 DeleteLogs ....................................................................................................................................... 44
     3.4.1.3 Class: CLog............................................................................................................................................... 44
     3.4.1.4 Class: CDatabase ...................................................................................................................................... 45
       3.4.1.4.1 uiGetNextKey .................................................................................................................................... 47
  3.4.2     Palm Simplicity Forms Documentation ........................................................................................................ 48
  3.4.3     Communication Classes ................................................................................................................................ 48
     3.4.3.1 Class: CSerialConnect............................................................................................................................... 49
     3.4.3.2 Class: Modbus ......................................................................................................................................... 49
     3.4.3.3 Class: ClrDaPort ....................................................................................................................................... 49



Hach Company Palm Simplicity Detailed Design                                                       Prepared by: Poliac Research Corporation
                                                                            Page 4 of 49
                                            Confidential



1. INTRODUCTION

1.1 OVERVIEW
This document defines the detailed software development design for the Hach Company Palm
Simplicity and defines the development approach and the goals of the software development,
design and data stores effort. The project objectives are:
   Develop software for the Palm Simplicity that meets the requirements specified in the
    Customer Requirements Specification
   Develop software that is well designed, reliable, and easily maintainable.

1.2 REFERENCE DOCUMENTS
       General Network Interface Specifications.
       Hach Company Palm Simplicity Customer Requirements Specification.




Hach Company Palm Simplicity Detailed Design                  Prepared by: Poliac Research Corporation
                                               Page 5 of 49
                                                Confidential




1.3 TERMINOLOGY -NAMING CONVENTIONS / DEFINITIONS

The following is a list of definitions for terminology and acronyms used in this document:

       Term             Description
       Location         A user defined physical location that can contain more then one
                        controller.

       Controller       A device known as an SC100 used to store and control up to two
                        sensor devices. The controller may have more then two devices in
                        later revisions.

       Sensor           A device used to monitor water flow or water quality. Also known
                        as a smart sensor.

       Device           A controller or a sensor connected to a controller.

       Discovery        A process of obtaining all known devices in a location by polling a
                        controller for list known as the Gateway Map for attached device
                        addresses. Addresses are then polled to obtain specifics about the
                        device at the address provided.

       Device           A process known as Discovery (see Discovery) to obtain product
       Identificatio    information of a device at a known address. When a device is
       n                polled for Device Identification, the device responds with its
                        manufacturer ID, and device ID and serial number.

       Gateway          The purpose of the gateway map is to allow the PDA software to
       Map              quickly identify the address’s used by the devices at a location.
                        Once the modbus address’s are identified, the device id request can
                        be sent to each address to detect the device type at that address

       IrDA             Infrared Data Association. One of two methods to communicate to
                        controllers. The second method will be left to a future version of
                        the software.
                        A standard feature available since the Palm III PDA. In this case,
                        used to communicate with a Hach Controllers at defined locations.

       IrCOMM           An industry standard that defines a protocol for using infrared to
                        emulate a serial port.

       ModBus           A protocol used to communicate with devices through IrDA,
       RTU              installed at a location

       Shortcut Key     A means of reducing steps needed to perform a task. In the case of
                        the Palm, shortcut keys are assigned to menu items and are
                        displayed to the right of the menu item. Shortcuts begin with the
                        forward slash graffiti character.
Hach Company Palm Simplicity Detailed Design                   Prepared by: Poliac Research Corporation
                                                Page 6 of 49
                                            Confidential




2. DEVELOPMENT PLAN
The Palm Simplicity software shall be developed using the software and hardware tools specified
in this document.

2.1 PLATFORM
Software development environment shall be a Pentium desktop PC equipped with Palm Desktop
Manager software, version 3.1, HotSync Manager software 3.1.0 and a physical HotSync cradle to
download executable software to the Palm device. The Palm Device shall be equipped with an IR
port and OS version 3.5.

2.1.1 Programming Language
The software shall be developed using the Metrowerks CodeWarrior Development Studio of the
Palm OS Platform, version 9. The development studio shall support C and C++ languages.



2.1.2 Tools
The following hardware tools shall be used in the development of the software:
Tool                         Version   Purpose
Metrowerks CodeWarrior          9      Used to develop all software as required by the Software
Development Studio                     Requirements documentation.
Windows XP                     5.1     Operating System and Network
                             Service
                             Pack 1
Palm IIIxe                   OS 3.5    Used to assist with Palm and communications
                                       debugging.
Hach SX100 Controller.          ?      Used to assist with communications and interfacing
                                       debugging.
Sensor Simulator                ?      Used to assist with communications and interfacing
software/hardware                      debugging.
MS Word                       2000     Used to develop design documentation


The software tools specified above shall be used to facilitate development of the documentation,
software or to assist in data analysis. Additional software tools may be developed or acquired if
needed.

2.1.3 Architecture
The software for Palm Simplicity shall be partitioned into major functional areas as defined by the
Software Design section below. These functional areas are divided by requirements previously
defined in the Requirements Specification.


Hach Company Palm Simplicity Detailed Design                  Prepared by: Poliac Research Corporation
                                               Page 7 of 49
                                             Confidential




2.1.4 Code guidelines
The following guidelines apply to the development of the software.
For all names, Hungarian format (no underscores) is acceptable after the first underscore.



2.1.4.1 Hungarian Notation
  Prefix     Meaning            Example                  Notes
                                                         In most cases, p is combined with another
                                                         prefix; the prefix of the type of object being
                                                         pointed to. For example:
  p          Pointer            obj* pObject;
                                                         String* psName
                                                         is a pointer to a string object containing a
                                                         name.
  s                             String sName;            This convention is generally used for first-
             String
  str                           String strName;          class string classes.
             Zero-terminated
  sz                           char szName[16];
             / null-terminated
  psz                          char* pszName;
             string
  h          Handle             HWND hWindow             h
             Character                                   Sometimes c is used to denote a counter
  c                             char cLetter;
             (char)                                      object.
  i          integer            int iCars;
  li         long integer       long liStars;
             Byte or
  b                             byte bMouthFull;
             Unsigned Char
  f          Float              float fRootBeer;
  d          Double             double dDecker;
             Long double-
                                long double
  ld         precision
                                ldLightYears;
             floating point
                                boolean bIsTrue;         An integer can store a boolean value as
  b          Boolean            BOOL bIsTrue;            long as you remember not to assign it a
                                int bIsTrue;             value other than 0 or 1
  u          Unsigned...
                                                         Sometimes l is appended to p to denote
                                                         that the pointer is a long. For example:
  l          Long               long lIdentifier;        lpszName
                                                         is a long pointer to a zero-terminated
                                                         string.


Hach Company Palm Simplicity Detailed Design                   Prepared by: Poliac Research Corporation
                                                Page 8 of 49
                                               Confidential


                                 Class CObject;
   C          Class
                                 Class Object;
                                 class CThing {
              Class Member       private:
   m_
              Identifiers             int m_nSize;
                                 };
                                                        In most cases, v will be included with p
   v          Void (no type)     void* pvObject         because it is a common trick to typecast
                                                        pointers to void pointers.
              Input File         ifstream
   if                                                   if
              Stream             ifNameFile;
                                 void fct(istream
   is         Input Stream                              is
                                 &risIn);
              Output File        ofstream
   of                                                   of
              Stream             ofNameFile;
                                 void fct(ostream
   os         Output Stream                             os
                                 &rosIn);
              Declaring a        struct SPoint
   S                                                    S
              struct             {



2.1.5 Source Files
Source files may contain multiple modules. C modules shall include their own .h files. C++
modules shall include their own .hpp files.

2.1.6 Modularity
All code and software classes shall be designed, developed and grouped in a modular fashion.
Modules shall be composed of a single function or a group of related functions. Modules shall
provide macros and function definitions that allow access to its functions and data by other
modules. Modules shall be kept to an easily maintainable size. Macros are not required where a
macro would result in a simple textual substitution.

2.1.7 Global Variables
All variables shall be local except where global variables are required to support the software
design.

2.1.8 Interfaces
All software files with externally accessible functions shall have a public include or interface file.
This file shall contain class declarations, type declarations, constant definitions, function
prototypes, and macros.

2.1.9 Code Documentation
Source files shall have comments at the beginning describing the contents of the source file.
Hach Company Palm Simplicity Detailed Design                  Prepared by: Poliac Research Corporation
                                               Page 9 of 49
                                           Confidential

All functions and methods shall include an initial comment section describing function. The code
shall contain comments sufficient to clearly describe its function. The code shall contain
comments to describe constants, variables, and structures.



2.1.10 Case Sensitivity
All software should be complied and assembled with case sensitivity.



2.1.11 Unit Test
The following methods and tools may be employed in unit test:
      Target platform displays
      Source level debugging via CodeWarrior
      Developed Log files and or Print statements
      Supporting hardware devices such as the SC100
Unit test shall be performed on critical areas of software. Formal documentation of unit test is
required on critical modules. Critical modules are those involved in any hazard mitigation. This
may not necessarily apply to this phase of Palm Simplicity.

2.2 DESIGN DOCUMENTATION
The design document shall contain, at a minimum, the following:
  1. A high level description of the theory of operation, including the functional requirements of
     the classes or modules
  2. Class interface descriptions using UML, Use Case or sequence diagrams.
  3. Detailed description of the class / method process, including what it does, how it does it, any
     formulas applied, timing considerations, and processing constraints. Pseudo code may be
     used to describe the module process.

2.2.1 Code and Design Document Review
Code and design document reviews shall be performed after unit test is complete and prior to
placing the software into production. The following should be included in the review process:
  1. Software Detailed Design document.
  2. Source code.
  3. Any unit test results.
All items shall be reviewed for consistency, completeness, correct performance, and compliance
with the coding standards as defined in this document.

2.3 VERSION CONTROL
All software shall be under configuration management prior to testing for production release.
Informal testing may be performed on class / methods or modules that are not under configuration
management. All software source files, data tables and include files, which are used to create an
executable for Palm Simplicity shall be under configuration management prior to validation.
Hach Company Palm Simplicity Detailed Design               Prepared by: Poliac Research Corporation
                                           Page 10 of 49
                                             Confidential

2.4 SOFTWARE VERSION NUMBERS
Software versions shall be identified as follows:
               xx.yy.zz,
where “xx” is the major version number, “yy” is the minor version number, and “zz” is the in-house
release number. The major version number shall be updated to indicate a significant change in
features. The minor version number shall be updated to indicate, bug fixes or a minor feature
change that is to be released to the customer. The in-house version number shall be incremented
to an odd number to indicate a working build or an even number to indicate a test build for
engineering use.
A working build is an uncontrolled set of software and may contain software that is not under
version control.
A test build is a declared set of software under version control.

2.5 SOFTWARE RELEASE PROCESS
Software release consists of the following checklist of activities:
   1. Check revised software source modules into WINCVS archive.
   2. Use WINCVS to assign a release revision tag to the entire project.
   3. Checkout the project on two separate computers and perform a clean build on each.
      Select “Release Build” and “Build All”.
   4. Verify file sizes match
   5. Verify that the output file downloads and runs on the PALM IIIxe.
   6. Verify that the operational requirements of are correct for Palm OS version 3.3 and version
      4.1 on the Palm Simulator.



2.6 INTEGRATION
Software shall be integrated and tested on the Palm IIIxe and verified operational with Palm OS
3.3 and 4.1.simulators in the debug environment.




Hach Company Palm Simplicity Detailed Design                 Prepared by: Poliac Research Corporation
                                             Page 11 of 49
                                           Confidential




3. SOFTWARE DESIGN


3.1 DIAGRAM NOTATION
This document contains Use Cases, Sequence Diagrams, Data Flow diagrams and Class
Structure Diagrams. The following conventions are used for each type of diagram.

3.1.1 Use Case Diagrams
Use case diagrams are a component of UML methodologies and represent user interface
functionality from the users perspective. These diagrams define major objects, structures and
relationships.

3.1.2 Sequence Diagrams
A Sequence Diagram depicts interaction by focusing on the sequence of messages that are
exchanged, along with their corresponding event occurrences. Unlike a communication diagram, a
sequence diagram includes time sequences but does not include object relationships.

3.1.3 Class Structure Diagrams
A class diagram describes the classes that make up a system and the static relationships between
them. Classes are defined in terms of their name, attributes (or data), and behaviors (or
methods). The static relationships are association, aggregation, and inheritance.




Hach Company Palm Simplicity Detailed Design               Prepared by: Poliac Research Corporation
                                           Page 12 of 49
                                            Confidential




3.2 PALM SIMPLICITY USE CASE DIAGRAM
There are nine conceptual areas or cases of importance or that must be developed to meet Palm
Simplicity requirements. The following diagram (see figure 3.1) depicts these cases they are
implemented. The cases consist of cases the user interacts with directly and those that the user
puts into action by interaction with the first set. From the perspective of the User, there are five
major areas of functionality that are required. We will cover these first. They are:

   1.   Create and Delete Location information.
   2.   Create, Edit and Delete a Device in a Location.
   3.   Download Logs from a Device
   4.   Hot Sync files obtained in a Download session from a device.
   5.   Clear Logs.

Four other areas of importance to be addressed are:
   1. Database Functionality
   2. Communications to devices,
   3. Communication Protocol (ModBus)
   4. Infrared connectivity.




                        Figure 3.1. Palm Simplicity, Use Case Diagram.



Hach Company Palm Simplicity Detailed Design                Prepared by: Poliac Research Corporation
                                            Page 13 of 49
                                           Confidential


3.2.1 Use Case Diagram Communication Links


Field Technician To Create, Delete Location Information:
Most all actions begin with a selected location. User must first define a location. May
then use discover to populate location with devices, upload logs from devices and store
logs on PC in HotSync operation. Uses Devices to obtain logs.

Field Technician Create, Edit Delete Devices in Locations:
User first selects location to find device to work with. Devices are created through
discover operation in location. So create process is actually implemented through location
path. User may Delete and Edit locations once located and chosen in a location.


Field Technician To Download Device Logs:
User may download a log from a device. Location must first be selected, then device to
obtain the log from. User may select Data Log Only, Event Log Only or All Log data. All
data, only new data, or Interval times may be selected. See Downloading in the Customer
Requirements Specification document for more information.


Field Technician To Clear Logs:
User typically performs the Clear log function after they have HotSynced with a computer
to store existing gathered data from the field. Locations can be optionally cleared.
Processing starts with a call to location to delete all logs for devices associated with it.


Field Technician To Hot Sync Files:
HotSync is a PC operation, where user sets the Palm in a cradle or next to an Ir Beam.
Process uses Palm HotSync software to transfer log and database files to PC. Log files
are removed from both PC and Palm after information is processed into Hack trend tool.




Hach Company Palm Simplicity Detailed Design               Prepared by: Poliac Research Corporation
                                           Page 14 of 49
                                            Confidential




3.3 PALM SIMPLICITY SEQUENCE DIAGRAMS
The following sections define interactions between the user and internal software classes that
makeup the Palm Simplicity program. Current Connections to the Palm Simplicity are limited to
serial connections only. Future connections will be expanded. The name Connection and Serial
Connection will be used interchangeably within the following diagrams.

3.3.1 General Location Sequence Diagram Overview
Major interactions with locations are shown below (see figure 3.2). Location methods are
responsible for supplying persistence to User defined locations through Palm Memory. Locations
methods are driven by commands from the Palm User Interface.

The following sequence lists the major actions for location responsibilities. The following
paragraphs define the sequences in the figure below.




                      Figure 3.2. Palm Simplicity, Location Sequence Diagram.



Hach Company Palm Simplicity Detailed Design                Prepared by: Poliac Research Corporation
                                            Page 15 of 49
                                           Confidential




3.3.1.1.1 Diagram Overview, Sequence: 1, List Locations
User requests a list of locations to view.
User shall be able to add to locations, delete locations or perform operations on devices in
locations. See Device Sequence Diagram for details of this.
       LIST Location, Sequence: 2
      The request for locations is received from the UI.
      The Palm Device Manager requests all locations from the CLocation Database. The
      request uses the GetFirstNext method in CLocatoin to obtain all locations.
       LIST Location, Sequence: 3
      CLocation obtains all locations defined in Palm memory.
      The request uses the GetFirstNext method in CLocatoin to obtian all locations. The
      command is initiated and carried out from the Palm Device Manager
       LIST Location, Sequence: 5
      This return may be followed by more calls to get locations from CLocation until all
      locations are retrieved from the database.



3.3.1.1.2 Diagram Overview, Add Location, Sequence: 6
User requires another location definition. Locations must contain devices before they are
useful. Devices are created within the Discover Process.
       Add Location, Sequence: 7
      User sends Location name to create a location. uiAddLocation is called in the
      CLocation class to add the location definition. The new Location name must be
      unique.
       Add Location, Sequence: 8
      CLocation is responsible for storing the location name into Palm Memory.
       Add Location, Sequence: 9
      When CLocation successfully adds the requested location to persistent memory, the
      location is then available for display. The display shall be updated with the new
      location. This may be processed through another call to CLocation.GetFirstNext to
      refresh the location display.




Hach Company Palm Simplicity Detailed Design               Prepared by: Poliac Research Corporation
                                           Page 16 of 49
                                           Confidential




3.3.1.1.3 Diagram Overview, Sequence: 10, Delete Location
User requires a location be deleted. A location must be selected. The location must be
located and removed from Palm persistent memory.


       Delete Location, Sequence: 12
       Remove location from persistent Palm memory

       Delete Location, Sequence: 13
       Remove location from persistent Palm memory
       When CLocation successfully deletes the requested location from persistant
       memory, the locations display must be updated to reflect changes. This may be
       done through another call to CLocation.GetFirstNex to refresh the location display.




Hach Company Palm Simplicity Detailed Design               Prepared by: Poliac Research Corporation
                                           Page 17 of 49
                                           Confidential




3.3.2 General Device Overview
Device interactions are divided into four major areas shown below in figure 3.3. Palm Simplicity
software shall provide capability within the User Interface to maintain definition of devices in
locations, providing persistence to those definitions and allowing a user to download logs from a
device defined in a location, and the ability to delete a device. Devices are defined through the
discover process. This diagram shows basic requirements. The following pages further define
device responsibilities for the discover process, log downloads, and communication details.

Figure 3.3 lists major device responsibilities. The following paragraphs define the sequences in
the figure below.




                                Figure 3.3. General Device Overview




Hach Company Palm Simplicity Detailed Design               Prepared by: Poliac Research Corporation
                                           Page 18 of 49
                                           Confidential


3.3.2.1.1 General Device Overview, Device Screen, Sequence: 1
The device screen displays all know devices within a location. Here a location has been
selected and the user is requesting a display of all devices at that location.


       Device Screen, Sequence: 2
      Cdevice.GenFirstNext shall be used to obtain devices in a location. The key value
      for the location should be available in CLocation.m_uiKey. Obtain key value via
      CDevice.vSetLocationKey for Devices before calling CDevice.GetFirstNext as
      required.

       Device Screen, Sequence: 3
      Returns a Key value from CLocation.m_uiKey to setup Cdevice

       Device Screen, Sequence: 4
      The key value for the location should be set in CDevice. Request all selected
      devices for the given location from CDevice.GetInfo as required.

       Device Screen, Sequence: 5
       Retrieve FirstNext Device using CDevice.GetFirstNext

       Device Screen, Sequence: 6
       Return Found Device Name


       Device Screen, Sequence: 7
       As requested devices within a location are retrieved, they are inserted to the display. Note
       that CDevice.uiGetFirstNext is called until NULL is returned for device name. A return
       value of NULL means all devices for the selected location have been retrieved.




Hach Company Palm Simplicity Detailed Design               Prepared by: Poliac Research Corporation
                                           Page 19 of 49
                                           Confidential




3.3.2.1.2 General Device Overview, Discover Devices, Sequence: 9
User has selected a location and requests process to find (discover) all known devices in
that location. The process uses the IRDA port to communicate to a location controller,
which in turn obtains devices in the location.
All devices in the selected location will be retrieved and stored in the Palm database. See
the Discover Sequence diagram for more details.


       Discover Devices, Sequence: 10
       The Discover process begins by the user selecting a location and then selecting
       discover. Discover uses the IRDA port which communicates to the controller. All
       devices in the selected location will be retrieved and stored in the Palm database.
       See the Discover Sequence diagram for more details.

       Discover Devices, Sequence: 11
      Parses through address map to find locations. Each found must be stored in Palm
      persistent memory.


       Discover Devices, Sequence: 12
       Devices found in the location are stored in persistent memory.


       Discover Devices, Sequence: 14
       When all devices within the location are retrieved the device display shall be
       updated. This may be done through another call to CDevice.GetFirstNex to refresh
       the location display.




Hach Company Palm Simplicity Detailed Design               Prepared by: Poliac Research Corporation
                                           Page 20 of 49
                                           Confidential


3.3.2.1.3 General Device Overview, Delete Devices, Sequence: 15
A device has been selected on the Palm Display and the user has selected an option to
delete it.


       Delete Devices, Sequence: 16
       Device Manager calls CDevice.uiDelete to delete the device in focus from Palm
       memory.

        Delete Devices, Sequence: 17
       Device in focus is deleted from Palm persistent memory.


       Delete Devices, Sequence: 18
       When a device is deleted, the device display must be updated. This may be done
       through another call to CDevice.GetFirstNex to refresh the location display.



3.3.2.1.4 General Device Overview, Download Logs, Sequence: 19
A device has been selected on the Palm Display and the user has selected an option to
download logs for it.


       Download Logs, Sequence: 20
       Device Manager guides the user by obtaining log information for a device by
       making use of CConnect Class. Logs may be selected on a (1) time interval, (2)
       only new data or (3) all. See Log Sequence Diagram for more details.

        Download Logs, Sequence: 21
       Log information is stored into Palm persistent memory for later downloading to the
       PC.


       Download Logs, Sequence: 22
       Log information is stored into persistent memory.




Hach Company Palm Simplicity Detailed Design               Prepared by: Poliac Research Corporation
                                           Page 21 of 49
                                           Confidential




3.3.3 Discover Device Sequence Diagram
The following sequence further specifies the discover process (see figure 3.4). The discover
process begins with a user request to discover a location. The discover process sends a request
for the Gateway Map to obtain Gateway Addresses. The return message contains the Gateway
Map of bitmap of addresses. By using a bit based index into the map, addresses are identified for
each bit set. The index is then equal to the address of a device. Each addresses is then queried
for device information. Information is returned and stored in persistent Palm memory. Details of
the Connection software interactions are defined on the following diagram (see figure 3.5).

The following paragraphs define each sequence listed in the figure below.




                      Figure 3.4. Palm Simplicity, Device Sequence Diagram.




Hach Company Palm Simplicity Detailed Design               Prepared by: Poliac Research Corporation
                                           Page 22 of 49
                                           Confidential


3.3.3.1.1 Discover Device, Sequence: 1
The Discover process begins by the user selecting a location and then selecting discover.
Discover uses the IRDA port which communicates to the controller that all devices in the
location are connected to. All devices in the selected location will be retrieved and stored
in the Palm database
When a device is located and information about the device is read from the device, it must
be compared with known information in the Palm database. Only Serial Number and
Device Name are allowed to change. A compare method is used to handle this
requirement. See CDataFile.uiCompair for more information about comparing discovered
devices with those known to the Palm. If the discovered device is new, the user is
prompted for a device name. The name must be unique within the location. If the device
was previously known and has not changed, no action is taken for the device.
       Discover Devices, Sequence: 2
       CSerialConnection.uGetFirstNext() is called for the first time to obtain a gateway
       map from the controller that all devices are connected to. The method will then use
       the first address to find the first device. Subsequent calls then to obtain the other
       devices until each device in the location is found.
       Discover Devices, Sequence: 3
       Calculate the device address from returned Gateway bitmap during first call to
       uGetFirstNext(). The Gateway maps bits are used as offsets to signify address
       locations for devices. Address are created for this and subsequent calls.
       See CSerialConnection.uGetFirstNext


       Discover Devices, Sequence: 5
       Determine if new device are found by obtaining Palm memory information and use
       compare method. If device is not found, the device is new. Prompt the user for a
       device name in following sequences. Otherwise compare contents to make sure
       values of the device to those known in the Palm database have not changed.


       Discover Devices, Sequence: 6
       When a device is located and information about the device is read from the device,
       it must be compared with known information in the Palm database. If the
       discovered device is new, the user is prompted for a device name. The name must
       be unique within the location. If the device was previously known and matches
       information in the Palm database, the user is not prompted for any reason.




Hach Company Palm Simplicity Detailed Design               Prepared by: Poliac Research Corporation
                                           Page 23 of 49
                                           Confidential



       Discover Devices, Sequence: 7
       Please see previous sequence. Note this is a return to from User request for name
       only, if the found device is new.


       Discover Devices, Sequence: 8
       Only Serial Number and Device Name are allowed to change. Like above
       compare, a compare method is used to handle this requirement. See
       CDataFile.uiCompair for more information about comparing discovered devices
       with those known to the Palm.


       Discover Devices, Sequence: 9
       This sequence is taken if there is a difference between the device information
       downloaded and that in the Palm database. The Device serial number and the
       device name are allowed to change. The address of a device may also change if
       no other information about the device has changed. In these cases the user must
       be warned and may opt to continue or exit the discover process.
       Discover Devices, Sequence: 10
       User is presented with decision to allow changes to device name or serial number
       of a device. User may opt to exit the discover process. In this case, all preceding
       changes to device information downloaded, changed and confirmed to be ok, if
       any, will remain.


       Discover Devices, Sequence: 11
       The only reason the user needs to respond to a device discover process here is
       that the device found, previously existed and device information has changed. If
       the serial number or the device name has changed the user is allowed to continue
       and the changes will be stored in persistent memory. If other device information
       has changed, the discover process is terminated with an error.


       Discover Devices, Sequence: 12
       Differences (device name or serial number) were found between the discovered
       device and that known to the Palm Database. User has chosen to update the Palm
       database.


       Discover Devices, Sequence: 13
       Write changes to Palm persistent memory.



Hach Company Palm Simplicity Detailed Design               Prepared by: Poliac Research Corporation
                                           Page 24 of 49
                                            Confidential

       Discover Devices, Sequence: 14
       Discover process is complete.




3.3.4 Log Sequence Diagram
The following sequence further specifies the log process (see figure 3.6). The log process begins
with a user request to download log information from a device in a defined location.

Ranges in time may be specified for logs requiring user selection of time and date ranges within
those available. To facilitate this, the Connection object first obtains current log ranges from the
device it is downloading from. Then sends the ranges to the user software to limit input range
entries.

The Connection obtains logs by first requesting the log (file) from the device and then waiting for
the log information to become ready for download. This process requires a poll operation with the
device. When files are ready, they are downloaded and stored in persistent Palm memory. There
is a time limit associated when polling devices.




                        Figure 3.6. Palm Simplicity, Device Sequence Diagram.




Hach Company Palm Simplicity Detailed Design                Prepared by: Poliac Research Corporation
                                            Page 25 of 49
                                           Confidential


3.3.4.1.1 Log Sequence Diagram: Sequence 1, Download Logs
Logs are actually stored on the device controller and are obtained from device controllers
by the controller simulating devices responses, where the controller intercepts the request
to the device. The User requests logs for device by first selecting the device and the log
information they want. User may select one of three log opeions: (1) All Log Data, (2)
Data Log Only or (3) Event Log Only. User times may also be selected as a superset of
the selections above. Time selections may be all data, new data or an interval, where the
start and stop times of required data is selected by the user. This requirement uses
methods of the CController class to obtain logs. Assume user has selected requirements
for log in this step, unless a time ranges was requested. In this case
CConnect.GetLogTimeStamps method will get time range of existing log information on
the device. The user must then select log information within this range, if user selects
outside the range, they are notified the range they have chosen is not valid.


       Sequence: 2, Download Logs
       Get valid time interval of existing log information. If user selects All Data” is to be
       downloaded, and Data and Event log times are not equal, an inclusive union of the
       times are created for valid times to choose from.


       Sequence: 3, Download Logs
       Obtain time ranges for logs. As stated above, if user selects “All Data” for
       download, and Data/Event log times are not equal, a union of the times is created
       for valid times to choose from. Ranges are passed back to the Palm UI and used
       to validate user input for log ranges. Palm UI will accept no range outside of this
       range from user.


       Sequence: 4, Download Logs
       User selects valid range from that found on device.


       Sequence: 6, Download Logs
       Palm UI calls CSerialConnection object to handle the work of obtaining log
       information.


       Sequence: 7, Download Logs
       Logs are obtained and stored local to CConnect. CConnect calls CDataFile to
       store the contents of the log with a tag to the related Device.


       Sequence: 8, Download Logs

Hach Company Palm Simplicity Detailed Design               Prepared by: Poliac Research Corporation
                                           Page 26 of 49
                                           Confidential

       Logs are stored in Palm persistent memory.



3.3.5 Connection (SerialConnection) Sequence Diagram
The following sequence diagram (see figure 3.5) further defines the Connection responsibilities.
Note that this version of the Palm Simplicity only uses serial communications. Therefore the
actual name of the Connection Class for this version is CSerialConnection. For most purposes,
the type of connection is not important and therefore the name has not been specific and will
change according to the type of connection.

CSerialConnection helper class ModBus, extends CSerialConnection software functionality and
encapsulates messages as required for the ModBus RTU protocol. Responses received from
devices are also encapsulated in ModBus RTU protocol and also use the ModBus class to extract
responses from devices. As the diagram shows, messages are sent to IrComm for delivery to and
response from a device. Most reply messages contain required responses. When requesting
logs (files), the Serial CSerialConnection object polls the device through IrComm for a file ready
status. There is a time limit associated with polling.




                      Figure 3.5. Palm Simplicity, Device Sequence Diagram.




Hach Company Palm Simplicity Detailed Design               Prepared by: Poliac Research Corporation
                                           Page 27 of 49
                                           Confidential

3.3.5.1.1 CSerialConnection Sequence Diagram: SerialConnection Sequence, 1
Before a message can be sent to a device, they need to be correctly formatted for
transmission in RTU mode. The ModBus class builds messages for transmission and
verifies they are correct the message after they are received from a device. Please see
Hach General Network Interface Specification document for more details.


       SerialConnection, Sequence: 2
       Built message is created. Take the contents of the message and send it to IrComm
       to be transmitted through IRDA.


       SerialConnection, Sequence: 3
       Created RTU ModBus message is sent to IrComm.Transmit.


       SerialConnection, Sequence: 4
       Return value indicates message was successfully sent.


       SerialConnection, Sequence: 5
       In some cases, such as discover, the controller will respond with a message. The
       Serial SerialConnection Class is then responsible for read incoming messages as
       required.


       SerialConnection, Sequence: 7
       Response messages must be decoded from the RTU format and associated CRC
       values validated. ModBus is called with the message to do this work on the
       response message.



       SerialConnection, Sequence: 8
       ModBus is called with the message to retrieve the response message contents.




Hach Company Palm Simplicity Detailed Design               Prepared by: Poliac Research Corporation
                                           Page 28 of 49
                                           Confidential




3.4 PALM SIMPLICITY CLASS DIAGRAM
The following sections define within the diagram below are the major classes used in palm
simplicity. They are a the classes that are responsible for User I/O, Serial communications,
storing location, location devices and logs from devices in persistent PDA memory.




                         Figure 3.7: Class Diagram of Major Class Components.




3.4.1 Class Details
The above class diagram shows persistent storage classes; CLocation, CDevice and CDataFile
classes used for data persistence and CSerialConnection and CmodbusMsg for device
communications. The details of each class are described below.


The intended design benefits from shared software between PDA Simplicity devices by reuse of
the CmodbusMsg class and its extended class (not shown) ModBus_API. Initial intensions to

Hach Company Palm Simplicity Detailed Design               Prepared by: Poliac Research Corporation
                                           Page 29 of 49
                                              Confidential

support a standard set of classes to handle persistence for both Palm and PC simplicity were
abandon after analyses of differences between the two systems handling of persistent storage
showed little benefit. Therefore the CLocation, Cdevice and CdataFile can be written by similar
means but without software reuse.  Database




3.4.1.1 Class: Location
Documentation
Description: Responsible for persistent storage of locations in memory.
Provides methods to set, retrieve and delete location details.
his file inherits from CBaseDB.cpp.

Association Location:Key(0...*) to CDevice
Association Inheritance to CDatabase
Association Device Key(0...1) to CLog


Attribute Summary
public char                   m_szLocation

public unsigned int           m_uiUniqueKey

public Arrayofdoubles         m_ulDevices



Operation Summary
public int                    FindName(Char*)(enumeFirstNext eFirstNext)
public unsignedInt            uiGetInfo(Char* pszLocation)
public unsignedInt            Add(Char* pszLoation)
public int                    Add(stMembers pDevStr)
public int                    Update(stMembers *pDevStr)
public unsignedInt            uiDelete(Char* pszLocation,boolean bForceDelete)
public void                   Get(CLoc::stMembers parameter)
public string                 GetFirstNext(EFirstNext eFirsNext)
public int                    GetDbRecordByIndex(int uiIndex)
public INT                    GetDbRecordByKey()
public char                   IsDevNameUnique(Char* pczDeviceName)
public                        AddDevice(*Device pDev)
                              UpdateDevice(int iDevLocInd,CDevice* pDev,char *pczDN,char*
public int
                              pczSN)
public                        DeleteDevice(int iDevLocInd,CDevice* pDev)
public NULL                   GetDeviceCount()

Hach Company Palm Simplicity Detailed Design                  Prepared by: Poliac Research Corporation
                                              Page 30 of 49
                                            Confidential


public int                    ClearLogs()




3.4.1.1.1 Class: Attribute Detail


public char m_szLocation
Documentation
Character String containing a unique location name.
Initial value: Null


public unsigned int m_uiUniqueKey

Documentation
Unsigned Int containing a unique key for this location.
Initial value: 0


public Arrayofdoubles m_ulDevices
Documentation
Loaded with Unique device keys
Initial value: 0


Multiplicity : 0...*

3.4.1.1.2 FindName
public int FindName(Char*)(enumeFirstNext eFirstNext)

Documentation
Description: Trys to find a Location by passed name.
If found, calls GetFirstNext to load locations attributes of class with found
location.
Parameter Char* pcLocationName - Location name.
Returns: Int - Returns index of found location, else eDBEndOfList
Parameter Detail
    Name : eFirstNext
    Type : enumeFirstNext
    Documentation
    eFirstNext is set to "eFirst" or "eNext" to obtain the appropiate location
    information.



Return Type : int

3.4.1.1.3 Add


Hach Company Palm Simplicity Detailed Design                Prepared by: Poliac Research Corporation
                                            Page 31 of 49
                                            Confidential


public unsignedInt Add (Char* pszLoation)
Documentation
Description: Responsible for adding a new location to the location database.
Also sets a unique location key and stores it with the new location.
If location given is not unique, this method fails and returns -1.
Sets member m_uiUniqueKey to location key in focus.
Sets Member m_szLocation to location name in focus.
Clears both member variables if there is a failure.
Parameter pszLoation: Used to identify a location and stored into the database.
Returns: unsigned int equal the to unique key of the new location entry.
If this routine fails, a return value of -1 is the key is not unique and -1 for
a database failure.
Parameter Detail
    Name : pszLoation
    Type : Char*
    Documentation
    Pointer to a string containing a location name for this entry
Return Type : unsignedInt

3.4.1.1.4 Add
public int Add(stMembers pDevStr)

Documentation
pDevStr *
Takes a structure to the internal m_stMembers struct.
RETURNED: 0 = succesful, else, the code if there was a problem.
Parameter Detail
    Name : pDevStr
    Type : stMembers
    Documentation
    Pointer to the device that is added to a specific location.
    Direction : in
    Default value : NULL
Return Type : int




Hach Company Palm Simplicity Detailed Design                Prepared by: Poliac Research Corporation
                                            Page 32 of 49
                                           Confidential

Update
public int Update(stMembers *pDevStr)

Documentation
Updates an existing location with a new name and devices. PARAMETERS: record -
struct containing the record information.
RETURNED: 0 if there was no problem adding the record
if error,the error code of the problem.
Parameter Detail
    Name : *pDevStr
    Type : stMembers
    Documentation
    Structure containing device parameters
    Default value : Null
Return Type : int



3.4.1.1.5 uiDelete
public unsignedInt uiDelete(Char* pszLocation,boolean bForceDelete)

Documentation
Responsible for deleting locations from memory.
This routine will verify no devices are assigned with this location. If a device
is found in the given location the device is checked for a log. See parameters
below for more information.

Prameter pszLocation: Location to delete.
Prameter bForceDelete: Deletes all locations with Log files if TRUE

Returns: 0 if successful.
If this routine fails, a return value of -1 means a log exists for a device in
the location.
Else, -1 for a database failure.
Parameter Detail
    Name : pszLocation
    Type : Char*
    Documentation
    Pointer to a string containing a location name for this entry
    Name : bForceDelete
    Type : boolean
    Documentation
    If TRUE, all devices with logs are deleted.
    if FALSE, this method will return if a log is found for a device being
    deleted
    the in specified location.
    Default value : FALSE
Return Type : unsignedInt



Hach Company Palm Simplicity Detailed Design               Prepared by: Poliac Research Corporation
                                           Page 33 of 49
                                             Confidential

3.4.1.1.6 Get
public void Get(CLoc::stMembers parameter)
Documentation
Reads in the current record from the database.
Parameter Detail
    Name : parameter
    Type : CLoc::stMembers
    Documentation
    Structure of location data
Return Type : void

3.4.1.1.7 GetFirstNext
public string GetFirstNext(EFirstNext eFirsNext)



Documentation
DESCRIPTION: Retrieves a sting (record) from the MsgLog database.
RETURNED: String of the given record. I
If none, or at end of database returns NULL
Parameter Detail
    Name : eFirsNext
    Type : EFirstNext
Documentation
eDBGetPrev
eDBGetLast,
eDBGetFirst,
eDBGetNext,

Return Type : string




Hach Company Palm Simplicity Detailed Design                 Prepared by: Poliac Research Corporation
                                             Page 34 of 49
                                             Confidential




3.4.1.1.8 GetDbRecordByIndex
public int GetDbRecordByIndex(int uiIndex)
Documentation
If successful, positions the database to the requested index.
RETURNED: eDBSuccess, or eDBFailure
Parameter Detail
    Name : uiIndex
    Type : int
    Documentation

      Index of Location to retrieve.
Return Type : int

3.4.1.1.9 GetDbRecordByKey
public INT GetDbRecordByKey()
Documentation
If successful, positions the database to the requested Unique Location Key.
RETURNED: eDBSuccess, or eDBFailure

Return Type : INT

3.4.1.1.10 IsDevNameUnique
public char IsDevNameUnique(Char* pczDeviceName)

Documentation
DESCRIPTION: Looks through all devices at the current location and compares the
given name with device names.

PARAMETERS: pczDeviceName: Char* - Name to match with.

RETURNED: Returns E_SUCCESS if the name is unique.
Else E_FAIL is returned.

Parameter Detail
    Name : pczDeviceName
    Type : Char*
    Documentation

      Char* - Name to match with.
Return Type : char




Hach Company Palm Simplicity Detailed Design                Prepared by: Poliac Research Corporation
                                           Page 35 of 49
                                           Confidential




3.4.1.1.11 AddDevice
public    AddDevice(*Device pDev)
Documentation
Creates and adds a device to the current location.
  RETURNED: Returns eDBSuccess if the name is unique.
  Else E_SUCCESS is returned.
  Parameter Detail
    Name : pDev
    Type : *Device
    Documentation
    pointer to a device instance
Return Type :

3.4.1.1.12 UpdateDevice
public int UpdateDevice(int iDevLocInd,CDevice* pDev,char *pczDN,char* pczSN)
Documentation
DESCRIPTION: Updates the currently loaded location with values sent as
parameters.

PARAMETERS:
UInt16 iDevLocInd: Index to device to update.
CDevice *pDev: Reference to device that is being updated.
Char *pczDN: Reference to name of device that is being updated.
Char *pczSN: Reference to serial number of device that is being updated.

RETURNED: Returns eDBSuccess if the name is unique.
Else E_SUCCESS is returned.
Parameter Detail
    Name : iDevLocInd
    Type : int
    Documentation
    Index to device to update.
    Name : pDev
    Type : CDevice*
    Documentation
    Reference to device that is being updated.
    Name : *pczDN
    Type : char
    Documentation

         Reference to name of device that is being updated.
    Name : pczSN
    Type : char*
Hach Company Palm Simplicity Detailed Design               Prepared by: Poliac Research Corporation
                                           Page 36 of 49
                                           Confidential

    Documentation
    Reference to serial number of device that is being updated.
Return Type : int



3.4.1.1.13 DeleteDevice
public   DeleteDevice(int iDevLocInd,CDevice* pDev)

Documentation
Deletes logs and device in passed pointer to device.                    Then removes the device
from the device list of the current location.
RETURNED: Returns eDBSuccess if the name is unique.
Else E_SUCCESS is returned.
Parameter Detail
    Name : iDevLocInd
    Type : int
    Documentation
    Index of device to remove from location.
    Name : pDev
    Type : CDevice*
    Documentation
    Reference of device to delete
Return Type :

3.4.1.1.14 GetDeviceCount
public NULL GetDeviceCount()



Documentation

                                                   nt location and
  counts non zero locations as valid existing devices.
  RETURNED: Returns UInt equal to number of devices.




Return Type : NULL

3.4.1.1.15 ClearLogs
public int ClearLogs()
Documentation

                                   of CDevice and Looks through all devices
  at the current location, logs associated with the device are deleted.

Hach Company Palm Simplicity Detailed Design               Prepared by: Poliac Research Corporation
                                           Page 37 of 49
                                           Confidential


  RETURNED: Returns E_SUCCESS if all logs deleted.
  Else E_FAIL is returned.
  Return Type : int




3.4.1.2 CDevice
   Class CDevice

Documentation
Description: Responsible for persistent storage of devices in memory.
Provides methods to set, retrieve and delete device details.
his file inherits from CBaseDB.cpp.
Association association(0...*) to CLog
Association Device Key(0...*) to CLog
Association association to CSerialConnection
Association Location:Key(1) to CLocation
Association association to CSerialConnection


Attribute Summary
private char                  m_szMfgID

private char                  m_szDeviceID

private unsignedInt           m_uiModbusAddr

private char                  m_szIPAddr

private unisgnedint           m_uiLocationKey

private unsignedint           m_uiUniqueKey

private char                  m_szSerialNumber

private char                  m_szDeviceName



Operation Summary
public int                    FindName(char* pChar)
public unsignedInt            Add(stMembers* pDevStr)
public                        Update(Device* pDevStr,ulong* pulUniqueID)
public void                   Get(stMembers*   pstOutput)
public unsignedinteger        GetFirstNext(enumeFirstNext EFirstNext)
public                        GetDbRecordByIndex(unsigned int uiIndex)
public                        GetDbRecordByKey(unisgned int uiIndex)
public                        GetDbRecordByKey(byte* pLog1,byte* pLog2,unsigned Long
Hach Company Palm Simplicity Detailed Design               Prepared by: Poliac Research Corporation
                                           Page 38 of 49
                                           Confidential

                              ulSize1,Unsigned long ulSize2,ELogTypesStored eLogType)
public void                   DeleteLog(eLogType ELogTypesStored)
public void                   DeleteLogs()


Attribute Detail
private char m_szMfgID
Documentation
Contains the Manufacturing ID of the device in focus.
Initial value: Null


private char m_szDeviceID
Documentation
Contains the Device ID of the device in focus.
Initial value: Null


private unsignedInt m_uiModbusAddr
Documentation
Address of device on ModBus
Initial value: 0


private char m_szIPAddr

Documentation
Future - Address of IP
Initial value: Null


private unisgnedint m_uiLocationKey
Initial value: 0
private unsignedint m_uiUniqueKey
Documentation
Contains a unique Device Key ID key for current device. Also used for storing
Logs in CDataFile.

Initial value: 0
private char m_szSerialNumber

Documentation
Contains the serial number for device in focus.
Initial value: Null




Hach Company Palm Simplicity Detailed Design               Prepared by: Poliac Research Corporation
                                           Page 39 of 49
                                           Confidential


private char m_szDeviceName
Documentation
Contains the Device Name of the device in focus.
Initial value: null

3.4.1.2.1 FindName
public int FindName(char* pChar)
Documentation
 Trys to find a Device by passed name
RETURNED: Returns index of found location, else eDBEndOfList

Parameter Detail
    Name : pChar
    Type : char*
    Documentation
    pointer to a string of characters
    Return Type : int




Hach Company Palm Simplicity Detailed Design               Prepared by: Poliac Research Corporation
                                           Page 40 of 49
                                             Confidential




3.4.1.2.2 Add
public unsignedInt Add(stMembers* pDevStr)
Documentation
Takes a string and appends it into Palm Memory named PSLoc
RETURNED:   0 is there was no problem adding the record, and the error code if
there was a problem
Parameter Detail
    Name : pDevStr
    Type : stMembers*
    Documentation

         struct containing the record information.

Return Type : unsignedInt

3.4.1.2.3 Update
public    Update(Device* pDevStr,ulong* pulUniqueID)
Documentation
Updates the device name and device key with values passed.                     makes a call to the
base class to update the instance.
RETURNED:           0 is there was no problem adding the record, and the
error code if there was a problem.
Parameter Detail
    Name : pDevStr
    Type : Device*
    Documentation
    Structure of Device variables.
    Name : pulUniqueID
    Type : ulong*
    Documentation
    Pointer to the device key
Return Type :




Hach Company Palm Simplicity Detailed Design                 Prepared by: Poliac Research Corporation
                                             Page 41 of 49
                                              Confidential




3.4.1.2.4 Get
public void Get(stMembers*       pstOutput)



Documentation
Reads in the current device record from the database.
Parameter Detail
    Name :       pstOutput
    Type : stMembers*
    Documentation

           Not used.
Return Type : void

3.4.1.2.5 GetFirstNext
public unsignedinteger GetFirstNext(enumeFirstNext EFirstNext)

Documentation
Retrieves a sting (record) from the MsgLog database.
RETURNED: String - device name of the given record.
If none, or at end of database returns NULL
Parameter Detail
    Name : EFirstNext
    Type : enumeFirstNext
    Documentation
    enum EFirstNext to obtain the First/Next record
Return Type : unsignedinteger

3.4.1.2.6 GetDbRecordByIndex
public    GetDbRecordByIndex(unsigned int uiIndex)
Documentation
If successful, positions the database to the requested index.
RETURNED: E_SUCCESS if successful, non zero
Parameter Detail
    Name : uiIndex
    Type : unsigned int
         Documentation
         Equal the index requested
Return Type :




Hach Company Palm Simplicity Detailed Design                  Prepared by: Poliac Research Corporation
                                              Page 42 of 49
                                            Confidential

3.4.1.2.7 GetDbRecordByKey
public    GetDbRecordByKey(unisgned int uiIndex)
Documentation
If successful, positions the database to the requested Unique ID.
RETURNED: E_SUCCESS if successful, non zero
Parameter Detail
    Name : uiIndex
    Type : unisgned int
    Documentation
    Equal the index requested
Return Type :

3.4.1.2.8 GetDbRecordByKey
public GetDbRecordByKey(byte* pLog1,byte* pLog2,unsigned Long ulSize1,Unsigned long
ulSize2,ELogTypesStored eLogType)
Documentation
Instantiates the Log database and stores required log data. Links the stored Log
data to the device by reference of the log's unique key.

RETURNED: E_SUCCESS if successful, non zero
Parameter Detail
    Name : pLog1
    Type : byte*
    Documentation
    pointer to log data.
    Direction : in
    Name : pLog2
    Type : byte*
    Documentation
    pointer to extended log data
    Direction : in
    Name : ulSize1
    Type : unsigned Long
    Documentation
    size of Log1 data.
    Direction : in
    Name : ulSize2
    Type : Unsigned long
    Documentation

         size of extended Log2 data.
    Name : eLogType
    Type : ELogTypesStored

Hach Company Palm Simplicity Detailed Design               Prepared by: Poliac Research Corporation
                                           Page 43 of 49
                                           Confidential

    Documentation
    Type of log to add to device
Return Type :

3.4.1.2.9 DeleteLog
public void DeleteLog(eLogType ELogTypesStored)
Documentation
Deletes the type of Logs passed.
RETURNED: void.
Parameter Detail
    Name : ELogTypesStored
    Type : eLogType
    Documentation

      Type of log to delete. Data or Event.
Return Type : void

3.4.1.2.10 DeleteLogs
public void DeleteLogs()

Documentation
Deletes any logs associated with this device.

Return Type : void



3.4.1.3 Class: CLog
  Class CLog
Documentation
Class for handling Palm Simplicity Logs.
Llogs are a special case requiring special file handling because of limited
storage space on the Palm. This file inherits from CBaseDB.cpp.
Association Device Key(1) to CLocation
Association association(1) to CDevice
Association Device Key(1) to CDevice
Association association to CSerialConnection


Attribute Summary
private char                  pczLogData

public unsignedint            uiUniqueKey

private unsigned long         m_ulLogSize2



Hach Company Palm Simplicity Detailed Design               Prepared by: Poliac Research Corporation
                                           Page 44 of 49
                                             Confidential


Operation Summary
public unsignedInt            Add(stMembers* pDevStr)

Attribute Detail


private char pczLogData

Documentation
This pointer is set to the incomming our outgoing buffer of log information to
be stored or retrieved from the database.
Initial value: NULL


public unsignedint uiUniqueKey

Documentation
Contains a unique Device key instance. This value is stored in the database and
used fo find instances relating to a chosen device. It signifies that "this" log
belongs to m_uiDeviceKey.


private unsigned long m_ulLogSize2
Documentation
size of buffer
Operation Detail


public unsignedInt Add(stMembers* pDevStr)
Documentation
Takes a string and appends it into Palm Memory named PSLoc

RETURNED: 0 is there was no problem adding the record, and the
error code if there was a problem.
Parameter Detail
    Name : pDevStr
    Type : stMembers*
    Documentation

      struct containing the record information

    Default value : 0
Return Type : unsignedInt

3.4.1.4 Class: CDatabase
Documentation
This the base class of the three databases used in Palm Simplicity and contains
general base class functionality.
Is Abstract : true

Hach Company Palm Simplicity Detailed Design                 Prepared by: Poliac Research Corporation
                                             Page 45 of 49
                                             Confidential

Is Root : true
Visibility : private
Association Inheritance to CLocation


Attribute Summary
Private char                  m_szDatabasePath

Private unsignedInt           m_uiLastKey



Operation Summary
public char                   szGetFirsNext(void eFirstNext)
public unsigned Int           uiGetNextKey()



Attribute Detail


Private char m_szDatabasePath
Documentation
Not Used


Private unsignedInt m_uiLastKey

Documentation
Tracks last key assigned to a location. This value is incremented each time it
is called and rolls over when it reaches 65535.
Operation Detail


public char szGetFirsNext(void eFirstNext)

Documentation
Description: Responsible for reading data from Palm persistant storage.
Parameter iFirstNext: Set to enum eFIRST to get the first location in memory.
Set to enum eNEXT to get next consecutive location in memory.
Returns: UnsignedInt containing the Key of object in focus. This value will be
NULL if
the end of the list is reached.

Parameter Detail
    Name : eFirstNext
    Type : void
    Documentation
    eFirstNext is set to "eFirst" or "eNext" to obtain the appropriate device
    information.
    Default value : eFirst
Hach Company Palm Simplicity Detailed Design                Prepared by: Poliac Research Corporation
                                           Page 46 of 49
                                           Confidential

Return Type : char



3.4.1.4.1 uiGetNextKey
public unsigned Int uiGetNextKey()

Documentation
Description: Used to locate the next valid key value for a new device.
Returns: 0 if successful, else -1
Return Type : unsigned Int




Hach Company Palm Simplicity Detailed Design               Prepared by: Poliac Research Corporation
                                           Page 47 of 49
                                               Confidential




3.4.2 Palm Simplicity Forms
Documentation

  PalmSimplicity.cpp - Handles the main screen and menu functions also handles
  discover operation.
  FrmLocDetails.cpp - Handles displaying and updating the Location Details
  Screen.
  FrmClearLogs.cpp - Handles clearning logs from locations.
  FrmDevices.cpp - Handles displaying the devices screen and assoicated menu
  functionality.
  FrmDevDetails.cpp - Handles displaying and updating the device details.
  FrmIntervl.cpp - Handles the display and entry of time intervals for logs.
  FrmDownLoad.cpp - Handles Log downloading.

Depend to:
    Communication Classes

3.4.3 Communication Classes
    Class, CSerialConnect, Modbus, ClrDaPort
Depended by:
    Palm Simplicity Forms



  Association Location:Key

Association End From
    Element : CLocation
    Multiplicity : 1
Association End To
    Element : CDevice
    Multiplicity : 0...*



  Association Device Key

Association End From
    Element : CDevice
    Multiplicity : 1
Association End To
    Element : CLog
    Multiplicity : 0...*




Hach Company Palm Simplicity Detailed Design                  Prepared by: Poliac Research Corporation
                                           Page 48 of 49
                                           Confidential

3.4.3.1 Class: CSerialConnect
Documentation
This Class is used to communicate to Palm through the IrDa Port.                    It uses the
Modbus and serial classes to accomplish requirements.
This class is a modified version of software owned by HACH company Parent :
Communication Classes
Association association to ClrDaPort
Association association to Modbus

3.4.3.2 Class: Modbus
Documentation
This class is responcible for helping the CSerialClass communicate to Hach
equipment through the Modbus protocal. This class raps and unraps messages so
they are compatable with Modbus.
Parent : Communication Classes
Association association to CSerialConnect

3.4.3.3 Class: ClrDaPort
Documentation
This class supports the basic I/O to and from the PDA's IR port.
Parent : Communication Classes
Association association to CSerialConnect




Hach Company Palm Simplicity Detailed Design               Prepared by: Poliac Research Corporation
                                           Page 49 of 49

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:4
posted:10/2/2011
language:English
pages:49