Vous êtes sur la page 1sur 45

UNIVERSITY OF ESSEX - CSEE

Building An ARM Main

Board Emulator

Project Proposal

Abhishek Paul Bedford

A thesis submitted for the degree of Master of Science in Embedded Systems.

Supervisor: Dr. Martin Colley

School of Computer Science and Electronic Engineering

University of Essex
SURNAME : Paul Bedford

OTHER NAMES : Abhishek

QUALIFICATION SOUGHT : Master of Science

TITLE OF PROJECT : Building an ARM Main Board

Emulator

SUPERVISOR : Dr. Martin Colley

DATE : August 2014

Abstract
The paper describes in detail the various steps involved in designing and building an

ARM main board emulator as a M.Sc. project. The aim of the project was to design

and build a software emulator that would emulate all the functions of the ARM board

that is being used as a teaching aid in the laboratories. The project began with a

carefully thought out plan according to which it was divided into three sections, the

emulator GUI, the library functions and the communication system between the user

program and the emulator. The project has been completed using Winsock TCP

sockets for the communication and Qt Creator to build the emulator GUI and has

been written almost entirely using the C++ programming language.

This project dissertation is in accordance with Examination Regulations 6.12 and 6.13.
Contents
ABSTRACT ........................................................................................................................ 1

CONTENTS ....................................................................................................................... 2

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

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

1.2 PURPOSE OF THIS DOCUMENT.................................................................................................... 5

1.3 OVERVIEW............................................................................................................................. 5

2. SYSTEM DESCRIPTION ............................................................................................... 6

2.1 USER CHARACTERISTICS ........................................................................................................... 7

2.2 ASSUMPTIONS ........................................................................................................................ 7

2.3 LITERATURE REVIEW ................................................................................................................ 7

2.3.1 Emulators .................................................................................................................... 8

2.3.2 Graphical User Interfaces............................................................................................ 8

2.3.3 TCP/IP protocol ........................................................................................................... 9

2.3.4 Sockets ........................................................................................................................ 9

2.3.5 Multithreading .......................................................................................................... 11

2.4 TOOLS ................................................................................................................................ 12

2.4.1 Eclipse........................................................................................................................ 12
2.4.2 Qt Creator ................................................................................................................. 12

3. SOFTWARE METHODOLOGY AND PLANNING ........................................................... 13

3.1 SOFTWARE MODEL ................................................................................................................ 13

3.1.1 Requirements ............................................................................................................ 14

3.1.2 Analysis ..................................................................................................................... 15

3.1.3 Design........................................................................................................................ 16

3.2 SCHEDULING ........................................................................................................................ 16

4. SYSTEM ARCHITECTURE .......................................................................................... 17

4.1 THE COMPILER //LIBRARIES AND HEADERS ................................................................................ 18

4.1.1 LED Functions ............................................................................................................ 23

4.1.2 Button Functions ....................................................................................................... 24

4.1.3 Seven Segment Display Functions ............................................................................. 25

4.1.4 Communication function ........................................................................................... 26

4.2 SOCKETS ............................................................................................................................. 26

4.3 THE EMULATOR INTERFACE ..................................................................................................... 26

5. PROBLEMS ENCOUNTERED ...................................................................................... 28

6. TESTING .................................................................................................................. 29

6.1 THE HIGH LEVEL TEST PLAN .................................................................................................... 30


7. RESULTS .................................................................................................................. 31

7.1 SCOPE FOR IMPROVEMENT ..................................................................................................... 31

8. CONCLUSION .......................................................................................................... 32

9. REFERENCES ............................................................................................................ 33

10. APPENDIX ............................................................................................................ 35

10.1 CODE SNIPPETS ................................................................................................................. 35

10.1.1 Socket Client .......................................................................................................... 35

10.1.2 GUI Interface .......................................................................................................... 36

10.2 GANTT CHART ................................................................................................................... 43


1. Introduction

1.1 Overview

The project began with the aim to build a graphical emulator of a custom ARM board

used in the University of Essex laboratory that could effectively be used as a

teaching aid for both students as well as staff. The ARM board consists of eight

LEDs, eight buttons and an OLED display that can be configured as a seven

