Ambulance Dispatch System - PowerPoint PPT Presentation

1 / 11
About This Presentation
Title:

Ambulance Dispatch System

Description:

Instead of choosing a day, week, month, or year to display, the user chooses a ... MemoryStream ms = new MemoryStream(); BinaryFormatter bf = new BinaryFormatter ... – PowerPoint PPT presentation

Number of Views:208
Avg rating:3.0/5.0
Slides: 12
Provided by: jamie102
Category:

less

Transcript and Presenter's Notes

Title: Ambulance Dispatch System


1
Ambulance Dispatch System
  • Jamie Smith
  • Chris Rohleder
  • Jeff Dix

2
Design Changes
  • Management Reporting System
  • Instead of choosing a day, week, month, or year
    to display, the user chooses a starting and
    ending time.
  • Information Retrieval
  • This component was removed for the first release
    of the system.
  • This was not an essential component.

3
(No Transcript)
4
Design Changes (cont.)
  • Contact phone number not required
  • Not used in checking for duplicate calls.
  • Required Fields
  • Location of Incident
  • Type of Incident
  • Priority
  • Number of Patients

5
(No Transcript)
6
Encountered Problems
  • Networking
  • Unfamiliar with networking in C
  • Cannot send objects over network.
  • As opposed to Java.
  • Must use byte arrays.
  • Serialization
  • Have to encode and decode each field in object.

7
Serialized Object Example
  • SerializableAttribute
  • public class Ambulance Object, ISerializable
  • int number
  • bool available
  • long timeTilAvailable
  • protected Ambulance(SerializationInfo info,
    StreamingContext context)
  • try
  • number info.GetInt32("number")
  • available info.GetBoolean("available")
  • timeTilAvailable info.GetInt64("tim
    eTilAvailable")
  • catch (Exception ex)
  • Console.WriteLine("Exception "
    ex)
  • SecurityPermissionAttribute(SecurityAction.Demand
    ,
  • SerializationFormatter true)
  • // Satisfies rule ImplementISerializableCo
    rrectly.
  • public virtual void GetObjectData(
  • SerializationInfo info,
    StreamingContext context)
  • info.AddValue("number", number)
  • info.AddValue("available",
    available)
  • info.AddValue("timeTillAvailable",
    timeTilAvailable)

8
Serialize Method
  • public static byte serialize(object myObject)
  • MemoryStream ms new MemoryStream()
  • BinaryFormatter bf new
    BinaryFormatter()
  • bf.Serialize(ms, myObject)
  • byte sendArray ms.ToArray()
  • return sendArray

9
Deserialize Method
  • public static object deserialize(Byte bytes)
  • object objectReceived null
  • // Translate data bytes to a ASCII
    string.
  • MemoryStream ms new
    MemoryStream(bytes)
  • BinaryFormatter bf new
    BinaryFormatter()
  • ms.Position 0
  • try
  • objectReceived
    bf.Deserialize(ms)
  • catch (System.Runtime.Serialization.Se
    rializationException e)
  • Console.WriteLine("Serialization
    ERROR " e.Message)
  • return objectReceived

10
Database Schema
  • MySQL Database Table Layout

11
Database Query Example
  • "select from callinfo where "
  • "(CallerName LIKE " like(name) " AND
    LocIncident LIKE " like(loc) " AND
    TypeIncident LIKE " like(type) " ) OR "
  • "(CallerName LIKE " like(name) " AND
    TypeIncident LIKE " like(type) " AND Priority
    LIKE " like(pri) " ) OR "
  • "(CallerName LIKE " like(name) " AND
    LocIncident LIKE " like(loc) " AND Priority
    LIKE " like(pri) " ) OR "
  • "(LocIncident LIKE " like(loc) " AND
    TypeIncident LIKE " like(type) " AND Priority
    LIKE " like(pri) " )"
Write a Comment
User Comments (0)
About PowerShow.com