segment display. Additionally, an expansion audio board and an expansion board

with a motor may be attached to the board. The emulator would have to be able to

mimic the functions of the LEDS, buttons and LCD display exactly as on the actual

board. This has been achieved using C++ and Qt library functions.

1.2 Purpose of this document

The purpose of this document is to explain in detail the background, the necessity,

the implementation methodology and the outcomes of building an ARM Board

Emulator as a M.Sc. project.

1.3 Overview

The document is divided into the following sections:

 A general introduction, where a brief overview of the project including its purpose

and scope is discussed,

 A detailed system description which takes a more detailed look at the system,
 A software methodology section which discusses the software model chosen with

its advantages as well as taking a look at the project plan,

 A system architecture section where the architecture of the entire system is

broken up into smaller sections and discussed,

 A section that details the major setbacks and problems faced during planning

and implementation,

 A testing section in which the high level testing results are discussed in brief and

 A results section which discusses the results of the project as a whole.

The document ends with a list of references, a glossary of terms used in the

document and an appendix section.

2. System Description
The idea behind the ARM board emulator is to emulate the various functions of an

ARM board that is being used in the University of Essex laboratories as a teaching

aid. These functions include the eight buttons that can be either ON or OFF (i.e. two

state), eight LEDs that can either be off, red, green or orange and an OLED display

that can be used to display text or graphics and can also be configured for use as a

seven segment display.

The ARM board that is used by students in the laboratory is only available to be

used by students for a limited amount of time during the week. This might result in

the disability of students to work on projects or assignments at their convenience. By

using the ARM board emulator, students will be able to run and test their programs
at any time without having to be totally dependent on the availability of the physical

board. This will allow students to work on their assignments anywhere they want by

simply including alternate library files to their code and running a function to

establish connection to the emulator. This makes the entire process very easy and

straight forward. Wholesale change to the code will not be required. All the user

needs to do is change the header files that will allow them to connect to the emulator

rather than to the actual ARM board.

2.1 User Characteristics

The emulator will be perfect for students or staff who want to quickly test code that

they have written for the ARM board and either do not or cannot go to the lab to test

the code.

2.2 Assumptions

During the design phase of the system, it was assumed that the ARM board

emulator would only be used by students to test their codes for embedded systems

coursework, using the predefined functions to carry out the laboratory tasks and

assignments and has hence been designed accordingly.

2.3 Literature review

To successfully implement the ARM Board Emulator, a large amount of back ground

reading and research had to be carried out. Due to a lack of prior knowledge, topics

such as networking and GUI programming had to be learnt from the very basics. The

following section summarises the topics that have been read about for the project.
2.3.1 Emulators

In computer science, an emulator may be defined as a software system that

attempts to emulate a particular system by using a micro program, thus enabling it to

carry out the same functions, to run the same programs, and in essence, to behave

exactly how the original system behaves [1].

For this specific project, an emulation of the ARM board, rather than a simulation,

was ideal since it was not required to build a system which would replicate the

working of the actual processor [2][3]. If an ARM board simulator was to be built, all

the functions, including the processor would have to be simulated and that was not

required for this specific project. Advantages of using an emulator include

 In the long run, using an emulator will be much cheaper than purchasing new

hardware.

 Since an emulator is a software tool, modifications and improvements can easily

be made with relatively less effort than the effort it would take to modify an actual

board.

 Software emulators are in general much more portable than the actual hardware.

2.3.2 Graphical User Interfaces

By definition, “An interface that is used to issue commands to a computer by means

of a device such as a mouse that manipulates and activates on screen images” [4].

The Graphical User Interface, or the GUI in short, is what the user will see and

interact with. A GUI allows users to interact with a program by making use of a
number of objects such pictures, icons, buttons, text boxes, etc. which accept data

from the user and relays this to the program to carry out a specified operation. The

alternative to using a GUI would be to use a command line interface. The problem

with using a command line interface is that it is not as user friendly as a GUI and

needs special practice and knowledge of the necessary commands for the user to

use the application effectively, while a GUI is much simpler and can be used by

anybody without any specific prior knowledge [5].

The ARM board emulator GUI has been built using C++ and Qt Creator and has

been made to resemble the actual ARM board as closely as possible, so that the

user can use the ARM Board Emulator without too much difficulty.

2.3.3 TCP/IP protocol

TCP is a Transmission Control Protocol which is used to ensure that connections

are established and maintained between transmitting and receiving entities. Internet

Protocol (IP) is a protocol to handle addresses. Even though the protocol is called

TCP/IP, it is actually a full set of protocols including ARP, OSFP, ICMP, BGP/EGP,

SNMP, PPP, SMTP and POP3/IMAP4 [6].

2.3.4 Sockets

A socket is a communications connection point that may be named and addressed

in a network. Sockets allow communication to occur between processes on the

same machine, distribute information and allow access to centralized data easily [7].

Sockets can use two different methods of communication – TCP or UDP. UDP

stands for User Datagram Protocol and is not a secure method of data transfer.
When using UDP, the client does not explicitly connect with a server. Instead, the

client transmits data and assumes that the server receives it [8]. TCP, on the other

hand, only allows data transmission after a secure connection has been established.

Socket application program interfaces (APIs) are the network standard for TCP/IP. A

wide range of operating systems support socket APIs [9].

Socket transmission is theoretically very simple. It consists of a server which, when

given an IP address and port number, will listen for an incoming connection on that

specific port of that specific IP address. The other end of the socket is called the

client. This is the end that wishes to connect to the server. To connect to the server,

the client needs the specific IP address and port number on which the server is

listening. If both the client and the server have the same IP address and port

number, then a connection can be established and data can be transmitted and

received between the client and the server until the connection is closed or broken.

Using sockets is a reliable and secure method of data transmission and results in

very low data loss.


Figure 1: Socket connection

2.3.5 Multithreading

Multithreading is the process of creating multiple threads to work on the same

processor. All though the threads use the same processor, each thread may be

programmed to run independently. The advantage of using multithreading is that the

system can have multiple tasks running at the same time which improves efficiency

of the system when the code is executed on systems with multiple core CPUs [10].
2.4 Tools

After careful consideration of a number of different tools that could be used to carry

out the project, Qt Creator and Eclipse were selected as the most simple and

effective tools that could be used to carry out the project.

2.4.1 Eclipse

Eclipse is a Java based open source ‘Integrated Desktop Environment’ that can be

customised using plug-ins to develop applications in a number of programming

languages [11]. The main reasons for choosing Eclipse are

 This is the tool that is used by students in the laboratory to run their code. Using

Eclipse would mean that they do not have to use another tool just to be able to

use the emulator.

 It is an open source tool and thus available freely to everyone.

2.4.2 Qt Creator

Qt Creator is a cross platform IDE that uses the Qt GUI Application development

framework to allow users to build powerful GUIs [12]. Qt Creator was chosen for this

project because

 Qt Creator comes with a lot of tutorials and documentation which makes it easy

for beginners to learn GUI programming.

 Qt Creator uses the Qt GUI Application development framework which is platform

independent and can thus be used on any platform.

 Qt Creator, like Eclipse, is available freely to use.


3. Software Methodology and Planning

3.1 Software model

The software model that has been chosen for this project is the waterfall model. This

is a sequential model, used to create different kinds of software, where project

development is seen as flowing steadily downwards like a waterfall through its

various phases. This is mainly due to the simplicity of the model. Because only a

single person is going to be working on the project, the simplicity of the software

model is an advantage since it allows for a systematic approach to the project.

The waterfall model emphasizes a step by step approach to accomplish the target

within a given time frame [13].


Figure 2. The Waterfall model

3.1.1 Requirements

During the requirements gathering phase of the project, the following requirements

were decided upon.

 Build a clean, simple and efficient GUI application that would look and feel similar

to the actual ARM board.


 Add buttons, LEDs and a display unit to the GUI that function the same way the

LEDs, the buttons and the OLED display on the ARM board function.

 Write library functions that will translate the embedded C code written by the user

into a control word that will carry out the specified functions on the emulator GUI.

 Find a way to establish a connection between the emulator GUI and the user

code to send and receive the control word.

3.1.2 Analysis

Each of the requirements stated above were carefully analysed and different

methods and techniques to implement each of the different requirements were

considered. Initially, Microsoft Visual Studio was considered as the tool that would

be used to build the emulator GUI, since it offered a number of built in options that

would be extremely useful for this specific project. Visual Studio also had the

advantage of having an excellent debugger built in. But after a lot of research, Qt

creator presented itself as a better tool. The reasons for choosing Qt Creator were

that it was much easier to use than Visual Studio, had a larger number of powerful

options that were specifically designed for GUI application development and also

came built in with tutorials and examples that aided development.

Similarly, after extensive research, Microsoft’s Winsock was used to build the client

end of the communication socket due to comprehensive documentation in the

Windows MSDN websites, while Qt’s QtTcpSocket was used to build the server end

of the communication sockets.


The library functions that were written for the emulator would carry out all the

functions that the custom functions that were provided to students would

accomplish.

3.1.3 Design

The project design was kept as simple as possible. The project has been designed

in such a way that the emulator functions exactly how the elements of the actual

ARM board function.

1. Custom library functions were written to generate a control word. These libraries

would have to be included by the user to their code.

2. The library functions, when executed, would initialise the socket Client and

attempt to connect to the socket server.

3. The Emulator GUI would replicate all the functions of the actual ARM board.

4. When executed, the emulator would initialise the socket server and begin to wait

for a connection from the client.

5. Once a connection was established, the control word generated by the library

functions would be sent and received by the sockets, thus enabling the user to

programmatically control the emulator GUI.

3.2 Scheduling

The project schedule had been planned out across the summer term, i.e. from the

9th of June to the 20th of August 2014. The detailed Gantt chart can be found in the

appendix. The project implementation went largely according to plan.


4. System Architecture
In its simplest form, the ARM board emulator is a graphical user interface that will

attempt to mimic the working of the physical ARM board produced by Atmel that is

used in the University of Essex labs to teach embedded systems. Any code that is

written in eclipse, when run, will send an appropriately constructed control word to

the emulator based on which the emulator will respond with either an action or a

return value. The control word is generated and transmitted by using the custom

libraries that were written specifically for this project. These libraries must be

included in the original user code instead of the libraries provided in the lab. The

functions, when called, will establish a TCP socket connection with the emulator,

where the emulator will act as the server.


Figure 3. System architecture

4.1 The Compiler - Libraries and Headers

A compiler, in general, is a computer program that converts code written in a

programming language into a language that a computer can understand and

execute [15]. In our case, the compiler is used to compile the code written by

students. This is normally in C. The user code will typically contains library files that
allow the program to manipulate the ARM hardware. To use the emulator, these files

should be replaced with the custom emulator library files.

The library files contain functions that act as transmission and translation

components. When the user runs their program, a control word is created by the

functions and transmitted to the Emulator using the TCP sockets. The control word

is an integer array that specifies all the different operations that can be carried out by

the emulator. Based on the Function value, control is shifted between LEDs, buttons

and the seven segment display.

ARRAY VALUE FUNCTION

1 LED functions.

2 Button functions.

3 Seven Segment Display functions.

Table 1: Control word function values

If the function field has an array value 1, i.e. it is set to LED functions, the next two

array elements will denote the LED number and colour respectively.
ARRAY VALUE (LED) LED NUMBER LED COLOUR

1 LED 1 RED

2 LED 2 GREEN

3 LED 3 ORANGE

4 LED 4 OFF

5 LED 5 -

6 LED 6 -

7 LED 7 -

8 LED 8 -

9 ALL LEDs -

Table 2: Control word LED function values

If the function field is set to an array value of 2, i.e. button functions, then the next

two array elements will represent the button number and the request type

respectively.
ARRAY VALUE
BUTTON NUMBER REQUEST TYPE
(BUTTON)

1 BUTTON 1 PRESSED

2 BUTTON 2 RELEASED

3 BUTTON 3 -

4 BUTTON 4 -

5 BUTTON 5 -

6 BUTTON 6 -

7 BUTTON 7 -

8 BUTTON 8 -

Table 3: Control word Button function values

When the function field is set to 3, then the control word will control the seven

segment display. The next two array elements will hold the values of the digit

number and digit value respectively.


ARRAY VALUE (DIGIT) DIGIT NUMBER DIGIT VALUE

1 DIGIT 1 1

2 DIGIT 2 2

3 DIGIT 3 3

4 DIGIT 4 4

5 Decimal Point 5

6 - 6

7 - 7

8 - 8

9 - 9

0 - 0

Table 4: Control word Seven Segment Display function values

The different library functions that have been implemented to be used for the

emulator are listed below.


4.1.1 LED Functions

Figure 4: LEDs on the GUI

FUNCTION NAME PURPOSE

LEDSALLOFF() Sets all eight LEDs off.

LEDSALLRED() Sets all eight LEDs red.

LEDSALLGREEN() Sets all eight LEDs green.

LEDSALLORANGE() Sets all eight LEDs orange.

SETLEDCOLOR(LEDNUMBER LED, Sets the specified LED to the

LEDCOLOUR COLOUR) specified colour.

SETALLLEDS(LEDCOLOUR COLOUR) Sets all eight LEDs to the

specified colour.

Table 5: LED functions


4.1.2 Button Functions

Figure 5: Buttons on the GUI

FUNCTION NAME PURPOSE

GETBUTTONSTATE(BUTTONSTATE Gets the state of all specified

LIST[]) buttons from the Emulator.

ISBUTTONPRESSED(BUTTONNUMBER Emulator returns TRUE if specified

BUTTON) button is pressed.

ISBUTTONRELEASED(BUTTONNUMBER Emulator returns TRUE if specified

BUTTON) button is not pressed.

Table 6: Button function

The emulator carries out all the functions based on the control word received from

the user and responds with button state if and when it is requested.
4.1.3 Seven Segment Display Functions

Figure 6: Four Digit Seven Segment Display on the GUI

FUNCTION NAME PURPOSE

CONFIGURE7SEGMENTDISPLAY() Configures the

Emulators 7 segment

display.

SET7SEGMENTDISPLAYVALUE(DISPLAYNUMBER Sets the value of the

NUMBER, SHORT VALUE) specified display

number to the specified

value.

Table 7: Seven segment Display functions

Future implementations of the project may include library functions to control the

OLED display.
4.1.4 Communication function

The client socket can be initialised and connected to the server socket at the

emulator end by using the ConnectToServer() function. The ConnectToServer()

function uses Winsock to create a socket client and attempts to establish a

connection with the server that is listening to the port 8888 on the localhost.

4.2 Sockets

If the user was to run his code on the actual ARM board, communication from the

compiler to the ARM board would require a remote connection to the hardware from

the computer. Open OCD is an open source On-Chip Debugger which is used to

provide on chip debugging, in-system programming and boundary-scan testing for

embedded target devices [14]. A debug adapter hardware module is used to

generate the electrical signals to the debug target to negate the lack of native

support from the debug hosts to connect with the target. In this case a JTAG adapter

is used.

For the user to connect to the emulator, TCP socket connections are used. A socket

connection, as explained earlier, is a client- server connection where the emulator

acts as the server and waits for information from the client, i.e. the user to carry out

operations on the interface. The implementation of the client side of the socket

connection was based on the example provided by Dr. Martin Colley

4.3 The Emulator Interface

The Emulator interface has been designed to look and feel exactly like the actual

ARM board. It has eight check boxes which represent the eight two state buttons,
eight coloured text labels which represent the eight LEDs in each of their different

states, i.e. off, red, green or orange. It also has a text display and a seven segment

display unit. In addition to the 8 buttons, there is an additional button added which is

a ‘Release All’ button. This button may be used to release multiple buttons

simultaneously. This is to make the emulator’s button functionality exactly like the

functionality of the ARM board.

Figure 7 is a snap shot of the clean and simple GUI that has been achieved.
Figure 7. The Emulator Interface

The emulator will have a software socket or adapter with which it can receive and send

data from the client socket.

5. Problems Encountered
A number of problems were encountered during implementation.

 GUI programming was an entirely new concept that had to be learnt from the

basics. Using Qt Creator helped greatly because of the large number of different

tutorials and examples that are included. The Qt documentation was also very

helpful.

 Basic networking, much like GUI programming, was a whole new experience and

required extensive reading and experimenting with Winsock, telnet and

QtTcpSockets before a working program could be achieved.

 A Windows socket error (Error 10106: WSAEPROVIDERFAILEDINIT) caused a

lot of delay in implementation. After exploring different methods of fixing the

problem, a Windows Registry fix solved the issue. According to the MSDN

website [16],

WSAEPROVIDERFAILEDINIT Service provider failed to initialize.

10106 The requested service provider could not be loaded or

initialized. This error is returned if either a service

provider's DLL could not be loaded (LoadLibrary failed)

or the provider's WSPStartup orNSPStartup function

failed.

Table 8: Winsock Error

 Another problem that had to be worked around was that on the actual ARM

board, multiple buttons could be held down and released simultaneously.

Implementing this on the emulator GUI proved a challenge. The problem was

solved by using check boxes to represent the buttons and adding an additional

“Release All” button which would release all checked buttons immediately.

 Finally, the only problem that hasn’t been solved at this time is the transmission

and reception of the control word as an integer array. The program works as

expected when single integers are transmitted, but breaks every time an array is

transmitted.

6. Testing
AS per the waterfall methodology, all code that was written was thoroughly tested.

Some of the important test results are listed below.


6.1 The High Level Test Plan

The High level test plan is depicted in Table 9.

High Level Test Plan


HLTP No. High Level Scenario description Expected results Actual Results Pass/Fail Comments
The GUI should load The GUI loads
1 Test if the GUI loads correctly. Pass
correctly. correctly
All eight buttons should All eight buttons
Test if all eight buttons are
2 be displayed and should are displayed and Pass
displayed and are clickable.
be clickable. are clickable.
All eight LEDs should be All eight LEDs are
Test if all eight LEDs are
displayed and should displayed and
3 displayed and change colour Pass
change colour when change colour
when instructed.
instructed. when instructed.
Only the seven
The display unit should The display unit is segment
Test if the display unit is visible
be visible and the digits visible and the application of the
4 and the digits can be set when Pass
should be set when digits can be set OLED display has
instructed.
instructed. when instructed. been implemented
and tested.
Test if the server socket is The server socket should The server socket is
5 Pass
created. be created. created.
The client socket should The client socket is
Test if the client socket is
be created and should created and able to
6 created and able to connect to Pass
be able to connect to the connect to the
the server socket.
server socket. server socket.
Data
At this time, only
Test if data communication is Data communication is communication is
characters and
7 possible between the client and possible between the possible between Pass
strings are being
the socket. client and the socket. the client and the
received.
socket.
The user program
The user program should
Test if the user program can be compiles and
compile and execute
8 compiled and executed using executes when the Pass
when the custom library
the custom library functions. custom library
functions are used.
functions are used

Table 7: High Level Test Plan

As seen from the test results, with exception to transmitting and receiving the control

word, all other functionality of the emulator function as expected.


7. Results
The aim of the project was to design and build an application that would successfully

emulate all the functions of the ARM board that is used in the Embedded Systems

Laboratory at the University of Essex. Within the given time period, a number of

objectives were achieved, while a few points to be improved upon were also noted

 The GUI for the emulator, including eight buttons with ON/OFF states, eight

LEDs in four different states (OFF/RED/GREEN/ORANGE) and a minimal seven

segment display unit has been built and tested successfully.

 The Library functions to control each of the GUI elements has been written and

tested successfully. A full list of the library functions written can be found in

section 3.1 of this document.

 A server socket has been successfully implemented into the emulator. The

server socket, when enabled, waits for a connection from a client on the localhost

using a specific port. If a connection is established with the client, it begins to

send and receive data using the TCP network.

 A Winsock client socket has been successfully added to the library files that the

user will need to add to their program. This client socket will transmit the control

word generated by the library functions and send it to a specified port on the

localhost to connect and exchange data with the server socket of the emulator.

7.1 Scope for Improvement

Even though the project implementation was largely successful, there are a number

of areas where there is a scope for improvement.


 Due to time constraints, the library functions to control the OLED display were

not implemented. This can be done in the future if more time was available.

 The visual appeal of the GUI can be improved.

 The two expansion boards – the audio board and the motor board, may be

emulated as well.

8. Conclusion
As stated earlier, the main objective of the project was to build an emulator that

could be used by students and staff to test their embedded programming code at

their convenience without having to go to the lab every time. To a certain extent,

given the limited time available, the objective has been achieved. Topics such as

networking, including socket programming and basic TCP/IP and GUI programming

had to be learnt from the basics and used for project implementation. Despite all the

hurdles, a working system has been developed, tested and implemented.


9. References
[1] Dictionary.com, "Emulators," in Dictionary.com Unabridged. Source location:

Random House, Inc. http://dictionary.reference.com/browse/emulators.

Available: http://dictionary.reference.com. Accessed: March 20, 2014.

[2] Rothenberg, Jeffrey. "The Emulation Solution." Avoiding Technological

Quicksand: Finding a Viable Technical Foundation for Digital Preservation.

Washington, DC: Council on Library and Information Resources, 1998.

[3] van der Hoeven, Jeffrey, Bram Lohman, and Remco Verdegem. "Emulation

for Digital Preservation in Practice: The Results." The International Journal of

Digital Curation 2.2 (2007): 123-132.

[4] Dictionary.com, "GUI," in the American Heritage® Science Dictionary. Source

location: Houghton Mifflin

Company. http://dictionary.reference.com/browse/GUI.

Available: http://dictionary.reference.com. Accessed: March 20, 2014.

[5] Rimmer, Steve, Graphical User Interface Programming, the University of

Michigan, Windcrest/McGraw-Hill, 1992.

[6] Hayden, Matt. Teach Yourself Networking. Teach Yourself Networking.

Indianapolis: Macmillan Computer Publishing, 1998, pp. 42-44.

[7] Dumas, Arthur, Programming Winsock, Indianapolis, Sams Publishing, 1995.

[8] Kurose, J. F.; Ross, K. W., Computer Networking: A Top-Down Approach

(5th Ed.). Boston, MA: Pearson Education, 2010.


[9] http://publib.boulder.ibm.com/infocenter/iseries/v5r3/index.jsp?topic=%2Frza

b6%2Frzab6soxoverview.htm , Accessed: March 21, 2014.

[10] Dictionary.com, "Multithreading," in the Free On-line Dictionary of Computing.

Source location: Denis

Howe. http://dictionary.reference.com/browse/multithreading.

Available: http://dictionary.reference.com. Accessed: March 20, 2014.

[11] "Where did Eclipse come from?", Eclipse Wiki. Retrieved 16 July, 2014.

[12] http://qt-project.org/wiki/category:tools::qtcreator, Accessed: June 10, 2014.

[13] Gomaa, Hassan. Software Modeling and Design: UML, Use Cases, Patterns,

and Software Architectures. Software Modeling and Design: UML, Use

Cases, Patterns, and Software Architectures. Cambridge: Cambridge

University Press, 2011.

[14] Contributors, Wikipedia. Gdbserver. Wikipedia, the Free Encyclopaedia.

[Online] November 30, 2013.

http://en.wikipedia.org/w/index.php?title=Gdbserver&oldid=583885733,

Retrieved 21 June 2014.

[15] Dictionary.com, "Compiler," in Dictionary.com Unabridged. Source location:

Random House, Inc. http://dictionary.reference.com/browse/compiler.

Available: http://dictionary.reference.com. Accessed: March 20, 2014.

[16] http://msdn.microsoft.com/en-gb/library/windows/desktop/ms740668.aspx,

Accessed: August 5, 2014.


10. Appendix

10.1 Code Snippets

10.1.1 Socket Client

The following code was based on code provided by Dr. Martin Colley and example

code from the MSDN website.

int ConnectToServer()
{
WSADATA wsa;
SOCKET s;
struct sockaddr_in server;

printf("\n Initialising Winsock... \n");

if (WSAStartup(MAKEWORD(2,2),&wsa) != 0)
{
printf("Failed. Error Code : %d",WSAGetLastError());
return 1;
}
else
{
printf("Initialised.\n");
}

//Create a socket
if((s = socket(PF_INET , SOCK_STREAM , 0 )) == INVALID_SOCKET)
{
printf("Could not create socket : %d" , WSAGetLastError());
}
else
{
printf("Socket created.\n");
}

server.sin_addr.s_addr = inet_addr("127.0.0.1");
server.sin_family = AF_INET;
server.sin_port = htons(8888);

//Connect to remote server


if (connect(s , (struct sockaddr *)&server , sizeof(server)) < 0)
{
puts("connect error");
return (1);
}
else
{
puts("Connected");
}

return (0);
}

10.1.2 GUI Interface

The code in the following section was generated using the Qt Creator GUI tools.

<?xml version="1.0" encoding="UTF-8"?>


<ui version="4.0">
<class>buttons</class>
<widget class="QMainWindow" name="buttons">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>613</width>
<height>385</height>
</rect>
</property>
<property name="windowTitle">
<string>buttons</string>
</property>
<property name="autoFillBackground">
<bool>true</bool>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<widget class="QWidget" name="centralWidget">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLCDNumber" name="lcdNumber_4">
<property name="digitCount">
<number>1</number>
</property>
</widget>
</item>
<item>
<widget class="QLCDNumber" name="lcdNumber_3">
<property name="digitCount">
<number>1</number>
</property>
</widget>
</item>
<item>
<widget class="QLCDNumber" name="lcdNumber_2">
<property name="digitCount">
<number>1</number>
</property>
</widget>
</item>
<item>
<widget class="QLCDNumber" name="lcdNumber">
<property name="digitCount">
<number>1</number>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QPushButton" name="pushButton">
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">background-image: url(:/style/Red.jpg);</string>
</property>
<property name="text">
<string>Release All</string>
</property>
</widget>
</item>
<item row="2" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="label">
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">background-image:
url(:/style/Dark.jpg);</string>
</property>
<property name="text">
<string>LED1</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">background-image:
url(:/style/Dark.jpg);</string>
</property>
<property name="text">
<string>LED2</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_3">
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">background-image:
url(:/style/Dark.jpg);</string>
</property>
<property name="text">
<string>LED3</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_4">
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">background-image:
url(:/style/Dark.jpg);</string>
</property>
<property name="text">
<string>LED4</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_5">
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">background-image:
url(:/style/Dark.jpg);</string>
</property>
<property name="text">
<string>LED5</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_6">
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">background-image:
url(:/style/Dark.jpg);</string>
</property>
<property name="text">
<string>LED6</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_7">
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">background-image:
url(:/style/Dark.jpg);</string>
</property>
<property name="text">
<string>LED7</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_8">
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">background-image:
url(:/style/Dark.jpg);</string>
</property>
<property name="text">
<string>LED8</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="3" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QCheckBox" name="checkBox">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(0, 0, 0);</string>
</property>
<property name="text">
<string>Button1</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_2">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(0, 0, 0);</string>
</property>
<property name="text">
<string>Button2</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_3">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(0, 0, 0);</string>
</property>
<property name="text">
<string>Button3</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_4">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(0, 0, 0);</string>
</property>
<property name="text">
<string>Button4</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_5">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(0, 0, 0);</string>
</property>
<property name="text">
<string>Button5</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_6">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(0, 0, 0);</string>
</property>
<property name="text">
<string>Button6</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_7">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(0, 0, 0);</string>
</property>
<property name="text">
<string>Button7</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_8">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(0, 0, 0);</string>
</property>
<property name="text">
<string>Button8</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QMenuBar" name="menuBar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>613</width>
<height>21</height>
</rect>
</property>
</widget>
<widget class="QToolBar" name="mainToolBar">
<attribute name="toolBarArea">
<enum>TopToolBarArea</enum>
</attribute>
<attribute name="toolBarBreak">
<bool>false</bool>
</attribute>
</widget>
<widget class="QStatusBar" name="statusBar"/>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources/>
<connections/>
</ui>

10.2 Gantt chart

Figure 8. Gantt chart Page 1


Figure 9. Gantt chart Page 2

Vous aimerez peut-être aussi