A Mathematical Model of Operation Allocation and Materials

A Mathematical Model of Operation Allocation and
Materials Handling System Selection Problems in a
Flexible Manufacturing System
BY
Jorge Paulo
A Thesis Submitted to the College of Graduate Studies and Research
through the Industrial and Manufacturing Systems Engineering Program
in Partial Fulfillment of the Requirements for the Degree of
Master of Applied Science at the University of Windsor
Windsor, Ontario, Canada
O 2000, Jorge Paulo
1+1
National Library
of Canada
Bibliothèque nationale
du Canada
Acquisitions and
Bibliographie Services
Acquisitions et
services bibliographiques
395 Wellington Street
Ottawa ON K 1A ON4
395.
WJlirigtori
OaawaON K l A W
Canada
Canada
The author has granted a nonexclusive licence ailowing the
National L i b r q of Canada to
reproduce, loan, dishibute or sell
copies of this thesis in microform,
paper or electronic formats.
L'auteur a accordé une licence non
exclusive permettant à la
Bibliothèque nationale du Canada de
reproduire, prêter, distribuer ou
vendre des copies de cette thèse sous
la forme de microfiche/film, de
reproduction sur papier ou sur format
électronique.
The author retains ownership of the
copyright in this thesis. Neither the
thesis nor substantial extracts from it
may be printed or othenvise
reproduced without the author's
permission.
L'auteur conserve la propriété du
droit d'auteur qui protège cette thèse.
Ni la thèse ni des extraits substantiels
de celle-ci ne doivent être imprimés
ou autrement reproduits sans son
autorisation.
Matenals handling systems are an integrating component of a manufacturing
system and as such rnust be considered within an integrated approach to manufacturing
systems design.
This work proposes to integrate the operation allocation and the
materials handling system selection problems in a flexible manufactwing system by
extending the operation allocation model to include some aspects of materials handling
system design. The objective of the operation allocation model is to select a group of
machines where the operations of the part types wiII be perforrned and then to assign
those operations to the selected machines. The operation allocation model interfaces with
the materials handling system selection model by providing input data in the f o m of the
manufacturing operations to be perfomed at each machining center. The selection of the
materials handling system is centered on the matching of the parts visiting a machining
center to perform a manufacturing operation and the abiiities of the handling equipment
to perfom the required materials handling functions of those part types. The objective is
to select an optimal group of materials handling equipment to be assigned to a cell. A
compiiter program was developed to greatly automate the process of solving the models.
This allows the program to be used as a rapid rnodeling tool.
Dedication
This work is dedicated to my parents, Albano and Luzia Paulo, who through personal
sacrifices permitted me to successfully complete this Master's thesis. Their relentless
encouragement and support will never be forgotten.
Acknowledgements
1 would like to acknowledge and thank Dr. R.S. Lashkari, Dr. S-P Dutta and Dr. A.
Atmani for their guidance and complete support ofthis work.
1 would also like to thank Mrs. Mummery, Mr. Barakat and Mr. McKenzie for their
technical expertise and support.
Table of Contents
..........
...................................................................Ill
DEDICATION.....................................................................................................IV
......
..........................V
ACKNOWLEDGEMENTS ..............................................
LIST OF TABLES.............................................................................................. IX
LIST OF FIGURES ....................................................................................
X
NOTATION .....................................................................................................XI
CHAPTER 1. INTRODUCTION............................
.....................1
1.1. Motivation for the Proposed Research ............................................................2
Organization of the Proposal .............................................................................. 4
1.2.
ABSTRACT
.................................
............................ 6
Operation Allocation Literature ........................................................................ 6
Materials Handling System Selection Literature .............................................9
Commentary on Previous Work ...................................................................... 12
CHAPTER 2. LITERATURE SURVEY
2.1.
2.1.
2.2.
.....................
........
..........13
Sub-Mode1 1.Operation Allocation .................................................................13
CHAPTER 3. THE MATHEMATICAL MODELS
3.1.
3.1.1.
Mathematical Formulation ......................................................................................
.
...................................... 18
Sub-model 2 Materials Handling System Selection
3.3.1.
Mathematical Formulation ......................................................................................
3.2.
14
19
....
.......26
..............................................................26
The Materials Handling System Selection Problem .......................
35
CHAPTER 4. CASE STUDY EXAMPLE ...................
The Operation Allocation Problem
4.1.
4.2.
.........................................................
.......................................................................
CHAPTER 5. SENSlTlVlTY ANALYSIS
.44
a
5.1. Sensitivity Analysis of Wit
45
................................................. 49
5.1.1.
Detailed Sensitivity Analysis of FV+ ..............
.
.
.
5.2.
Sensitivity Analysis of W.,
50
.................................................................................
5.2.1.
5.2.2.
5.3.
5.3.1.
5 -3.2 .
Effect of the Complexity Rating of the Light-load Robot...................................... 51
Effect of the Masdinear Dimension Rating of the AGV ...................................... 52
..............................................................................
Sensitivity Analysis of WhhC
55
Efkct of the (un)Load!Orientation Rating of the Light-load Robot ....................... 58
E ffect of the Transportation/Quantity Rating of the Roller Bed Belt Conveyor ..... 60
......................-63
........................ .
.
.
.
The Menu Bar ........................ .
.
.
,
............................................................... 64
CHAPTER 6. THE SOLVER PROGRAM
6.1.
6.1 .1.
6.1.2.
6.1 .3 .
6.1.4.
6.2.
6.2.1.
6.2.3 .
The File Heading ..................................................................................................... 65
The Data Heading ................................................................................................... 65
................... 68
The Reporîs Heading
. ...........................
.
.... ......
The Help Heading ................................................................................................... 69
The Buttons
..................................
.
.
.....
.................... 71
The Mode1 Solver Buttons ....................................................................................... 71
The Exit Button........................................................................................................ 73
.........
.
.
.........................74
Future Research ............
.
.
.
............................. .............................................77
7.1.
CHAPTER 8. CONCLUSIONS ....................................................................
79
REFERENCES ...................................................................................................80
APPENDICES ..................................................................................
APPENDIX I. LING0 PROGRAM FILES ........................................
.
CHAPTER 7 DISCUSSIONS AND CONCLUSIONS
Operation Allocation Mode1................................................................................
Materials HandIing System Selection Mode1......................................................
................................
.
.....
APPENDIX II. SENSlTlVlTY ANALYSE RESULTS
89
Sensitivity Analysis of Wit........................................................................................................ 89
APPENDIX III. DATABASE TABLES
.............................................
.
APPENDIX IV SOLVER PROGRAM SOURCE CODE
..................
Source Code for solver.vbp .................................................................................
Source Code for datacon-bas...................................................................................................
Source Code for so1ver.h .....................................................................................................
Source Code for frmAbout.h ...............................................................................................
Source Code for fmdgMC.fkm ...............................................................................................
Source Code for fnndgMfg0p.h .........................................................................................
Source Code for frmdgMHC.h ............................................................................................
Source Code for h d g M H E q u i p . h .....................................................................................
Source Code for frmdgMHReq.h ........................................................................................
vii
102
106
115
120
125
130
135
140
.
.
.
.144
Source Code for fmdgPartP1an.h ....................................
........
Source Code for frmdgPartPIanOp.t'rm...................................................................................
Source Code for fimdgPartPIanOpMC.frm.............................................................................
Source Code for fimdgParts.frm .............................................................................................
Source Code for frmdgP1an.h ............................................................................................
Source Code for frrndgwet-fim ..............................................................................................
.
.
......................................................................
Source Code for hdgWhhe.frm .............. .
Source Code for frmdgwit-fm...............................................................................................
VlTA AUCTORIS
149
154
159
164
168
173
178
........................................................................................... 1 8 4
List of Tables
Table 1 . Rating Scale for W& ...................................................................................................... 22
Table 2 . Rating Scale for WC,................................,
.
.
.
............................................................. 22
Table 3. Rating Scale for Wj,...................................................................................................... 22
Table 4 . Manufactunng operation times t&p) and costs OCs,{ip),part type demands diand
machine setup costs SCi. ........................................................................................................ 27
Table 5. Cost of moving a unit of part type i fiom machine j to machine j,F$(i = 1..... 14).... 32
Table 6. Machine selection and operation assignments for the case study .................................. 34
Table 7 . Machine selection and operation assignments for case wîth reduced machine
availability .............................................................................................................................. 3 4
Table 8 . 1.6,table for the case shidy example ............................................................................. 35
Table 9. W../,, table for case study example .................................................................................... 36
Table 10. IVM., table for the case study......................................................................................... 38
Table 1 1. Materials handling times, t,,,,-,
....................................................................................... 38
Table 12. Materials handling requirements. a ~,......................................................................
<
39
Table 13. Solution to the materials handling system selection problem .................................... 40
Table 14. Materials handling equipment utilization ..................................................................... 42
Table 15. FV, sensitivity analysis for part type 2 - assignments ................................................... 46
Table 1 6. Wirratings for part type i = 2 ......................................................................................... 49
Table 1 7. Sensitivity analysis results for CC;,, = W , ,,.................................................................. 53
Table 18. Sensitivity analysis results for IVc, = Wa5- ..................................................................... 56
Table 19. Sensitivity analysis results for Whl;c= W I I....................................................................
I
59
Table 20 . Sensitivity analysis results for FVu;,
= Ffrjj6 ................................................................... 62
Table 2 1 . Data menu entries and associated database tables.................... ,
.
............................ 67
Table 22 . List of abbreviations used in sensitivity analysis of Wil................. ,
.
.
.
................. 89
Table 23 . ResuIts of sensitivity analysis for Wi,
ratings - part type 2 ......................................... 90
Table 24 . Description of the tables in the database OA-MDB...................................................... 9 3
Table 25. OA-MDB Database - description of the table: Parts ..................................................... 9 4
Table 26 . Oii-MDB Database - description of the table: Machines .............................................. 94
Table 27 . OA-MDB Database - description of the table: Plans - ............................................ 94
.
.
............................ 95
Table 28 . OA.MDB Database - description of the table: MfgOps .............,
Table 29 . OA.MDB Database - description of the table: PartPlan - .............................................. 95
Table 3 0 . 0A.MDB Database - description of the table: PartPlanop ........................................... 95
Table 3 1 . OA.MDB Database - description of the table: PartPlanopMc ,..........
.
.
............. 95
Table 3 2. O.4.MDB Database - description of the table: MHC................................................. 96
Table 3 3 . OA.MDB Database - description of the table: A .......................................................... 9 6
Table 34 . 0A.MDB Database - description of the table: MH-Equip ........................................... 96
Table 35 . OA-MDB Database - description of the table: MH-Op ................................................ 96
Table 36. 0A.MDB Database - description of the table: MH-Subop ,
..................................... 97
Table 3 7 . OA.MDB Database - description of the table: Tech..................................................... 97
Table 38. OA.MDB Database - description of the table: MH-Req .............................................. 97
Table 39. OA.MDB Database .description of the table: W-it ..................................................... 98
Table 40 . 0A.MDB Database - description of the table: W-et ,................................................... 98
Table 4 1 . O A.MDB Database - description of the table: W-hhe-tirne ......................................... 98
Table 42 . Source code files in the Solver program ..................
.
............................................ 101
List of Figures
Figure 1. Main form of the Solver program................................................................................ 64
Figure 2 . The File mcnu entries ..............
.
.
.
.......................................................................... 65
..................................................................................................
Figure 3. The Data menu entries
66
.
.
................. 68
Figure 4 . Table for the Machines menu entry .................................................. .
Figure 5 . ï h e Reports menu entries ............................................................................................. 69
Figure 6. Operation Allocation report window ............................................................................ 70
Figure 7. The Help menu entries.................................................................................................. 70
Figure 8. Dialog box illustrating the commands passed to Lingo............................................ 71
Figure 9. Dialog box informing the user about Lingo's success in solving the mode1.............. ...72
Figure 10. Main window afier both models were solved............................................................. 73
Figure I 1. The operation allocation problem must be solved first........................................... 73
Notation
Sub-mode1 1. Operation A//ocation
Index Sets
i E { l Z 1J 1 part types
pE1 1 ,
P i ) process plans for part type i
operations for part type i under process plan p
s E {1 , . ( i )
set of machines that can perform opention s of part type i under process
j E J .'PX c {1,2,..mJ plan P
3
Set of machines that can perform operation (s+I) of part type i under
plan p
Jiptx+t i1~21..mJprocess
Decision Variables
x,UP>
=
1
if operation s is processed on machine j for the combination (ip)
O
othenvise
1 if pan type i moves to machine to perform operation (s + I ) after performing
opention s on machine j for the combination (ip)
O
othenvise
1 if part typei is processed under process plan p
O
1
M , = {O
othenvise
if machine j is setected
othenvise
Parameters
6/
OCsj(ip)
di
SC,
t&p)
Tu
= amount
of time available on machine j
of perfornwlg operation s on machine j for the combination (ip)
= demand for part type i
= setup cost of machine j
= time for performing opention r on machine j for the combination (ip)
= cost of moving a unit of pan type i from machine j to machine j
= cost
Sub-model2. Materials Hsndling System Selection
Index Sets
Part m'es
manufacturing operations for part type i
major materials handling opentions
materials handling sub-operations
key product variables
materials handling equipment
materials handIing equipment
set of machines that can perform operation s of part type i
Decision Variables
1 if the materials handling operatiodsub - opention hi require materials handling equiprnent
ynn,,
(i) =
L' at
0
D'.=
D; =
{
(
machine j where rnanufaciuring operation s cf part type i is performed
othenvise
1 if materials handfing equipment e is selected
0
othenvise
1 if materials handling equipment C is selected
0
otherwise
Parameters
time available on materials handIing equiprnent e
operation assignments where an instance of the pararneter indicates that
manufacturing operation s of part type i is performed at machine j
= demand for part type i
= materials handling operationlsub-operation requirernents, where an instance of the parameter
indicates that the material handling function (Irh)is required at machine j where manufacturing
operation s of part i is perfomed
= time for equipment e to perform materials handling operatioxdsub-operation hi;
= relative weight of the product variable I on part type i
= relative weight of the product variable t on materials handling equipment e
= relative deçree of capability of materials handling equipment e to perform the operatiodsuboperation combination hh
= compatibility factor bebveen a piece of materials handling equipment e and a part type i
= arnount of
= manufacturing
xii
The environment under which manufacturing organizations operate is changing
rapidly.
The emerging post-industnal environment is charactenzed by fierce global
competition, rapid market changes, shorter product life cycles and advances in both
manu facturing and information tec hnology (Vonderembse et al ., 1997).
These
environmental changes have a direct effect on the design of manufacturing systems
spawning significant changes to that design.
The widening of competition to a global realm, made increasingly possible by the
emergence of various international trade agreements and facilitated by the recent
advances in information technologies, places an added demand on the manufacturing
systems to produce "agile" products. These products must be continuously produced to
closer tolerances, with higher reliability and fiom an expanding variety of matenais.
The shorter product life cycles and rapid market changes lead to a proIiferation in
the number and variety of products that must be produced within a rnanufacturing
facility. The emphasis has shifted to producing this large array of new and improved
products in smaller volumes as rapidly and economically as possible.
Other changes include the recognition of the cost of matenals, materials handling
and energy as significant cornponents of the total manufacturing cost. This is especially
true for materials handling. Tompkins and White (1984) estimated that between 20-50%
of the total operating cost in manufacturing can be attributed to the various materials
handling functions.
Advances in manufacturing and information technology make these trends
seemingly feasible to accommodate. Technological advances in CAD/CAM/CiM and
flexible manufacturing systems or cells cm, at least in theory, provide the flexibility and
efficiency required to successfÙlly cope with the changes outlined above. However, in
many cases, this has not proved to be true, or at least not to the extent that one would
expect. While these advanced technologies have been successfully exploited for specific
tasks, often the required system-wide benefits have not been achieved.
A manufacturing system is a complex of smaller interacting subsystems. The
changes and trends discussed previously affect these subsystems and therefore the
manufacturing capability of the whole system. Due to the relationships among these
subsystems, it is necessary to consider the manufacturing system fiom an integrated
standpoint.
The focus on integration guarantees that critical information exchange
between the subsystems is considered.
This is of paramount importance to a
manufacturing system that must produce a large variety of low-medium volume products
in a reliable. time efficient and resource efficient manner.
1.1.
Motivation for the Proposed Research
htegration should be the focus of a post-industrial manufacturing fim. As such,
the manufacturing system must be viewed from a holistic perspective as an integrated
whole. This "whole" is composed of a number of interacting and integrated subsystems.
Each subsystem has certain objectives that it must meet; however, its operations must be
fine-tuned to optimize the "whole".
Flexible manufacturing systems or cells have the potential to provide the
flexibility and efficiency required by the post-industrial firm. This has been widely
recognized and has been the motivating factor behind a large volume of research in this
area.
This is to be expected since flexible manufacturing systems require carefûi
planning to ensure that resources arc not underutilized, flexibility is maximized, and setup costs are minimized. One of the principal tasks to be performed is the optimal
selection of machines and the allocation of part operations to the selected machines. This
task is usually performed while tryng to meet a number of objectives. These include
minimization of operation, machine set-up and materials handling costs, minimization of
total processing times, maximization of machine utilization, etc.
The materials handIing system can be thought of as the basic integrator of a
manufacturing system. AAer all, the materials handling system connects and traverses al1
departments and cost centers. Because of its integrating nature, al1 complexity inherent
in a manufacturing problem is passed on to the matenals handling system (Noble and
Tanchoco, 1994).
The high complexity of a materials handling system makes the
selection of an appropriate system a non-trivial problem.
Even for a modest size
manufacturing system, the design details increase rapidly. There is a large variety of
standard and specialty equipment, each with different characteristics that can be dificult
to quantify for inclusion in a model. Funher, there can be multiple objectives to consider
for any specific situation. Computationally, the size of the problem grows very rapidly as
each piece of equipment c m perform a number of operations at a machining center or
between machining centers. Finally, it c m be difficdt to estimate some parameters such
as cost and time before the system is in operation.
Despite the complexity involved in selecting a matenals handling system, it is
extremely important that the problem be carefiilly considered. The magnitude of the cost
impact of materials handling justifies such an effort. Past research on the design and
selection of a materials handling system has focused primarily on the optimization of
materials handling equipment. More recent work has considered the materials handling
systern as a "whole", rather than just individual elements of that system. This is of great
importance since the objective is to optimize the whole.
At the center of a materials handling system is the material itself. Therefore, it is
necessary to start the design cycle by considering the material, its transformation
processes and the resultant products.
The logistics design needs to be undertaken
concurrently with the materials handling system design. Traditionally this has not been
the case. Rather, it is only considered once the products have been engineered and bills
of materials have been produced. By that time, considerable product Iead time has been
lost.
As a resuk of the r a s o n s described above, it is proposed that an integrated
approach to manufacturing system design be developed. More specifically, it is proposed
that the machine selection and operation allocation problem and the materials handling
system selection problem be simultaneously considered to generate a "reasonably
optimal" choice of design features.
1.2.
Organization of the Proposal
The report is divided into eight chapters. This first chapter is an introduction
where some background on the current problems and the motivation for this work is
explained. Chapter 2 presents a literature survey of previous research work on the
operation allocation and materials handling system selection problems. The research
objectives of this work are further defined at the end of that chapter. The operation
allocation and materials handling system selection models are then developed and
presented in Chapter 3. Chapter 4 presents a case study that is solved with the use of the
developed models and the solution to the case study is briefly discussed. In Chapter 5,
the sensitivity analysis of various rating factors used in the materials handling system
selection mode1 is presented. The sixth chapter presents the Solver program that was
developed to sirnplify the solution process to both problems. Chapter 7 discusses the
work presented and offers some ideas for further development of the models. Lastly,
Chapter 8 finalizes with concluding remarks about this research work.
The literature survey is divided into two sections.
The first section reviews
selected literature for the operation allocation problem. The second section reviews the
literature for the materials handling system selection problem.
2. i.
Operation Allocation fiterature
The operation allocation problem has received considerable attention fiom
researchers in the p s t . Several approaches have been proposed to solve the problem.
For the survey of this work, only the mathematical programming approaches are
reviewed. The emphasis is placed on those models that were developed primarily for
flexible manufactuRng systems.
Stecke (1 983) formulated the loading problem in a flexible manufacturing system
as a nonlinear 0-1 mixed integer program. Because the best loading procedure is probiem
dependent, Stecke proposes six different formulations corresponding to six different
loading objectives. These are:
1. Balance the assigned machine processing times.
2. Minimize the number of movements fiom machine to machine.
3. Balance the workload per machine for a system of groups of pooled machines of
equal sizes.
4.
Unbalance the workload per machine for a system of groups of pooled machines
of unequal sizes.
5. Fil1 the tool magazines as densely as possible.
6 . Maximize the sum of operation pnorities.
The formulations are solved by varîous linearization methods.
A branch and bound algorithm was then developed by Berrada and Stecke (1986)
to solve the loading problem more expediently than by means of the linearized
formutations proposed earlier.
However, in this paper, the only loading objective
considered was that o f balancing the workload on al1 machines.
rninimizing the workload of the bottleneck machine.
This is done by
A sequence o f sub-problems is
defined and each sub-problem is solved by a branch and bound procedure.
The
procedure first solves a simple, relaxed assignment problem, next checks for feasibility
and then modifies the assignment to correct the violated constraints.
Lashkari et al. (1987) extended the formulation of the operation allocation
problem to include the planning aspects of refixturing and limited tool availability. The
problem is fomulated as a non-Iinear 0-1 integer programming formulation with two
objective functions. The objective functions consist o f minimization of transport load
and minimization of refixturing activities.
Wilson (1989) proposed an alternative formulation to the one proposed by
Lashkari et al. (1 987). The planning aspects of refixturing and limited tool availability
were also considered.
The alternative formulation avoids the non-linearities of the
previous approach and instead proposes an integer programming formulation. Only the
problem of minimization of transport Ioad is formulated.
Damodaran et al. (1992) presented a mathematical mode1 for the operation
allocation problem in multi-machine and multiple ce11 environments. The mixed integer
linea. model considers the trade-off between refixturïng and materials handling. The
authors argue that this trade-off influences operation allocation. The objective function
minimizes the refixturing and materials handling costs as well as the processing costs.
Taboun and Ulger (1992) developed a muIti-objective modeling o f operation
allocation in flexible manufacturing systems. The 0-1 integer prograrnming formulation
considers multiple objectives such as the minimization of processing, handling, tool setup, fixturinglrefixturing and penalty costs of under-utilization and over-loading of
machining centers.
Ribeiro and Pradin ( 1993) presented a methodoIogy for cellular manu facturing
design that consisted of two stages. In the first stage, the job shop machines are selected
and parts are assigned to those machines. In the second stage, the operation allocation to
seIected machines is realized with the intent of minimizing inter-ce11 moves. The second
phase is developed so that the operator can iteratively repeat it until a certain level of
inter cell moves is achieved.
Atmani et al. (1995) developed a mathematical prograrnming approach to joint
ce11 formation and operation allocation in cellular manufacturing. The mode1 introduced
was a 0-1 integer program that simultaneously considered the ce11 formation and
operation allocation problems while minimizing the sum o f the operation costs,
refixturing costs and transportation costs.
Atmani (1995) proposed a flexible planning mode1 for flexible manufactunng
systems with setup cost consideration. The 0-1 integer prograrnming mode1 rninimizes
the joint operation, materials handling and setup costs. This model was applicable to a
single cell.
Atmani and Lashkari (1998) presented a linear, 0-1 integer programming model
of the machine tool assignrnent and operation allocation in a flexible manufacturing
system.
An optimal plan is obtained by minimizing the total costs of operations,
materials handling (transportation) and machine set-ups.
Guerrero et al. (1999) presented a mixed integer linear programming model of
machine loading and part type selection in flexible manufacturing systems. The model
considers the existence of alternative routes for each part type.
The objective is to
balance the machine workloads.
2.1.
Materials Handling System Selection Literature
The materials handling system selection problem has also received considerable
attention from researchers. Many di fferent approaches have been proposed in past and
recent literature.
C h u et al. (1995) as well as Kim and Eom (1997) have proposed expert based
system approaches. A closely related approach is that of knowledge based solutions.
Some work in this area has been conducted by Matson et al. (1990), and Welgama and
Gibson (1 995). Another popular approach is simulation. Some researchers that have
worked in this area include Nadoli and Rangaswami (1993) as well as Harit and Taylor
( 1 995).
Very few mathematical programming models have been proposed. This is not
surprising given the complexity of the problem both from a conceptual and computational
point of view.
Most of the research in the area of mathematical programming of
materials handling systems has focused on optimizing materials handling equipment and
not the whole materiaIs handling system. A good review of such practices is provided by
Rembold and Tanchoco (1994).
An exarnple o f an algorithm for the selection and assignrnent of materials
handling equipment is that of Hassan et al. (1985). The problem is fomulated as an
integer programming model with the objective of minimizing the total operating and
investment costs o f the selected equipment. The model only explores the assignment of
equipment for departmental moves (Le., transportation).
Other materials handIing
operations are not considered.
Recent work has made substantial strides in developing models that deal with the
materials handling system as a whole rather than with individual pieces of equipment.
Gupta and Dutta (1994) developed a methodology for linking product design with
manufacturing logistics design activities. In particular, it was proposed tha; materials
handling needs be considered within the manufacturing systems design through
concurrent engineering.
The authors argued that "manufacturing logistics design should be undertaken as
soon as the product design stage is started".
Five key product variables are used to
describe a product's characteristics: complexity, precision, diversity, batch sizeflot
size/run-length and mass o r linear dimension. These characteristics are defined in t e m s
of the choice of manufacturing technology associated with the product's conception,
realization, disposition and disposal. Each materials handling system contains within it
five subsystems: loadinghnloading at the workplace, transportation, handling/rehandIing
away from the workplace, inspection module and storage/retrieval device. Each of these
subsystems is composed of a number of sub-operations such as orientation change,
position change, quantity change, sequence change and timing change. The attributes of
the product/process combination, i.e. choice of technology, are related to the materials
handling system requirements through a five point rating scale.
The appropriate
materials handling system is then selected through a weighted rating method.
This concept was expanded by Atmani and Dutta (1996) into a mathematical
model. A 0-1 integer prograrnming model was proposed to maximize the 'adaptability
factor'.
The 'adaptability factor' maps the product/process design ont0 the materials
handling system design. It was formally defined by Gupta and Dutta (1994) as "the ratio
of basic motions/movements that are required by a new product to those available in the
current manufacturing logistics system". The methodology outlined previously by these
authors fonned the base for the mathematical model.
Other integrated approaches have been praposed. Noble et al. (1998) developed a
model that integrates materials handling equipment selection and specification (materials
handling interface equipment included) and path/load dependent unit load size.
The
formulation attempts to minimize the operating and capital cost of materials handling and
necessary interface equipment.
Although the materials handling operations are not
defined, the model appears to only consider transportation between workplaces. Paulo et
al. (1999) presented a methodology to consider the operation allocation and materials
handling system selection problems jointly. The work represents an important first step
towards developing an integrated approach to solving these two manufacturing problems.
2.2.
Commentary on Previous Work
The recent work on the development of more integrated rnodels in operations
allocation and materials handling system selection is indicative of a trend to mode1 more
realistic problems in a manufacturing system. These problems are undoubtedly more
cornplex and difficult to mode1 and solve. This is part of the reason why most past work
has dealt with individual problems.
However, the realization of the benefits of an
integrated approach warrants new research of models that are integrative in nature.
In the past, the operation allocation and materials handling system selection
problems have been considered separately. However, it is obvious that the solution to
one of these problems is influenced by the solution to the other problem. This has been
evidenced by the attempt of previous researchers to include the materials handling costs
in their operation allocation models. In addition, a necessary input to most matenals
handling system selection models is the operations assignments that result from the
solution to the operation allocation problem. It is obvious that these two problems are
both members of a larger system affected by various interrelationships.
This work
attempts to bridge these two problems by explicitly considering both of thern and their
interactions.
The work presented here encompasses and enlarges the methodology
proposed by Paulo et al. (1999).
The work builds upon two existing models: the mode[ of the joint cell formation
and operation allocation in a cellular manufacturing by Atmani et al. (1995); and the
materials handling system selection model by Atmani and Dutta (1996). These models,
which f o m the foundation of this work, were revised and suitably modified for the scope
of this work. In the case of the materials handling system selection model, the changes
were substantiai, resulting in a mode1 that is distinctively different fiom the previous one.
Sorne of the changes were introduced to allow the integration of the two models.
3.1.
Sub-Mode1 1. Operation Allocation
The model of the joint ce11 formation and operation allocation in a cellular
manufacturing system, proposed by Atmani et al. (1995), was simplified. Specifically,
the model was reduced to an operation allocation model. The ce11 formation component
was eliminated in an attempt to reduce the complexity inherent in bridging the two
models. As such, the constraint that ensured that a specific machine was only assigned to
one specific ce11 was eliminated.
There were further modifications in the objective function and constraints. One
modification was the addition of the machine setup cost to the objective hnction. This
ensures that we now have a more complete description of the total cost.
The unit
refixturïng cost present in the original model was combined with the unit operation cost
since these constituted sums over identical sets o f indices.
As such, the new unit
operation cost includes both the unit manufacturing cost and the unit refixturing cost.
The same is true for the constraint that ensures that the total time of the operations
assigned to a certain machine does not load the machine beyond its capacity. The unit
operation time now includes the unit manufacturing time and the unit refixturing and
defixturing times.
This modified model is essentially the same as that proposed by
Atmani (1 995).
The modified 0- I integer prograrnrning model is developed below.
3.1 .1. Mathematical Formulation
Assume that there is a set o f
11
part types labeled with the indices i = 1, ..,, n,
where the part type i has the known and uniforrn demand diover the planning period. A
part type i can be processed under the different process plans p
=
1,
....P(i).
For a
process plan p~ Pfi) of a part type i, the manufacturing operations are represented by the
indices s = I , ..., S(ip). There is a set o f rn machines labeled with the indicesj = 1, ..., m.
The set of machines that c m perform manufacturing operation s of a part type i under
process plan p is given by Jip,.
The operation allocation model involves the assignrnent o f operations of each part
type to appropriate machines to minimize the total costs of manufacturing operations,
machine setups and rnatenals handling. The 0-1 decision variables are denoted by X,(ip),
where X,(ip)
=
1 if operation s of a part type i is processed under plan p on machine j and
zero otherwise.
The operation cost is given by E,(X,i(ip)):
where OCq(@) is the known cost of operation s o f a unit of part type i on machine j under
process plan p. This includes both the manufacturing cost and the refixturing cost.
The machine setup cost is given by -(Mi):
where SC, is the known setup cost for machine J and the auxiliary variable M, takes the
value o f one if machine j is selected and zero otherwise.
planning period is assumed.
Only one setup cost per
Since these machines are operated under a flexible
manufacturing system, it is assumed that the only significant setup cost is the initial one
where the machines must be programmed and equipped with the required tools.
Finally, the materials handling cost is given by ~ { X s j / i p ) ) :
where T,- is the cost of moving a unit of part type i from machine j to machine j for the
next operation. Since &(X,(ip)) is a nonlicear hinction, the linearization technique given
l
in Taha ( 1992) is applied. This prescribes replacing É 3 ~ ( i p )with:
where L,(ip)
is a new 0-1 variable satismng the following two sets of constraints:
Note how the above set of constraints ensure that L,fip)
takes the value of one if and
only if a unit of part type i is moved to machine j for operation (s+i) under plan p, after
performing operation s on machine j under plan p.
The objective of the mode1 is therefore to determine the values of Xq(ip) and
Lufipl that will rninimize the total operating, machine set-up and materials handling
costs. This is mathematically expressed as:
The constraints are developed next. The first constraint set ensures that each part
type is processed under a single process plan, and it is given by:
where Z(ip) = 1 if part type i is processed under process plan p and zero othenvise.
The next set of constraints ensures that once a process plan is selected for a part
type. each operation in that plan is processed on only one of the available machines. It is
given by:
The third set of constraints ensures that if machine j is selected then at least one
operation must be assigned to it. It is given by:
The next set of constraints ensures that the total time required by the operations
allocated to a machine j, once it is selected, does not exceed the machine's know-n
capacity. It is given by:
where t,(ip) is the time to perforrn operation s of part type i on machine j under process
plan p.
The two sets of constraints, (IO) and (1 l), ensure consistency between the
ailocation of operations of the part types to machines and the selection of machines.
Assembling the above, we get the folIowing complete statement of our 0-1
mathematical progamming model of the operation allocation model, which is designated
P(0A): Minirnize
Subject to
The assignrnents determined by the model (Le., the X&))
are then summarized
in the matrix A,,, where an element of A,, is equal to one if operation s of part type i is to
be perforrned at machine j, and zero otherwise. This matrix serves as an input to the
materials handling system selection model.
3.2. Sub-model2. Materials Handling Sysfem Selection
The current implementation of the materials handling system selection model is
significantly different fkom the original model by Atmani and Dutta (1996). The original
model was used as the basis for the current model. However, a number of significant
modifications were introduced, The model developed in this section shares much of the
conceptual frarnework o f the previous model, but is irnplemented much differently. The
changes derive from an evolution in the mode1 development as well as ftom the goal to
integrate the operation allocation model with the materials handling system selection
model.
The notation was modified to accommodate the interfacing of this model with the
operation allocation model. It is necessary that cornmon elements such as part types and
machines be represented by the same indices to facilitate communication between the two
models.
As it was the case with the operation allocation model, the ceIl component of the
materials handling system selection formulation was removed. Therefore, the constraint
limiting the number of pieces of materials handling equipment assigned to each ce11 was
also removed.
The new implementation of the 0-1 integer prograrnming model is developed
beIow.
3.2.1. Mathematical Formulation
Assume the same set of rr part types as defined in the operation allocation model,
labeled with the indices i
=
1, ..., n, where the part type i has the known and uniforrn
demand di over the planning period. A part type i can be described in terms of five key
product variables that define the choices of rnanufacturing technoIogy associated with its
conception, realization, disposition and disposal. These are labeled by indices t
=
1, ...,
T m . In our case 7'0= 5 and the key product variables are complexity, precision, lot or
batch size, diversity and mass or linear dimension. Most of these are easily measured
parameters to rnanufacturing engineers and managers. For example, precision c m be
readily measured in terms of tolerances.
i-iowever, complexity can be difficuh to
measure. For the purpose of this thesis, it is assumed that the information embodied in
the shapes of part types is the rneasure of complexity. More precisely, complexity is
measured based on information theory. it measures the minimum number of bits of
information needed to describe a part. In most situations this includes geometrical and
dimensional information. Details of its quantification are presented by Ayres (1988).
There is a set of nr machines labeled with the indices j = 1 , ..., m. At these machines, the
required manufactunng operations for a part type i are represented by the indices s = 1,
..., S(i). The process plan index p is dropped from this model since a plan has already
been selected by the previous model.
The major materials handling operations, h
= 1,
..., H, where in our case H = 5,
are load/un load at the machine, transportation between manu facturing processes or
machines, handling/rehandling away from the workplace, inspection and storage and
retrieval. Each such operation is associated with a number of sub-operations labeled as h
=
1, . ..,
fi, where
in o u case
fi = 6.
These are orientation change, position change,
quantity change, sequence change, timing change and "no change". Simply explained, an
orientation change invoIves rotational change or movement while a position change
invoIves Iinear change or movement. Sequence change occurs when the order of part
types is modified. Timing change involves a change in cycle time between processing of
part types. A number of materials handling equipment are available to perform these
matenals handling operatiodsub-operation combinations. These are labeled as e = 1, ...,
E.
The 0-1 decision variables are denoted by
Yhhjs(i),
where Y,&eJs(r)
handling operation h, which is vsociated with sub-operation
=
1 if materiais
h, requires matenals
handling equipment e at machine j where manufacturing operation s of part type i is
performed.
The objective is to generate the optimal materials handling system selection for a
given mix of part types based on the padprocess combination and the choices of
materiak handling equipment available. Thus, we would like to maxirnize:
where
2[wcr
- wij
Cc;= 1 - '='
4T
where IV&;, is a measure of the ability of a materiais handling piece o f equipment to
handle a certain operatiodsub-operation combination while W,,and
& relate
the key
product variables to the materials handling equipment and the part type, respectively.
The parameter Cciis a measure o f the compatibiiity of a piece o f equipment and a
part type. The fraction part of the expression evaluates to a value between O and 1. The
maximum allowed value for the difference behveen each individual pair of WC,
and
4 units. Since the absolute value of this difference is summed over t
= 5,
=
16~
is
1, ..., T, where T
the maximum value that the fraction numerator can exhibit is 20. The denominator
alwayç evaluates to 20. If the values of WC,and
are as far apart as possible, the value
of the fraction will be 20/20 = 1. However, when this is the case, we want to eliminate
the materials handling equipment/part type combination from consideration. Since we
are maximizing the objective hnction. what we really want is for the value of C.,to be as
small as possible for this situation. Therefore, the fraction is subtracted from 1 to obtain
the value oFCei. As such, this parameter evaluates to a number between O and 1, where O
indicates incompatibility and 1 indicates complete compatibility. Incompatibility would
occur for a situation where the values of WC,
and
R.,are as far apart as possible,
which
signals that the materials handling equipment is unsuitable to handte that part type.
and
Complete compatibility would occur when the sum of the differences between WC,
[Vitevaluate to O.
In this case, Cci
evaluates to a value of 1, which affords the greatest
maximization of the objective function. In essence, since the objective hnction is to be
maximized, the model forces Cci to be as close as possible to a value of 1. In tuni, this
forces the WC,
and
II,ratings to be as close as possible in values.
This insures that the
model attempts to match as well as possible the materials handling equipment and the
part types it will service. For most situations, the parameter evaluates to a numerical
value between O and 1, indicating some degree of compatibility.
Integer scales are used to assign values to the W parameters. The rating scales
range from O to 5 for W,,,ii;,and WC,,and 1 to 5 for
%l.
The interpretation of the values is
given in Tables 1 , 2 and 3.
Rating
5
4
3
2
1
Explmation
Excellent at pedormîng the operatiodsub-opention combination
Very capable of performing the operationlsub-operation combination
Satisfactorily capable of performing the operatiodsub-operation combination
Poor, but capable of performing the operatiodsub-operation combination
Vew poor. but minimally capable of performing the operatiodsub-operation cornbination
Table 1. Rating Scale for Wh&
Rating
5
4
3
2
1
O
Explanation
Piece of equiprnent best suited to handle parts with a very high rating of product variable t
Piece of equiprnent best suited to handle parts with a high rating of product variable t
Piece of equiprnent best suited to handle parts with a moderate rating of product variable t
Piece of equiprnent best suited to handle parts with a low rating of product variable t
Piece of equipment best suited to handle parts with a very low rating of product variable t
Do not allow this piece of equipment to handle parts with product variable t
Table 2. Rating Scale for W,
Rating
5
4
3
2
1
Explanation
Part type exhibits a very high level of the key product variable t
Part type eshibits a high level of the key product variable t
Part type eshibits a moderate level of the key product variable t
Part type exhibits a low level of the key product variable t
Part type exhibits a very low level of the key product variable t
Table 3. Rating Scale for
@,
The three rating factors (Whl;erWri and &.) are largely subjective and a fomalized
approach to their quantification has not been developed. Details of the quantification of
the key product variables are given in a paper by Ayres (1988).
The rnatrix As, is derived fiom the output of the operation allocation model where
any element from that matrix equais one if a manufacturing operation s for part type i is
performed at machine j and zero othenvise. This parameter is the link between the two
models. It provides a necessary input to the materials handling system selection model
by describing the manufacturing operation assignments for each part type.
The parameter ah&, equals one if materials handling operation h, which is
followed by sub-operation h, is required at machine j where manufacturing operation s of
part type i is performed and zero otherwise. This parameter is a new addition to the
model, which describes the required materials handling operations/sub-operations
correspondent to the manufacturing operations. This was a necessary addition since the
goaI of the model changed. The previous mode1 was a stand-alone model that chose the
best general materials handIing system.
Tt was unaware of part type routings and
manufacturing operations. The current model is no longer stand-alone. One of its inputs
is the matrix summarizing the operations allocations. As such, it is necessary to supply
the model with information concerning the materials handling operations that must be
perfonned at a machine where a manufacturing operation has been assigned.
This
information is inputted by the user afier the machine selections and operation
assignments are known.
The first set of constraints ensure that only one type of materials handling
equipment is chosen to perform a materials handling operationisub-operation
combination required for manufactunng operation s of part type i at machine j. It is
expressed as:
This constraint also ensures that a piece of materials handling equipment is only assigned
when it is required. In other words, the decision variable Y,lhe,S(i) is oniy set equal to one
when a materials handling operatiodsub-operation is required.
The next set o f constraints ensures that a piece of equipment e is only chosen after
another piece of equipment ê has been assigned. This set of constraints is provided to
allow precedence relationships that rnay exist in the assignment o f materials handling
equipment. it is given as:
D, 'D,;
ve, ê,
e ;t ê
(22)
where D, = 1 if a piece of equipment e has been chosen and zero othenvise. Similarly for
D'L
The third set of constraints ensures that if a piece o f materials handling equipment
is chosen, then at least one materials handling operatjonlsub-operation combination must
be perfomed by that equipment. It is mathematically expressed as:
The next set of constraints guarantees that the total time for al1 jobs assigned to a
piece of rnatenals handling equipment does not exceed the time available on that piece o f
equipment. It is given by:
where
is the time required by materials handling equipment e to perform the materials
handling operatiodsub-operation combination hh and T, is the time available on
materials handling equipment e.
Assembling the above, we get the following complete statement o f our 0-1
mathematical prograrnming model o f the materials handling system selection model,
which is designated as P(MH).
where
C.,= 1-
Subject to
CI
'='
'
4T
An example is presented to demonstrate the viability of this work and o f the
models developed, This randomly generated example was solved using Lingo (Lindo
Systems Inc., 1999). The Lingo program files that were produced to solve this case study
can be found in Appendix 1.
4.1,
The Operation Allocation Problem
Assume that we have i = 1 , ..., 14 part types to be manufactured with demands as
listed in Table 4. The part types have P(1) = 2, P(2) = 3, P(3) = 2, P(4) = 2, P(S) = 2,
P(6) = 1 , P ( 7 ) = 2, P(8) = 2, P(9) = 1 , P(10) = 3 , P(11) = 2, P(12) = 2, P(13) = 1 , P(14) =
2 different process plans.
Each process plan c m include up to four manufacturing
operations. There are j = 1 , ..., IO machines with known capacity bj = 57,600 and setup
costs as listed in Table 4. Each of these machines is capable of performing operations
required by the process plans. For example: under process plan p = 1 , part type i = 1 has
S(11) = 3 operations with indices SE { 1 , 2, 3). Operation s = 1 of process plan p = 1 for
part type 1 can be completed on any of the machines j d l l l = { 1 , 3, 4, 7, 10) while
operation s = 2 can be completed at any of the machines ~ E J I / ?= (1, 5 , 7, 8) and
operation s = 3 can be completed at any of the machines ~ E J =
I , (3,
~ 4 , 1 0 ) . The
information for al1 allowable combinations fip) are summarized in Table 4, which
contains
the
values
of
the
operation
times
t,(ip)
and
costs
OC,(ip).
ln
* w3
a0
\
6C)
O p -
Y
*
693
:'D-7
*-*
!Sba0
*
w3
-z
-w3
CD
t
*
CU
N
a3
-- f ,z
e3
tt)
-
n f m -
*
r3
fC)
O
Y
11
'I'able 4. (cant'd 3)
1
Part Types, i
12
1
13
To simplify this exarnple, we assume that the cost of moving a part from one
machine to the next is the same for any part type. These materials handling costs are
surnmaxized in Table 5.
1
2
3
4
Machine, j
5
6
7
8
9
1O
Table 5. Cost of moving a unit of part type i from machinej to machinef, T,fi(i = 1.
...,14).
The problem was solved with the aid of Lingo. The results obtained are presented
in Table 6. The results indicate that machines 1 and 3-8 were selected to process the 14
part types under one of their possible process plans. For exarnple, part type i = 1 is
processed under plan p = 2 where operztion s =1 is perfonned at machine j = 3 and
operation s = 2 is performed at machinej = 1. Similar interpretations can be made for al1
other part types. These results are stored in As, to serve a s input to the materials handling
system selection model. The total cost is 7,752, which includes processing, machine setup
and transportation costsThe machine utilization percentages are quite small, indicating that the machine
availability exceeds by far the time rzquirements of the processing operations. In a more
realistic situation, the time available on the machines will not greatly exceed the time
requirernents of the operations.
The saine exarnple was re-solved with machine capacities that were significantly
reduced. For this case, the machine availability of machines j = 3 and j
=
7 were set at
480 time units, while the time available in each o f the other machines was restricted to
980 time units. Al1 the other case study data remained unchanged. Once the problem
was
solved, a new solution was obtained and it is presented in Table 7.
The solution to this modified case shows some interesting differences from the
solution to the previous example where there was ample machine time available. The
first difference that one might notice is that for some part types a different process plan
was chosen. No longer is it possible for the process plan with the absolute lowest cost to
be always chosen. Due to constraints in machine availability, the model is forced at
times to choose process plans yielding slightljr more expensive processing costs.
Another major difference and one that is expected, is that the machine utilization
percentages increased. Further, in this example, al1 available machines were selected.
Again, this was necessary to satisQ the machining time requirements. Please note that
for a Few of the machines, the utilization is extremely high. It is assumed that machine
allowances were factoreà into the machine availability data used in the example. This
means that if one expects a machine to have an uptime of 90% then the 980 time units
made available to the model actual represent IO89 time units of real time.
A price must be paid for the time constraints on the machines.
As it was
discussed above, the limited machine availability forces the mode1 to choose more costly
process plans. For this exarnple, the new value of the objective function was 1 1,789.
This represents an increased cost of 4,037.
Part, i (Process Plan, p)
M
a
c
h
i
n
e
1
2
3
4
1(2)
2'
2(1)
1
1
3(1)
4(4)
5(3)
6(1)
7(1)
8(2)
2
2
1
9(1)
lO(1)
2
2
1
1l(1)
12(2)
13(1)
1
3.9%
3
2
1
14(2)
Machine
Utilization
1.2O/o
1
0.2%
1
5
6
7
8
2
2
1
1
2,3,4
1
2
2 04
1
2
1
2
2
1
2.2%
0.4%
3.6%
0.7%
9
j
10
' Operation 2 of part type 1 under process plan 2 is performed at machine 1.
'Table 6. hlachinc sclection and operatioii ~ssigiiiiicntsfor the case study.
Part, i (Process Plan, p)
1
M
a
c
h
i
n
e
2
3
4
5
6
7
8
1(2)
2"
1
2(1)
1
)3(1)
j )1(4
2
2
3
3
2
114
1
2
1
2
3
1
2
1
2
2
2
2A
1
1
2
9
12
1
j
10
1
1
'Operation 2 of part type 1 under process plan 2 is perforrned at machine 1.
2
1
Table 7. iilachinc scleclioii and opcralion assignniciits for case witti reduccd niachiiic availwbility.
Machine
Utilization
1oo.oO/o
87 -5%
93.8%
21.9%
89.6%
85.9%
100.0%
93.8%
99.0%
99.5%
4.2.
The Materials Handling System Selection Problem
As discussed previously, it is assumed that each product has t = 1, ..., 5 choices of
manufacturing technology. These five choices of manufacturing technology describe the
part types in t e m s of their key product variables as seen in Table 8.
Part, i
1
Complexity
Diversity
Batch size
3
5
3
1
1
2
3
2
2
4
4
1
4
3
4
4
2
2
5
6
7
2
3
3
4
1
5
8
4
9
2
2
2
2
1O
11
12
1
2
1
3
1
1
13
4
4
2
5
2
14
2
3
Table 8.
~assninea-
Precision
2
2
5
3
3
3
2
2
5
1
1
1
2
2
2
3
2
4
3
3
3
1
1
2
3
2
5
2
2
2
4
IR?table for the case study example.
Frorn Table 8 we can observe that, for example, part type i = 2 has a high degree
of complexity and precision. This rneans that this part is composed of a large number of
geometrical and dimensional features and it must be manufactured to close tolerances.
The very low score for diversity indicates that this part type belongs to a part farnily
composed of a small number of products. We also know that this part type is
manufactured in medium-size batches and it is large in dimensiotdmass. A similar
description of each part type can be inferred from Table 8.
The fundamental materials handling operations, h
=
1, ..., 5, are loadunload,
handlinglrehandling, transportation, inspection and storage/retrieval.
Each of these
operations is associated with one or more sub-operations such as orientation, positioning,
quantity, sequence, timing or none. These are labeled with the indices h = 1, ..., 6. For
this example it is assumed that we have e = 1, ..., 9 different types of materials handling
equipment.
Each of these is available for 57600 time units. The materials handling
equipment is rated against the choices of manufacturing technology as seen in Table 9.
Equipment, e
-Light-load robot
Heavy-load robot
Human
Powered hand truck
Forklift truck
Roller bed belt conveyor
Light-duty belt cofiveyor
AGV
ASIRS
Complexity
4
4
Precision
4
4
5
4
1
1
1
1
2
2
2
4
4
2
4
4
~assmnear
Dimension
Diversity
2
2
4
Batch size
2
2
4
3
3
4
4
4
1
4
5
3
4
3
1
2
2
5
3
3
4
4
1
4
Table 9 indicates, for exarnple, that the available robots are best suited to handle
part types with a high degree of complexity and precision, a low degree of diversity and
large batch sizes. The light-load robot is best suited to handle part types of very small
mass/linear dimension while the heavy-load robot is best suited to handle large and
heavier part types. In other words, the ideal part type for these robots to handle is one
that is described by a large number of geometrical and dimensional features, requires
close tolerances, belongs to a part family with a low number of members and is produced
in large batches.
The materials handling equipment is also rated on its ability to perforrn the
various materials handling operationkub-operation combinations (Table 10). Again,
using the robots as an example, we can see that Our particular robots are capable of
performing the various operations required for loadhnload and handle/rehandle.
The
degree to which these are able to perform the various operatiodsub-operation
combinations varies. For exarnple, the robots excel at load/unload operations with the
exception of those requiring a quantity change. This is understandable since robots are
often fitted with grippers and unable to accommodate a varying number of part types
from cycle to cycle. The same is true for handlekehandle operations.
The unit times required by the various types of materials handling equipment to
perfornl the matenals handling operationkub-operation combinations are given in Table
11.
The materials handling requirements are derived fiom the output of the operation
allocation problem. Table 12 summarizes the materials handling requirements for this
case study example.
T h e problem was formulated in Lingo and then solved. The results obtained from
the Lingo solution of the materials handling system selection are summarized in Tables
13 and 14.
The resutts indicate that the mode1 behaves in an expected manner, choosing
sound materials handling assignments for the part types.
For example, if we look
carefully at the materials handling assignments for part type 2, we can reason why the
chosen assignments are the correct ones. The load/unload operations were assigned to
the heavy-load robot. This is not surprising since part type 2 is a heavy and large part, of
very high complexity and precision.
The AGV was chosen for the transportation
operations. Again, this is not surprising given the characteristics of part type 2.
tquipment, e
hght-load robot
Heavy-load robot
Human
Powered hand
truck
Forklift truck
Roller bed belt
conveyor
Light-duty belt
conveyor
AGV
ASlRS
O
(un)Load
P Q S 1
N
(re)Handling
O P Q S i N
5 5 2 5 5 5 5 5 2 5 5 5
5 5 2 5 5 5 5 5 2 5 5 5
5 5 5 5 4 5 5 5 5 5 4 5
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
Table 10. ll',,~,
table for the case study.
O
Equiprnent, e
hght-load robot
Heavy-load robot
Hurnan
Powered hand
truck
Forklifî truck
Roller bed belt
conveyor
Light-duty belt
conveyor
AGV
ASlRS
(re)Handling
P Q S T
N
Transportation
~ ~ P Q S
Inspection
T
N
0.3 0.3 2.0 0.30.3 0.23.0 3.0 3.0 3.0 3.0 3.0 0.3 0.33.0 0.3 0.3 0.2
0.3 0.3 2.0 0.3 0.3 0.2 3.0 3.0 3.0 3.0 3.0 3.0 1.0 1 .O 1 .O 1.0 1 .O 1 .O
-
Table 1 1. Materials handling limes, t,,~,.
Part TYpe 1
Rfg. Op. MC Materials Handling Op.
1
3 (un)LoadlOrientation
TransportationlNone
2
1 (un)LoadlPosition
TransportationlQuantity
lnspectionlQuantity
S&RIQuantity
mg.Op.
1
2
MC Materials Handling Op.
7 (un)Load/None
TransportationlNone
1 (un)LoadlOrientation
TransportationlNone
S&R/None
Equipment
Human
Light-duty belt conveyor
Hurnan
Light-duty belt conveyor
Light-duty belt conveyor
ASlRS
Equipment
Human
Light-duty belt conveyor
Hurnan
Light-duty belt conveyor
ASIRS
-
Table 13. Solution to the niatcrials handling systeiir seleclion probleiii.
A more unexpected result is that the inspection operation was assigned to the
human. One might be surprised that a heavy part was assigned to the human. This
obviously raises questions regarding potential ergonomic problems. However, for this
example, the human was the best-suited option for an inspection operation requinng an
orientation change. No other choice of materials handling equipment cornes even close.
In addition, humans are well suited to handle part types of high complexity and precision.
Similar interpretations can be made for the remaining assignrnents of the part types.
At times, the results may not be as simply justified. This is because the actual
assignments are a result of three ratings. As such, it is possible that a piece of equipment,
with the highest rating for a certain key product variable, is not chosen for a part type
exhibiting a high degree of that key product variable. This would be the case if that piece
of equipment rates poorly for the materials handling operations required by the part type.
The three parameten, le,,W, and W + I ;are
~ at the heart of the materials handling
system selection model. These parameters are largely subjective ratings of relationships.
Therefore, it is important that a sensitivity analysis be completed so that we may more
clearly understand their impact on the model's assignments.
Parameter
%-[is studied in great detail since it provides the link between product
design and rnanufacnuing design. Parameter Wcris partly handled by drawing a parallel
to the insight gained by the sensitivity analysis of
q.,.Finally,
some experimentation
with parameter CVlli;edemonstrates its impact on the assignments chosen by the model.
One c m draw a hypothesis regarding the impact of the rating factors from an
elementary analysis of the model's objective function. Since the final assignments are
lax-gely dependent on the values of the three factors, in general one may expect that a
single change to one of the factors wiI1 not cause an immediate change in assignments.
As an example, parameters
grand WC,are used in the evaluation of C,,
which measures
their differences for the various key product variables. As such, one will expect that a
small change in one of these parameters will not greatly impact the model's assignments.
One can predict that a significant change in one of these parameters must occur before
the solution is changed. In other words, one may expect the model to react to changes in
the factors, but without being overiy sensitive to these changes. Of course that this
hypothesis is based on generalized conclusions. There are always exceptions and if the
rating that is being changed has an impact on a constraint that was "tight" at the solution,
then we c m expect to see a change in the mode's assignments.
These hypotheses were tested and the results fiom the sensitivity analysis follow
below.
Sensitivity Analysis of
5.1.
A sensitivity analysis was conducted on
e,to study the response of the mode1 in
ternis of materials handling assignments to the differences in
?&,ratings.
A large number
of runs were conducted. The &Il listing of these can be found in Appendix II. A subset
of these is presented and discussed below.
The examples presented for the sensitivity analysis are based on the case study
Each key product variable for part type i = 2 was assigned a value of 2
example.
(indicating a low vaIue of that key product variable) or 4 (indicating a high value of the
key product variable). The total number of combinations, and therefore trials, were 25 =
32. The
F&,
ratings for every other part type remained unchanged. Al1 other ratings and
data also remained unchanged from the case study example. This meant that the only
paranleters that changed over the trials were those for part type i = 2.
Table 15 presents the results of the test runs. Please note the meaning of the
following abbreviations that are used in Table 15 to consente space:
C
P
D
BS
LMD
Complexity
Precision
Diversity
Batch Size
LinearMass Dimension
Each row in Table 15 represents a trial mn. The assignments determined by the mode1
for the required matenals handling operations follow the
@values
,,
used in that run.
Human
Heavy robot
Light robot
Heavy robot
Human
Hurnan
Human
Heavy robot
Light robot
Heavy robot
Light robot
Heavy robot
Human
Human
Human
Heavy robot
Light robot
Heavy robot
Light robot
Heavy robot
Human
Human
Human
Heavy robot
Light robot
Heavy robot
Light robot
Heavy robot
Human
Human
Human
Heavy robot
A
Table 15.
Whsensitivity analysis for part type 2 - assignmcnts.
Human
Heavy robot
Light robot
Heavy robot
Human
Human
Human
Heavy robot
Light robot
Heavy robot
Light robot
Heavy robot
Human
Human
Light robot
Heavy robot
Light robot
Heavy robot
Light robot
Heavy robot
Human
Human
Light robot
Heavy robot
Human
Heavy robot
Light robot
Heavy robot
Human
Human
Hurnan
Heavy robot
Light belt conveyor
Roller belt conveyor
Light belt conveyor
Roller belt conveyor
Light belt conveyor
Roller belt conveyor
Light belt conveyor
Roller belt conveyor
AGV
Roller belt conveyor
Light belt conveyor
Roller belt conveyor
Light belt conveyor
Roller belt conveyor
Light belt conveyor
Roller belt conveyor
AGV
Roller belt conveyor
Light belt conveyor
Roller belt conveyor
Light belt conveyor
Roller belt conveyor
Light belt conveyor
Roller belt conveyor
AGV
AGV
AGV
AGV
AGV
Roller belt conveyor
Light belt conveyor
Roller belt conveyor
Human ASlRS
Human
ASlRS
Human
ASlRS
Human
ASlRS
Human
ASlRS
Human
ASlRS
Human
ASlRS
Hurnan
ASlRS
Human
ASlRS
Human
ASlRS
Human
ASlRS
Human
ASIRS
Human
ASlRS
Human
ASlRS
Human
ASlRS
Human
ASlRS
Human
ASlRS
Human
ASlRS
Human
ASlRS
Human
ASlRS
Human
ASlRS
Human
ASlRS
Human
ASlRS
ASlRS
Human
ASlRS
Human
Human
ASlRS
Human
ASlRS
Hurnan
ASIRS
Human
ASlRS
ASlRS
Human
ASlRS
Human
Human
ASlRS
From the results obtained and presented in the Table 15, one c m analyze the
model's response to changes in
CC,values.
As such, we can take pairs of runs and
compare the resulting assignments. For example, if we look at runs # 1 and #2, we can
observe that the only value that was changed was that for lineadmass dimension. It was
changed from a value of 2 (low score) to a value of 4 (high score). From the resulting
assignments, we can see that for loadhnload operations, the human was replaced by the
heavy-load robot, As weil, for the transportation operations, the iight beIt conveyor was
replaced by the roller-bed beit conveyor. These constitute sound assignments since our
part type was changed fiom light and srnaIl to heavy and large. The assignrnents for
inspection and storage and retrieval operations remained unchanged. This indicates that
these assignments remain the most appropriate for the part type.
When the value for batch size was increased (cornpiirison of runs # 1 and #3) and
the values of all the other key product variables remained at 2, we observe that the onIy
change in assignments were that for the load/unload operations. In this case, the human
was replaced with the light-load robot. This seems appropriate since the robot is better
suited to process larger batch sizes.
A cornparison of runs # 1 and #5, where oniy the value assigned to diversity is
changed, shows that the original assignments remain optimal. This indicates that the
chosen assignments for this part type, when al1 other values for the key product variables
are set to 2, are optimal for both low and high values of diversity. However, the same is
not true for the case when the values of al1 the other key product variables are set to 4.
Comparing runs #28 and #32, we can observe that one of the assignments changes. For
the transportation operation, the mode1 chose an AGV for the case where the diversity
value was low (run #28) and the roller bed belt conveyor for the case where the diversity
value was high (mn #32). This makes sense since an AGV will usually require fixtures
for the part type and as such, it is better suited to a part type of low diversity. On the
other hand, the rolled bed belt conveyor can accommodate part types of high diversity
quite easily.
When we change the value of precision whiie keeping the values of al1 other key
product variables constant at a value of 2 (runs fC1 and #9), we observe some changes in
the assignments. The hurnan was replaced by a light-load robot for the Ioad/unload
operations and the light-duty belt conveyor was replaced with an AGV for the
transportation operations. An AGV is better suited to handle part types of high precision
(compared to a conveyor), even though it is hard to justiQ its use on a part type of low
complexity and low mass and dimension. However, given the set of materials handling
equipment that our model was forced to choose from, it has determined that this piece of
materials handling equipment is the best choice out of the set. One should also keep in
mind that the model does not consider costs and as such, the model ignores any cost
considerations from the assignment choices.
Finally, we can look at the case where only the value of complexity is changed.
From observing the assignments for runs #1 and # I 7 we can conclude that the model
responded to the change in complexity by choosing a different set of assignments. The
increase in complexity resuIted in the replacement of the human with a light load robot
for the load/unload operations and of the light-duty belt conveyor with an AGV. The
discussion presented for precision can be made in this case as well. While the AGV may
not be the ideal choice of materials handling equipment, it is the best suited out o f the set
of materials handling equipment that we made available to our model.
Many other comparisons can be made fiom the data presented in Table 15. To
avoid repetitiveness, these are not presented here. There were also more examples (nuis)
performed. These are included in the Appendix II. Overall, one will find that the model
responds correctly and as expected to changes in the values of the key product variables
for the parameter
5.1 .l.
Detailed Sensitivity Analysis of
W~
The comparisons derived from Table 15 were for changes in
II,of 2 units (values
of 2 and 4). In many situations, a difference of 2 units was enough to result in new
assigmnents. However, this was not always the case. It is worthwhile to investigate this
observation more carefùily to better understand how sensitive the model is to the changes
in the key product variables.
Looking back to Table 8, we can see that part type i = 2 from Our case study
example has the following ratings for
:
Part Type
Complexity
Precision
Diversity
Batch Size
-
5
5
I
3
3
Table 16.
e-t
Masskinear
Dimension
4
rrtings for part type i = 2.
To test what magnitude of a change in the key product variables is required to result in a
new set of assignrnents, sorne test nuis were performed for different values of complexity
and mass/linear dimension.
In the first case, we ran the model for al1 possible values of complexity while
keeping the values of the remaining key product variables unchanged. The results
indicated that a new set of assignments would only be generated when the value of
complexity was equal to or less than a value of 2. This implies that a change of 3 units (5
- 2) was
necessary for the model to choose a new set of assignments. In the new set of
assignments, the AGV was replaced with a roller bed belt conveyor.
For the second case, we tested for al1 possible values of massAinear dimension
while keeping the values of al1 other key product variables unchanged. in this case, it
was found that a change occurred when the value of masdlinear dimension was lowered
to 2 or less from the original value of 4. This indicates that only a change of 2 units was
required for new assignments to be generated.
Other similar tests were conducted. The testing indicates that usuatly a change of
2 or 3 units is required before a new set of assignments is generated by the model. This
means that the model responds to changes in the
q,val:
-s, but it is not overly sensitive.
In other words, small changes in the product design are possible without the need for a
new set of materials handling equipment. This mirnics what one typically expects to find
in a real world situation.
5.2. Sensitivity Analysis of Wd
A sensitivity analysis for WC,was conducted, but not as extensively as for
&,.
A
total of 10 runs were conducted. For the first set, the light-load robot was considered
while its complexity rating varied fiom 1 to 5 . In the second set of runs, the AGV was
strrdied as its mass/linear dimension rating was set to values between 1 and 5. This small
set of runs is far from being an exhaustive study of the effect of this parameter on the
solution. However, by studying the effects of two key product variables on two different
types of materials handling equipment, one can draw some preliminary conclusions of
interest.
5.2.1. Effect of the Complexity Rating of the Light-load Robot
In this set of experiments, the compiexity rating assigned to the light-load robot
(Le. W,, =
W i l )was varied between a very low value of 1 and a very high value of 5 . The
effects of this change on the overall solution were studied. Since the light-load robot was
only used for Ioadunload and handlelrehandle operations, these were the only operations
where different assignments occurred. The results from the various runs are summarized
in Table 17.
Some empirical conclusions cm be drawn kom observing Table 17. The most
important conclusion is that the mode1 responds to changes in the parameter W,,, but it is
not overly sensitive. For example, if we look at part type i = 1, we see that for a value of
complexity equal to 1, the human is the optimal materials handling equipment. When the
value of complexity is changed to 2, the hiiman remains optimal, but the light-load robot
is also optimal. For values of complexity equal to or greater than 3, the human is the
optimal assignment. This type of occurrence is common. In most instances, when the
complexity change leads to a new assignment, we encounter a situation where at the
transition point, we have two optimal choices of matenals handling equipment.
Also interesting is that for certain part types, the chosen materials handling
equipment type remains unchanged for any value of complexity. This means that the
chosen matenals handling equipment is very compatible with the part type. Although we
Vary the value of complexity, the previously chosen matenals handling equipment type
remains the best-suited equipment type for the part type.
5.2.2. Effect of the MasdLinear Dimension Rating of the AGV
For the second set of runs in the sensitivity analysis of parameter WC,,the
masdlinear dimension rating o f the AGV was tested at al1 levels between 1 and 5 (i-e. Wer
=
w&).In this case, it is only necessary to study the assignments for transportation and
inspection operations since these are the only two major materials handling operations
that the AGV perforrns. The assignments obtained fiom the various runs are summarized
in Table 18.
Observation of Table 18 reveals that a change in value for the mass/linear
dimension rating o f the AGV has almost no effect in the assignments deterrnined by the
model. There are only two part types for which a change in the value of mass/linear
dimension affects the output of the model. These are part types i = 4 and i = 6, As it was
found in the previous set of mns for the light-duty robot, a change in the final
a s s i v e n t s involves a transition point where bvo pieces of matenals handling equipment
are optimal.
I
I
I
C
C
C
S C T
-0, .!? -0,
A J A
At the first look, it is somewhat surprising that the change of value in massllinear
dimension for the AGV does not affect the assignments more strongly. However, one
must remember that masdlinear dimension is only one of the five key product variables.
If the match between equipment and part type for the other four key product variables is
good, then a change in massAinear dimension alone may not sufficiently affect the model
to result in a new set of assignments.
One can note that the AGV is only one of five available types of materials
handling equipment that can be used for transportation and inspection operations. As
such, it is very likely that a part type can be closely matched with one of the available
types of equipment. If the compatibility between the part type and a piece o f matenals
handling equipment is great enough, then a change in one of the key product variables in
unlikely to cause a change in assignments.
In general, small changes in the rating of a key product variable for a given part
type have little effect on the final set of assignments. Large changes in the rating are
rnuch more likely to affect the assignments fiom the model. However, if the
compatibility behveen a part type and a piece o f equipment is high, then a change in the
value of just one of the key product variables is much less likely to result in a change of
assignments.
5.3.
Sensitivity Analysis of Wh*.
The final portion of the sensitivity analysis was performed on parameter W,I,iee
Dim,/Mass = 1
Material Handling Op.
TransportationlNone
Light-duty conv.
TransportationlQuantity
Light-duty conv.
InspectionlQuantity
Light-duty conv.
2
Transportationmone
AGV
Inspection/Orientation
Human
TransportationlNone
AGV
3
TransportationlQuantity
Conveyors (")
TransportationlNone
AGV
AGV
InspectionlNone
ranspo a ion rienta ion
or I
TransportationlQuantity
Roller bed conv.
lnspectionlQuantity
Roller bed conv.
Conveyors (')
5
TransportationiNone
TransportationlNone
Conveyors (")
6
TransportationINone
Light-duty conv.lAGV (')
lnspectionlOrientation
Human
TransportationlQuantity
Light-duty conv.
InspectionlQuantity
Human
r TransportationlOrientation Power handtruck
InspectionIOrientation
Human
TransportationlNone
Power handtruck
lnspectionlPosition
Light-duty conv.
8
TransportationlNone
AGV
AGV
TransportationlNone
lnspectionlOrientation
Human
9
TransportationlNone
Power handtruck
InspectionlPosition
Human
TransportationiNone
Power handtruck
InspectionlOrientation
Human
Part
1
Dim.lMass = 2
Light-duty conv.
Light-duty conv.
Light-duty conv,
AGV
Human
AGV
Conveyors(")
AGV
AGV
Assignments
Uim.lMass 3
Light-duty conv,
Light-duty conv.
Light-duty conv.
AGV
Human
AGV
Conveyors (')
AGV
AGV
Dim.lMass = 4
Light-duty conv.
Light-duty conv.
Light-duty conv.
AGV
Human
AGV
Conveyors (')
AGV
AGV
Dim./Mass = 5
Light-duty conv.
Light-duty conv.
Light-duty conv.
AGV
Hurnan
AGV
Conveyors (
AGV
AGV
orkli
Roller bed conv.
Roller bed conv.
Conveyors (")
Conveyors (')
. .
L
Human
Light-duty conv,
Human
Power handtruck
Hurnan
Power handtruck
Light-duty conv.
AGV
AGV
Hurnan
Power handtruck
Human
Power handtruck
Human
r
1
Table 18, Sensitivily analysis rcsults for II', = Ilas,
Roller bed conv.
Roller bed conv.
Roller bed conv.
Roller bed conv.
Conveyors(*)
Conveyors (')
Conveyors(')
Conveyors (')
AGV
Light-duty conv.lAGV (')
t-iuman
Human
Light-duty conv.
Light-duty conv.
Human
Human
Power handtruck
Power handtruck
Human
Human
Power handtruck
Power handtruck
Light-duty conv.
Light-duty conv.
AGV
AGV
AGV
AGV
Human
Human
Power handtruck
Power handtruck
Human
Human
Power handtruck
Power handtruck
Human
Human
Roller bed conv.
Roller bed conv.
Conveyors (")
Conveyors (')
. .
Light-duty conv.
Human
Light-duty conv.
Human
Power handtruck
Human
Power handtruck
Light-duty conv.
AGV
AGV
Human
Power handtruck
Human
Power handtruck
Human
Dim.lMass = 4
Power handtruck
Power handtruck
Conveyofs ( 7
Light-duty conv.
Light-duty conv.
Human
AGV
AGV
Uim.lMass = 5
Power handtruck
Power handtruck
Conveyors ( 7
Light-duty conv.
Light-duty conv.
Human
AGV
AGV
Light-duty conv.
Light-duty conv.
Light-duty conv.
TransportationlNone
Light-duty conv.
Light-duty conv.
Light-duty conv.
Light-duty conv.
Light-duty conv,
TransportationlNone
Light-duty conv.
Light-duty conv.
Light-duty conv.
Light-duty conv.
InspectionlNone
Light-duty conv,
Light-duty conv.
Light-duty conv,
Light-duty conv.
TransportationlQuantity
InspectionlQuantity
Human
Human
Human
Human
Light-duty
conv.
Light-duty
conv.
Light-duty
conv.
Cight-duty
conv.
TransportationlNone
Light-duty conv.
Light-duty conv.
Light-duty conv.
Light-duty conv.
InspectionlNone
Holler
bed
conv.
Koller
bed conv.
Roller
bed
conv.
Holler
bed
conv.
14
TransportationlNone
Power handtruck
Power handtruck
Power handtruck
Power handtruck
TransportationlPosition
Roller bed conv.
Roller bed conv.
Roller bed conv.
Roller bed conv.
InspectionlQuantity
)
lndicates that any of the available materiak handling equipment of that type was optimal for the assignment.
Light-duty conv.
Light-duty conv.
Light-duty conv.
Light-duty conv.
Human
Light-duty conv.
Light-duty conv.
Holler bed conv.
Power handtruck
Roller bed conv.
Part Material Handling
- Op.
.
1O TransportationlQuantity
TraiisportationlQuantity
InspectionlQuantity
11
TransportationlNone
TransportationlNone
lnspectionlPosition
12
Iransportation/None
TransportationlPosition
13
Table 18. (cont'd 1)
Uim.lMass = 1
Power handtruck
Power handtruck
Conveyors ( 7
Light-duty conv.
Light-duty conv.
Human
AGV
AGV
Dim.lMass = 2
Power handtruck
Power handtruck
Conveyors(')
Light-duty conv.
Light-duty conv.
Human
AGV
AGV
Assignments
Uim.lMass 3
Power handtruck
Power handtruck
Conveyors (')
Light-duty conv.
Light-duty conv.
Human
AGV
AGV
Again, a total of ten runs, divided into two sets, were conducted. The first set
studied the effect of the (un)Load/Onentation rating of the light-load robot (Le. Wl1he=
W I I I on
) the assignrnents. The second set of runs studied the effect of the
TransportatiodQuantity rating of the roller bed belt conveyor (i-e. Wh\;e= WJJ6)on the
materials handling assignrnents.
5.3.1. Effect of the (un)Load/Orientation Rating of the Light-load Robot
As can be observed fiom Table 19, the effects of the (un)Load/Orientation rating
of the light robot were as predicted. The results from the test runs show that the mode1 is
capable of responding to changes in the
ratings, without exhibiting over-sensitivity.
The results also highlight the fact that the mode1 behaves as expected by choosing the
optimal assignments.
For most of the part types, the assignments remained unchanged for al1 values of
the (un)Load/Orientation rating of the light robot. This indicates that the original
assignrnents were the best possible assignments, while the next best assignments were far
behind it. This also indicates that in order to cause a change in assignments, it is
necessary to change more than one rating.
For the few part types where the original assignments were replaced by new
assignments, the change was progressive. At the interface between assignments, hvo
optimal assignrnents were chosen for a rating. An example of this is part type i = 7.
From Table 19, it can be seen that the human is the preferred choice of materials handling
equipment for un(Load)/Orientation values between 1 and 3. For a rating equal to 4, the
model chose two optimal pieces of materials handling equipment, the human and the
light-load robot. When the rating is further increased to a value of 5, the optima1
assignment becornes the light-load robot. Please note that part types i =6 and i = I I are
not present in Table 18 because these part types do not require any (un)Load/Orientation
operations.
5.3.2. Effect of the TransportationfQuantity Rating of the Roller Bed Belt
Conveyor
The results obtained for the mns conducted to study the effect of the
TransportatiodQuantity rating of the roller bed belt conveyor are summarized in Table
20. OnIy those part types requiring any Transportation/Quantity operations are listed in
the table. It is for this reason that part types i = (2, 5 , 7, 8 , 9 , 1 1, 12) are not listed in
Table 30.
There is one case, that of part type i = 3, where at the transition point, two different types
of materials handling equipment are optimal. However, for al1 other part types, there is
no smooth transition as has been observed quite often in other runs of the sensitivity
analysi S. This happens because when the TransportatiodQuantity rating of the roller bed
beit conveyor is set equal to 5, it assumes the highest rating for that
operatiodsuboperation combination of al1 types of materials handling equipment.
Essentially, it tells the model that the roller bed belt conveyor is the best piece of
materials handling equipment to perfonn the required materials handling hnctions,
which in this case is the TransportatiodQuantity function. As such, there is a strong bias
for this type of rnatenals handling equipment to be assigned to part types requinng those
functions.
Again, we can observe that in general, the mode1 responds to changes in the rating
value, but is not overly sensitive.
Part
1
3
4
6
10
13
Material Handling Op.
Quantity = 1
Quantity = 2
Quantity = 3
Quantity = 4
Transportation/Quantity
Light-duty conv.
Light-duty conv.
Light-duty conv.
TransportationlQuantity
Light-duty conv.
Light-duty conv.
Light-duty conv.
Conveyors (*)
~rans~ortationl~uanti&
Fo r k i f t l ~ i ~conv.
h t (') ForklifULight conv. (*) ForkliWLight conv. (*) Roller bed belt conv.
Light-duty conv.
Light-duty conv.
Light-duty conv.
~ransportationl~uantit-y Light-duty conv.
TransportationlQuantity Powered hand truck Powered hand truck Powered hand truck Powered hand truck
light-duty conv.
Light-duty conv.
Light-duty conv.
Light-duty conv.
TransportationlQuantity
'iàblc 20. Sensilivity analysis rcsults for Ilhie = IIJJ6
Quantity = 5
Roller bed belt conv.
Roller bed belt conv.
Roller bed belt conv.
Roller bed belt conv.
Roller bed belt conv.
Roller bed belt conv.
A program was created to simplify the use of the developed models and to
iIlustrate the potential for this work as an industrial application. The program was coded
with Visual Basic 5.0 and interfaces with Microsoft Access 8.0 and Lingo 5.0. The
program is capable of handling any problem size. Any limitations to problem size are
imposed by the number of records that Microsoft Access 8.0 can handle and the number
of constraints that Lingo 5.0 c m solve. The larger the problem, the more random access
memory will be required for the successfiil operation of Microsofi Access and Lingo.
The full code listing can be found in Appendix IV.
The Solver program fûlfills three major goals. tt allows access to the models data
for creation or modification, it solves the models and it produces reports containing the
solution to those models. The data creation or editing is allowed through Microsoft
Access. One single database called OA.MDB holds al1 the data that the two models
require. The models are solved when the SoIver program calls a Lingo runtime library
that provides access to Lingo's solving capabilities. A Lingo script file was created for
each mode1 (see Appendix 1). This script file is passed by the Solver program to the
Lingo runtime library. Finally the output reports are created and c m be viewed and
pnnted fiom within the program.
The program graphical interface is very simple and clean. The main form that is
visible afier launching the program c m be seen in Figure 1. This form consists of several
key components. There is a menu bar and its accornpanying menu items. There are also
bvo buttons that are used to solve the hvo models. Each button is accompanied by a
disptay area where the value of the objective function is displayed once the mode1 is
successfully solved. Finally, there is also an exit button that terminates the application.
--
- .
tord
.
Figure 1. Main form of the Solver program.
The various components in the main window are presented in more detail below.
6.7. The Menu Bar
The menu bar consists of a number of menu entries. The headings in the menu
bar drop down to reveal one or more menu entries. Each menu entry performs a specific
function. This is similar to nearly every other appIication in the Microsoft Windows
platform that contains a menu bar. Each heading and the menu entries it contains are
now described.
6.1 -1. The File Heading
The Fife heading in the menu bar contains two menu entries: Launch Access and
Exit. These entries can be seen in Figure 2.
-
--
Figure 2. The File menu entries.
The Launclr Access menu entry will start Microsofi Access with the data file,
OA-MDB,open for editing. This is the recommended way of editing the data when
extensive modifications are required.
The Exit menu entry simply stops the program. It perfoms the sarne function as
the Exit button at the bottom of the form.
6.1 -2.The Data Heading
The Dura heading contains a number of menu entries (see Figure 3). When
clicked, each menu entry will open a corresponding data table from the database
OA-MDB. Not al1 the tables in the database are shown. Some of the tables do not require
modifications. These include those listing the major materials handling operations and
suboperations and the key product variables. In addition, the tabIe containing the
parameter A, is not shown. The data in this table is filled in automatically aAer the
operation allocation mode1 is solved.
Figure 3. The Data menu entries.
The list of the tables in the database OA-MDB,their corresponding menu entries
in the menu bar and piirpose ore summarized in Table 2 1.
As mentioned above, each menu entry under the Data heading will open a
database table. Figure 4 shows such a data table. In this case, the data table shown was
opened by clicking on the menu entry Machines. Various operations can be performed
within that table view. It is possible to add, delete o r edit a record. Other miscellaneous
operations are available through the button bar at the top of the fom.
i
Data menu
1
Table ia database I Contents
-- OA.MDB
Parts
Lists the part types and associated
demands
Lists the machines and associated
capacity and setup costs
Lists the matenals handling
equipment and time available
Lists the manufactunng operations
] Lists the process plans
1 Lists the possible Part-Plan
combinations
Lists the possible Part-Plan1 Manufactunng Operations
1
combinations
Lists the possible Part-Plan~anufac&n~
Operations-Machines
combinations
Lists the materials handling costs of
rnoving a part type from machine j to /
1 machine î
1
Lists the ratings for the parameter Wjf
Lists the ratings for the parameter
i
Machines
Machines
MH-Equip
Mfg Operations
Part-Plan
MfgOps
Plans
PartPlan
PartPIanOp
PartPlanOpMC
MHC
1
1
1
a
!
W-i t
W-et
'
WC,
W hhe
W-hhe-Time
1
Lists the ratings for the parameter
WI,/;,as well as the time required to
perform the materials handling
fùnction hh with equipment e
Lists the materials handling
requirements a,,,;,,
1
I
iMH Requirements
MH-Req
Table 21. Data menu entries and associated database tables.
1
I
Figure 1. Table for the Machines menu entry.
To add a new record, the user simply clicks on an empty row and adds the
information. To delete a record, the user must highlight the desired row (record) and
press the DEL or DELETE key in the keyboard. Other operations are possible and the
button bar at the top of the form explicitly lists these.
A complete description of al1 the tables in the database along with their fields and
requirements can be found in Appendix III.
6.1.3.The Reports Heading
This heading contains two menu entries as can be seen in Figure 5. The
Operation AIIocafiorr entry will open an output report for the operation allocation model.
Similarly, the Materials Handlirrg menu entry wilI open an output report for the
materials handling system selection rnodel.
- -
Figure 5. The Reporrs menu entries.
The reports are opened with Notepad, which allows for output to a pnnter. Figure
6 shows a sarnple report.
Every time the report file is written, its date and time of creation are written in the
top line. The output from the mode1 is then listed in an easy to understand format.
6.1 -4. The Help Heading
The Help heading contains two menu entries as can be seen in Figure 7. The first
menu entry is entitled Documeniatioti. This entry will open a help file in the Microsofl
Word format. The file is essentially the sarne as the current chapter of the thesis report
with the addition of the information pertaining to the database OA.MDB, its tables and
fields. This help document provides a quick and convenient way for the user to become
farniliar with the program.
lachine Selection and Operation fissignnents
---------_-------------------------------'art
Process Plan
Operation
Machine
------------------_----------------------1
1
10
10
11
11
12
2
2
1
1
1
1
2
1
2
1
2
1
2
1
I
Figure 6. Operation Allocation report window.
Figure 7. The Help menu entries.
3
1
7
1
5
3
4
The About menu entry opens a new window with general information about the
Solver program.
6.2. The Buttons
There are three buttons in the main window. The boxed buttons are used to solve
the hvo models, while the button at the bottom of the window will exit the program.
6.2.1.The Model Solver Buttons
The labels on the buttons clearly indicate their purpose. The top button is labeled
Solve Operation Allocation Problem. When pressed, the program is instructed to pass
on instructions to the Lingo runtime library to solve the operation allocation model. The
comrnands passed to Lingo are presented in a dialog box that is s h o w imrnediately afier
the button is clicked. Figure 8 illustrates this dialog box.
-
:.*
-
SET 1ERSEO 1
SET MXMEMB 16
FREEZE
TAKE C;~THESIS,WORK\SO~VERU~A-GD.CNG
GO
DIVERT C:~THESIS_WORKUOLMRU-SOUITION.TXT
NONtX
RVRT
QUIT
Figure 8. Dialog box illustrating the commands passed to Lingo.
Once Lingo has solved the model and returned command to the Solver program, a
dialog box is activated to infonn the user about the successfulness of the operation. If
Lingo was unable to solve the model, a dialog box wams the user that an error was
encountered. If Lingo was successful, a dialog box such as the one in Figure 9 is
obse~ed.
.
--
Figure 9. Dialog box informing the user about Lingo's success in solving the model.
The main window is then updated to show the value of the objective fùnction.
This is shown in the label beside the solve button. Figure 10 shows the main window
after the two models were solved. Please note that the values of the objective fùnctions
are shown to the nght of the solver buttons.
The process to solve the materials handling system selection problem is similar to
that described above for the operation allocation problem. Again, clicking on the button
entitled Solve Materials Handling Problem will start the solving procedure.
The operation allocation problem must be solved prior to solving the materials
handling system selection problern. This is necessary because the output from the
operation allocation model is used as input to the materials handling system selectîon
model. As such, the program does not allow the Solve Materials Handling Problem
button to perform its action until the operation allocation rnodel has been solved. Figure
1 1 shows a dialog box that is displayed to the user if the second button is pressed prior to
solving the operation allocation problem.
Figure 10. Main window after both rnodels were solved.
Figure 11. The operation allocation problem must be solved first.
6.2.2. The Exit Button
The third and final button is a simple Exit button. When pressed, this button
causes the program to finish execution.
CHAPTER 7.
The models presented here are planning models that generate some of the design
details required to draw a conceptual design of a rnanufacturing system. As such, these
are not operational models. Currently, the models are applicable to a single cell. The
objectives are to select groups of machines, load those machines to manufacture a
specific group of parts and then select a suitable materials handling system to handle
those parts at or in between the machines. The models were developed in the context of a
flexible rnanufacturing system or cell.
The integrated approach descnbed by this work consists of major phases that are
completed in a sequential manner. In the first phase, the operation allocation model
determines the optimal group of machines to process the part types and then assigns the
operations of the part types to the machines. The assignments are done so that the total
cost of operations, machine set-up and materials handling (transportation) is minimized.
These assignments are then passed on to the materials handling system seIection problem
where they are used as input values.
In the second phase, the materials handling system selection model is solved. The
materials handling systern selection model determines the optimal group of matenals
handling equiprnent to perform a11 the required materials handling operations.
The
equipment is chosen based on its ability to perform the required materials handling
functions and its compatibility to handle part types with certain key product
characteristics. The mode1 considers several important constraints imposed o n the system
such as biases towards equipment combinations and equipment capacity. The result of
the second phase is the selection of the best materials handing system to handle a given
product-process combination.
The sensitivity analysis performed for the materials handling system selection
model shows that the model responds to changes in the rating values (Le., the ratings for
W, and &) but is not overly sensitive. In most situations, a value of four in one of
the ratings will produce the same assignments as a value of £ive. In general, a difference
of two points or greater is required for a change in assignments to occur. This finding is
extrernely important since the values for the rating factors are subjective and will
undoubtedly differ from user to user. The fact that the model is not overly sensitive to
changes in the ratings indicates that two users are likely to reach the same assignments
even though the values they assign to the various ratings may differ somewhat.
The conclusions made fiom the limited sensitivity analysis need to be fiirther
confirmed.
These conclusions were based on the analysis of a single and perhaps
somewhat simple example. It would be extremely interesting to study how the models
react to extreme exarnples with various "tight" constraints. Nonetheless, the preliminary
results fiom the sensitivity analysis are very positive and encouraging.
A Visual Basic program was developed to ease the use of the models and
demonstrate the potential of the work as a practical application in iodustry. The Solver
program allows for data editing, solution to the operation allocation and matenals
handling system selection problems and report generation of the models' output. The
program allows for quick evaluation of what-if scenarios while providing a simple
interface with a small learning curve, even for personnel not familiar with linear integer
programming.
The results of the case study example show that the model can be successfülly
used as a tool for solving the joint operation allocation and materials handling system
selection problems with product design considerations. The computational time required
to solve the models was under one minute on a personal computer (AMD K6-2 350Mhz).
The time will increase for larger and more realistic problems, but it is expected to remain
computationally feasible.
The methodology presented here provides the decision-maker with a rapid
modeling tool to solve the joint operation allocation and materials handling system
seiection problems. The Solver program that was developed is a first implementation of
a rapid modeIing tool to solve both problems. The two problems are solved sequentially
at this point. There is a flow of information from the operation allocation problem to the
materials handling system problem, but there is no feedback. This means that it is not
possible to provide feedback to the operation allocation model and then rerun the models
to fine-tune the overall solution.
This is a recognized shortcoming of the present
implementation of the model to be addressed in future research.
The current implementation of the model offers some flexibility not available in
other models. For a given operation allocation solution, it is possible to experiment with
the product-process combination. For instance, it is possible to identie the materials
handling equipment best suited for a given product design. This is what was done in the
case study example. However, it is also possible to study what product characteristics are
best suited for a specific set or group of materials handling equipment. This provides a
welcomed iink between product design and manufachiring logistics design.
7 1.
Future Research
The current work may be fùrther developed and extended in a variety of ways. Of
course, future researchers' interests will dictate the path, but some of the possible
extensions to this work are discussed below.
The first and most natural extension to the work is to develop a feedback link
between the materials handling system selection problem and the operation allocation
problem.
The main idea is to provide a mechanism by which the goal becomes to
optimize the combined solution to the two problems, rather than the optimization of each
individual probiem. The current implementation of the models already allows for oneway communication between the models.
The output from the operation allocation
problern is used as input to the materials handling system selection. What remains to be
done is to develop a similar link from the materials handling systems seIection model to
the operation allocation model. One could then enter a cyclic iterative process until the
'best' solution to both problems is obtained. Two great challenges to this extension are
developing the feedback link and determining the condition or process that informs the
modeIs to stop iterating.
Another possible extension to the model, and one that requires serious
consideration, is the development of a rigorous method of assigning values to the
currently subjective rating factors of the materials handling system selection model. This
will be a difficult task since the relationships that the ratings attempt to measure do not
lend themselves easily to measurernent.
The materials handling system selection mode1 may also be extended by
considering cost. Presently, the model rnakes no consideration for the cost of materials
handling equipment or the fhctions they perform. As such, one can readily think of the
diIemma that occurs when the mode1 must choose between two equally able pieces o f
materials handling equipment. Since they are both equally 'able', the model makes a
random decision as to which one to choose. In reality, one would choose the lowest cost
option. This is an extreme case, but also one that highlights a limitation of the current
In such cases, it may make sense to extend the model to include cost
model.
considerations.
The Visual Basic program could also be further developed to improve its
functionality and appeal as an industrial application. This would be of even greater
importance once some of the work outlined above has been completed.
When the
complete integration of the operation allocation and materials handling system selection
models has been fully addressed, it might be interesting to improve the Solver program to
make it a viable product for engineers and managers. There are a number of areas where
the program c m be improved. These include user interface design, better handling of
errors, user defined files and paths, etc.
There are other options for fiirther development of the work presented. The ideas
outlined above are just some of the more obvious extensions. It is this author's opinion
that the completion of those would greatly improve upon the work that has been
achieved.
The work described in this report represents an important step in the developrnent
o f an integrated approach to manufacturing systerns design.
An existing operation
allocation model (Atmani et al., 1995) was modified appropriately.
The materials
handling system selection model by Atrnani and Dutta (1 996) was extensively overhauled
and refomulated for the context of this work. The two models were linked and solved
sequentially. A large problern was solved and sensitivity analysis was carried out for the
rating factors in the materials handling system selection model. This analysis showed
that the model tolerates small differences in the values of the subjective ratings, without
generating a new solution. A Visual Basic application was developed to simpliQ the use
of the models. This practical application c m be used as a rapid modeling tool by the
decision-maker.
The integration of the operation allocation and materials handling system
selection models is a very interesting and challenging problem. The work gresented in
this thesis is a first step in developing a thorough solution to that problem. It provides a
base from which future researchers may fùrther develop and extend the current solution
to this integration problem.
References
A T M A K A.
I , (1995),A production planning model for flexible rnanufacturing systems wïth setup cost
consideration. Cornputers and hiustrial Engineering, 29,723-727.
R.S., and CARON,R.J. (1995),A mathematical programming approach to joint ceil
ATMAXI. A., LASHKARI,
formation and opention allocation in cellular manufacturing. International Jounral of Production
Research, 33. I 15.
-
Durri\, S.P. (1996). Product design and matenals handling system selection - a
concurrent engineering approach. hternational Journal of Industrial Engineering - Applicarions
und Pracrice, 3,40-50.
ATMANI,A., and
ATMRNI.A., and L~sriIcsfu,R.S. (1998).A model of machine-tool selection and operation allocation in
FMS. Inrernarional Journal of Producrion Rcsearch. 36. 1339- 139.
AYRES,R.U.( 1988), Complexity, Reliability and Design: Manufacturing Implications. Manufactzwing
Reviav. 1,2635.
.M., and STECKE,K.E. (1986),A branch and bound approach for machine load balancing in
BERRADA,
fiexible rnanufacturing systems. Management Science, 32, 13 16- 1335.
Ciru. H.-K.. EGBELU.P.J.. and Wu, C.-T. (1995),Advisor: a computer-aided material handling equipment
selection system. /ntenratiortal Journal of Production Research, 33-33 1 1-3329.
V.. LASIIKARI.
R.S., and SINGH.N. (1992). A production planning model for cellular
DAMODALIN.
rnanufacturing systerns with refixturing considentions. Inrernarional Journal of Producfion
Rcsearch, 30, 1603-1615.
GUERRERO,
F., LOZANO.S., KOLTAI,T.,A N D LARIWNETA.
J. (l999),Machine loading and part type
selection in flexible rnanufacturing systems. InremarionalJournal of Production Research, 37.
1303-1317.
GUPTA.T.. and D ~ AS.P.
. (1994),AnaIysing materiaIs handling needs in concurrent Isimultaneous
enzineering. fnrernational Journal of Operations and Production Management, 14,68-82.
HARIT. S., and TAYLOR,G.D. (1995). Framework for the design and analysis of large scale material
handling systems. Proceedings of rire 1995 Winrer Simularion Conference Dec 3-6 1995.
HASSAN. iM.M.D., HOGG,G.L., and SMITH,D.R-(1985).A construction algorithm for the selection and
assignment of materials hand1ing equipment. Inrernational Journal ofProditction Research, 23,
38 1-392.
Krxf, K.S., and EOM.J.K ( 1 997), Expert system for selection of rnatenal handling and storage systems.
Inrernarional Journal of Industrial Engineering - Applicarions and Practice, 4, 8 1-89.
R.S.,
A.M. (1987),A new formulation of operation allocation
LAS~IKAR
I , DUTTA,S.P., and PADHYE,
problem in flexible manufacturing systerns: mathematical modelling and computational
experience. /ntemarional Journal of Production Research, 25, 1267- 1283.
L~NDOSYSTEMS,
INC. ( 1 999), Lingo User S Guide,Lindo Systems Inc., Chicago, Illinois.
MATSON,J.O., SWAMINATHAN, SR.,and MELLICHAMP,
J.M. (1990), Knowledge-based material handling
equipment selection. Proceedings of rhe 1990 International Indicsrrial Engineering Conference
May 20-23 / WO,2 12-27.
M. (1993), Integrirted modeling methodology for material handling
NADOLI,G., and RANGASWAMI,
systerns design. Proceedings ofthe 1993 Winter Simulation Conference Des 12-/5 1993,785789.
NOBLE.J.S.,KLEIN,CM., and MIDHA,A. (1998), An integrated model of the material handling system and
unit load design problem. Journal of Manufacruring Science and Engineering, 120, 802-806.
NOBLE,J.S., and TANCHKO,J.M.A. (1994), Design justification of material handling systems. Material
(Ed. J . M A Tanchoco), Chapman-Hall, U.K., 54-72.
Flow $vsrems in hfanufactu~ng
R.S., ATMANI, A., AND DUTTA,S.P. (1999). A mathematicai model of operations
PAULO.J., LASEKARI,
allocation and materials handling system selection problerns in a flexible manufacturing system.
Proceedings of the 4Ih Annual International Conference on Indusrrial Enginccfing Theon.
..Ipp/icarionsand P r d c e November / 7-20. 1999.
REMBOLD,
B.F., and TANCHOCO,
J.M.A. (1994). An inte-gated framework for the design of material flow
systerns. M~zrerialFlow Sysrems in Mantrfacruring (Ed. J.M.A. Tanchoco), Chapman-Hall, U.K.,
3-53.
RIBEIRO,
J.F.F., and P M D N , B. (1993), A methodology for cellular manufacturing design. Inremarional
Journal ofProdircrion Research, 31. 235-250.
STECKE.K.E. ( 1983). Formulation and solution of nonlinear integer production planning problerns for
flexible manufacturing systerns. Management Scierice, 29,273-288.
TABOUN,
S., and ULGER,T. (1992), Multi-objective modelling of operation-allocation problems in flexible
manufacturing systems. Cornpurers and I~zdusrrialEngineering, 22, 95-1 00.
TAHA,A.H. (1992), Operations Research 5Ih Edirion, Macmillan, New York, N.Y.,333-334.
TOMI'KINS,
J.. and WHITE,J.A. (1984). Fuciliricsplanning, John Wiley, N e w York.
VONDEREMBSE,
M.A.. R~GHUNATHAN,
T.S.,and h o , S.S. (I997), A post-industrial paradi-m: to integrate
and automate manufacturing. hrernnrional Journal ofProducfion Research, 35, 2579-2599.
WELGAMA,
P.S., and GIBSON,P.R. (1995). Hybrid knowledge basecVoptimization system for automated
selection of materials handling system. Compure.~
and Indusrrial Engineering, 28.
\~ILSC)N,
J.M. (1989). An alternative formuIation of the operation-allocation problem in flexible
manufacturing systerns. International Journal of Producrion Research, 27, 1405- 14 12.
Appendices
Appendix 1.
Lingo Program Files
Appendix II.
Sensi tivity Analysis Results
Appendix HI.
Database TabIes
Appendix N.
Solver Program Source Code
Appendix 1. Lingo Program Files
Operation Allocation Modal
MODEL :
I
SETS DEFINITION - - - - - - ;
, - - - - -
SETS :
Part : D;
MC: M, b, SC;
Plan;
Operation;
PPlan (Part, Plan) : Z;
PPO (Part, Plan, Operation) ;
PPOM (Part, Plan, Operation, MC) : OC, t ;
PPOMl (Part, Plan, Operation, MC) ;
MH Cost (Part, MC, MC) : MfIC;
in (Operation, MC, MC, Part, Plan) : L;
Decision (Part, Plan, Operation, MC) : X;
ENDSETS
1
- - - - - - OBJECTIVE FUNCTION - - - - - -
.I ,-Operating Cost
CI
=
.I - - Setup Cost
C2
@SUM
1
;
;
=
(MC( j ) :
SC()) * M ( j )
;
;
.I - - Material Handling Cost ;
C3 =
@SUM (PPOM(i,p,s,
j) :
@SUM (PPOMl(il,pl,sl,jl) 1 i #EQ# il #AND# p #EQ# pl
#AND# s1 #EQ# s+1 :
MHC(i, j, jl) * L ( s , j, jl, i, p )
) ;
1
;
.I - - Actual Objective Function
[OBJ] MIN = Cl + CS + C3 ;
;
------
;
CONSTRAINT SET # 2 - - - - - &FOR (PPO(i,p.s):
@SUM (PPOM(i,p,s,
j) :
X(i, p l s, j)
) = Z ( i , p);
;
- - - - - - CONSTRAINT SET #1
@FOR (Part(il :
I
@SUM
)
I
(PPlan(i,p):
Z ( i , p)
= 1;
----,-
) ;
I
1
CONSTRAINT SET # 3 - - - - - (MC(j):
@SUM (PPOM(i,p,
s,j) :
X(i, p l s l j)
) >= M(j);
----,-
&FOR
;
;
I - - - - - CONSTRAINT SET #4 - - - - - - ;
&OR
(MC( j ) : [TIME CONSTRAINT]
@SUM
)
<=
(PPOM(~,~,
j)
S:,
D(i) * t ( i p , s j * X(i, p l s r j)
b(j) * M(j);
) ;
CONSTRAINT SET #5 - - - - - - ;
@FOR (PPOM(i,p,s,j):
@FOR (PPOMl(il,pl,sl,jl) 1 i #EQ# il #AND# p #EQ# p l
#AND# sl #EQ# s + 1 :
X(i, p , s, j) + X ( i 1 , pl, s1, jl)
- 2 * L ( s , j , jl, i, p ) >= O
I ----,-
) ;
1;
1 - - - - - - CONSTRAINT SET #6
------ ;
aFOR (PPOM(i,p,s,j):
@FOR (PPOMl(il,pl,sl,jl) 1 i #EQ# il #AND# p #EQ# pl
#AND# sl #EQ# s+1 :
X(i, p, s, j) + X(i1, pl, sl, jl)
- L ( s , j , 11, i f p) C = 1
1;
) ;
I N T E G E R CONSTRAINTS - - - - - -
1 -,----
;
! L must be integer ;
BFOR (Part (i):
@FOR (Pian(p):
@FOR (Operation(s):
@FOR (MC(j):
@FOR (MC(j):
@BIN ( L ( s ,
j,
j, i f p ) )
1;
1
;
1;
1;
1
;
! X must be integer ;
@FOR (Part (il :
@FOR (Plan(p):
@FOR (Operation( s ) :
@FOR (MC(j):
@ B I N (X(i, p , s, j))
1;
) ;
!
M must be integer
@For
) ;
(MC(j):
@BIN(M(j))
;
1
- - - - - - DATA DEFINITION - - - - - -
;
DATA :
Part = @ODBC('OA', 'PARTS', 'PART1);
D = @ODBC('OA', 'PARTS', ' D E M A N D ' ) ;
MC = @ODBC ( ' OA ' , ' MACHINES ' , ' MACHINE ' ) ;
b = @ODBC('OA', 'MACHINES', 'CAPACITY');
SC = @ODBC( ' OA ' , 'MACHINES' , 'SETUP COST ' ) ;
Plan = B O D B C ( ~ O A ~TLANS',
,
Operation = @ODBC ( 'OA1, 'MFGOPS ' , 'MFGOP ' ) ;
PPlan = @ODBC('OA1, 'PARTPLAN', 'PART', 'PLAN');
PPO = @ODBC('OA1, 'PARTPLANOP', 'PART', 'PLAN',
'MFGOP') ;
PPOM = @ODBC('OA', 'PARTPLANOPMC', 'PART', 'PLAN',
'MFGOP', 'MACHINE');
PPOMI = @ODBC('0A1, 'PARTPLANOPMC', 'PART', 'PLAN',
' MFGOP ' , MACHINE ' ) ;
OC = @ODBC('OA1, 'PARTPLANOPMC', 'MFGOP COST');
t = ~ D B (Cl OA l ,
PARTPLANOPMC , MFGOP-TIME1 ) ;
MHC = @ODBC('OA1, 'MHC', 'MHC');
@POINTER(I) = OBJ;
@POINTER (2) = @STATUS ( ) ;
ENDDATA
'PLAN~T
I
- - - - - - THAT IS ALL, FOLKS!
------;
END
Materials Handling System Selection Model
MODEL :
I---,-,---,------------------------------------------------.
!
!
!
!
Lingo program for the Materials Kandling System Selection;
Revised to explicitely list sets and generalize
f
Author: Jorge Paulo
f
Date: 1999-2000
f
A (Mfg-Opt
P a r t , MC) ;
Alpha ( P a r t , Mfg-Opt MC, MH O p t MH ~ u b o p ;)
Rate hhe(MH E q u i p . MH-Opt
subopy: W-ehh,
Rate-et(MH-&yip,
Tech) : W -ec ;
ate-it ( p a r t . Tech) : W-it ;
I
HH ~ y m e (MH E q u i p . MH_Op, MH-Subop) : t;
~ e z i s i o n ( ~ i p h a .MH-E q u i p ) : Y;
ENDSETS
*
t
;
I - - - - - - - - - - - - - - - - - - - - - - D E F ITHE
N E DATA---------------------'
DATA :
Part = @ODBC('OA1, 'PARTS', 'PART');
Demand = @ODBC('3A1, 'PARTS', IDEMAND');
MH-Equip = QODBC(lOA1,'MH EQUIP', 'MH EQUIP');
'TIME');
Tirne = @ODBC('OA1, 'MH EQUÏP',
MC = @ODBC ( OA , MACHINES , MACHINE ) ;
Mfg-Op = @ODBC('OA1, 'MFGOPS', 'MFGOP');
Tech = @ODBC('OA1, 'TECH', 'TECH');
MH_Op = @ODBC('OA1, 'MH-OP', 'MH OP');
'MH-SUBOP');
MH-Subop = @ODBC(lOA1, 'MH SUBOP',
A = @ODBC('OA1, A
'MFG OP', 'PART', 'MACHINE');
Alpha = @ODBC('OA1, ' M H-R E Q I ,
'PARTJ,'MFG O P 1 , 'MACHINE1,'MH-OP', 'MH SUBOP');
Rate-hhe = @ O D B C ( T ~ ~ l'W
,-HHE-TIME', 'MH-EQUIP',
MHOP', 'MHSUBOP');
W ehh = @ODBC('OA1, 'W-HHE-TIME', 'W H H E ' ) ;
~ a t eet = @ODBC('OA1, 'W ET', 'MH EQÜIP', 'TECH');
W et-= @ODBC('OA1, ' W- ET^, 'W-ET');
~ a t eit = @ODBC('OA1, 'W IT', 'PART', 'TECH');
W -it-= @ODBC('OA1, 'W,
'TI
'W-IT');
t = @ O D B C ( ~ O A ~ 'W
, -HHE-TIME',
WH -TIME');
@POINTER(l) = OBJ;
@POINTER (2) = @STATUS ( 1 ;
ENDDATA
I - - - - - - - - - - - - - - - - - - - - - - - T1s
H ATL - - - - - - - - - - - - - - - - - - - - - - - - END
Appendix II. Sensitivity Analysis Results
Sensitivity Analysis of
wfi
An extensive study was conducted for the sensitive analysis of
RI. The
results fiom the runs performed are presented in Table 23. Please note that due to space
limitations, some abbreviations were used. The legend for the abbreviations is presented
below.
Abbreviation
C
P
D
BS
LiM D
Meaning
Complexity
Precision
Diversity
Batch Size
LinearMass Dimension
Table 22. List o f abbreviations used in sensitivity analysis of W+
C
P
1
3
5
1
1
1
1
1
1
1
1
3
3
3
3
3
3
3
3
1
1
1
3
5
1
1
1
1
1
1
3
5
1
1
1
1
1
1
U B S L/M D
1
1
1
1 1
1
1
1
1
1
1
1
1
1
1
3 1
1
5 1
1
1 3
1
1 5
1
1 1
3
1 1
5
1
1
1
1
1
1
3 1
1
5 1
1
1 3
1
1
1 5
1
1
3
1 1
5
(un)Loadlnone (un)Load/Orientation iransportationlNone InspectionlOrientation S&WPosition
Light robot
Light robot
Power hand truck
Human
ASIRS
Light robot
Light robot
AGV
Human
ASlRS
Human
Human
AGV
Human
ASlRS
Light robot
Light robot
AGV
Human
ASlRS
Light robot
Light robot
AGV
Human
ASlRS
Human
Light robot
Power hand truck
tluman
ASIRS
Human
Human
Power hand truck
Human
ASlRS
Light robot
Light robot
Power hand truck
Human
ASlRS
Light robot
Light robot
Power hand truck
Hurnan
ASlRS
Heavy robot
Heavy robot
Power hand truck
Human
ASIRS
Heavy robot
Heavy robot
Forklift truck
Human
ASlRS
Light robot
Light robot
AGV
Human
AS~S
Light robot
Light robot
AGV
Human
ASlRS
Light robot
Light robot
Light belt conveyor
Human
ASlRS
Human
Hurnan
Light belt conveyor
Human
ASlRS
Light robot
Light robot
Light belt conveyor
Human
ASlRS
Light robot
Light robot
Light belt conveyor
Hurnan
ASlRS
Heavy robot
Heavy robot
AGV
Hurnan
ASlRS
Human
ASlRS
Heavy robot
Heavy robot
AGV
-
Table 23. Rcsults of sensitivity analysis for I@',,
ratings part type 2.
Objective
318.35
321,35
32 1.85
32 1.35
321.35
320.35
320.85
320.85
318.85
319.35
317.85
324.35
324.35
321.85
322.35
322.35
320.35
32 1.35
319.35
h
C C C C C C C C C
i3! Fx E3Ê3W5! E3 Z3i !3
SISI,
7
xxl
B S LlM U
L
2
I
;
P
U
L
Z
Z
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
4
4
4
4
4
2
2
2
4
4
4
4
2
2
2
2
4
2
4
4
2
2
4
4
2
2
4
4
2
2
4
4
2
2
2
4
4
4
4
4
4
4
2
2
2
2
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
2
2
2
2
2
2
2
4
4
4
4
4
4
4
4
2
2
2
4
4
4
4
2
2
2
2
4
4
4
4
2
4
4
2
2
4
4
2
2
4
4
2
2
4
4
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
4
2
4
2
4
(un)Loadlnone (un)LoadlOrientation 1 ransportationlNone InspectionlOrientation S
Human
Human
Light belt conveyor
Human
ASlKS
324.35
Heavy robot
Heavy robot
Roller belt conveyor
324.35
Human
ASlRS
Light robot
Light robot
Light belt conveyor
324.85
Human
ASlRS
Heavy robot
Heavy robot
Roller belt conveyor
324.85
Human
ASlRS
Human
Human
Light belt conveyor
327.35
Human
ASIRS
Human
Human
Roller belt conveyor
325.85
Human
ASlRS
Human
Human
Light belt conveyor
Human
ASlRS
325.85
Heavy robot
Heavy robot
Roller belt conveyor
Human
ASlRS
325.85
Light robot
Light robot
AGV
Hurnan
ASIRS
325.85
Heavy robot
Heavy robot
Roller belt conveyor
325.35
Human
ASlRS
Light robot
Light robot
Light belt conveyor
325.85
Human
ASIRS
Heavy robot
Heavy robot
Roller belt conveyor
Human
ASlRS
325.85
Human
Human
Light belt conveyor
328.35
Hurnan
ASlRS
Hurnan
Human
Roller belt conveyor
Human
ASlRS
326.85
Hurnan
Light robot
Light belt conveyor
326.85
Human
ASIRS
Heavy robot
Heavy robot
Roller belt conveyor
326.85
Human
ASlRS
~ i g h robot
t
~ i g h robot
t
AGV
tlurnan H
Heavy robot
Heavy robot
Roller belt conveyor
Human
ASIRS
325.35
Light robot
Light robot
Light belt conveyor
Human
325.85
ASIRS
Heavy robot
Heavy robot
Roller belt conveyor
Human
ASIRS
325.85
Human
Human
Light belt conveyor
328.35
Human
ASlRS
Human
Human
Roller belt conveyor
Human
326.85
ASlRS
Human
Light robot
tight belt conveyor
326.85
Human
ASlRS
Heavy robot
Heavy robot
Roller belt conveyor
Human
ASlRS
326.85
Light robot
Human
AGV
328.85
Human
ASlRS
Heavy robot
Heavy robot
AGV
327.85
Human
ASIRS
Cight robot
Light robot
AGV
ASlRS
328.35
Human
Heavy robot
Heavy robot
AGV
Human
ASIRS
327.35
Human
Human
AGV
Hurnan
ASIRS
329.85
Human
Human
Roller belt conveyor
Human
ASlRS
327.85
Human
Human
Light belt conveyor
Human
327.85
ASIRS
Heavy robot
Heavy robot
Roller bett conveyor -Human
327.85
ASlRS
-
Table 23. (cont'd 2)
Appendix III. Database Tables
Al1 the data required by the operation allocation and the materials handling
system selection models is contained in one Microsofi Access database file - OA-MDB.
This database contains a number of data tables as c m be seen in Table 24.
-
-
Description
Lists part types and their demands
Lists machines, their capacities (time available) and
setup costs
Lists the process plans
Plans
OA
Lists the manu facturing operations
OA, MHSS
MfgOps
Lists the possible Part-Plan combinations
PartPlan
OA
Lists the possible Part-Plan-Manufacturing
PartP lanOp
OA
Operations combinations
j Lists the possible Part-Plan-Manufacturing
OA
1 Operations-Machine combinations, their cost and
1 time required
Lists th; cost of transporting each part type
OA
between any two machines
Lists the output (solution) from the OA problern OA, MHSS
generated during runtime
MHSS
1 Lists the available types o f matenals handling
equipment
MHSS
Lists the major materials handling operations
MH-OP
MH-Subop
MHSS
Lists the materials handling suboperations
Lists the key product variables
MHSS
Tech
MHSS
Lists the required materials handling opcrations and
suboperations
Lists the ratings for the parameter W;,
MHSS
MHSS
Lists the ratings for the parameter W,,
MHSS
Lists the ratings for the parameter Wi,/;,and the time
required to perform each materials handling
1 operation-suboperation combination on each type
of materials handling equipment
* Each data table i used in at l e s t one of the models. Please note that OA refers to the
Operation Allocation model and MHSS refers to the Materials Handling Systern
Selection model.
Model*
OA, MHSS
OA, MHSS
Table Name
Parts
Machines
1
i
1
1
1
--
--
Table 24. Description of the tables in the database OA-MDB.
1
1
Each data table in the database is composed of a number of fields. Al1 tables
contain an ArtroNttmber index that is used as the prirnary key. This field is used to
uniquely identiw each record in the tabIe. Although the use of this field is not required,
its presence allows for the construction of queries, forms and reports.
Each data table is now descnbed in a tabular format.
Data Table: Parts
Field
Part-Index
Part
Demand
Type
AutoNumber
Text
Number
Index in Mode1
-i
di
Description
Record index
Part type identifier
Demand of part type i
-
TabIe 25. OA-MDB Database description of the table: Parts.
Data Table: Machines
Field
Type
AutoNum ber
MC-Index
Text
Machine
Number
Capacity
Setup Cost
1 Currency
-
-
--
-
Table 26. OA.MDB Database description of the table: Machines.
Data Table: Plans
Field
Plan-Index
Plan
Type
AutoNumber
Text
-
Index in Model
-P
Table 27. OA.MDB Database description of the table: Plans.
Description
Record index
Process plan identifier
Data Table: MfgOps
Field
Type
AutoNurnber
M fgOp-Index
Text
Mf@p
Index in Mode1
Description
Record index
Manufacturing operation
identifier
-s
I
-
Table 28. OA.MDB Database description of the table: MfgOps,
/
Data Table: PartPlan
Field
Type
AutoNumber
PartPlan-Index
Text
Part
Text
Plan
Index in Model
Description
Record index
Part type identifier
Process plan identifier
-I
!P
-
Table 29. O A M D B Database description of the table: PartPlan.
Data Table: PartPlanop
Field
Type
AutoNumber
PartP lanOp-Index
Text
Part
Text
Plan
Text
Mfk.0~
Description
Record index
Part type identifier
Process plan identifier
Manu facturing operation
identifier
Index in Mode1
-I
P
s
-
Table 30. OA.MDB Database description of the table: PartPlanop.
Data Table: PartPlanOpMC
Field
Type
AutoNumber
PartPianOpMC-Ind
Index in Mode1
Description
Record index
i
Part type identifier
Process plan identifier
Manu facturing operation
identifier
Machine identifier
Cost of performing operation
s on machine j for the
combination (@)
Time required to perform
operation s on machine j for
the combination (ip)
--
ex
Part
Plan
Mf.0~
Text
Text
Text
P
machine
MfgOp-Cost
Text
Currency
j
I
I
l
M fgOp-Time
s
Number
oCsj&4
1
tsj(ip)
1
-
Table 31. OA.MDB Database description of the table: PartPlanopMc.
;
Data Table: MHC
1 Field
MHC Index
1 Part
Machine 1
Machine2
Index in Model
1
Text
Text
Currency
Description
Record index
Part type identifier
Machine identifier
Machine identifier
Cost of moving a unit of part
type i fiom machine j to
machine j'
J
1
I
r
,
-
TabIe 32. 0A.MDB Database description of the table: MHC.
Data Table: A
Field
A-Index
MfgOp
Type
AutoNumber
Text
Part
Machine
Text
Text
Index in Mode1
Description
Record index
Manufacturing operation
identifier
Part type identifier
Machine identifier
-s
I
j
-
Table 33. 0rf.blDB Database description of the table: A.
Data Table: MW-Equip
Type
Field
AutoNumber
MHEquip-Index
Text
MH-Equip
MH-Equip-d
Text
Time
Number
-
- --
--
1 Index in Model
--
e
--
Description
Record index
Materials handling equipment
identifier
Description of materials
handling equipment identifier
Time available on matenals
handling equipment e
- -
-
Table 34. 0A.MDB Database description of the table: MH-Equip.
Data Table: MH-Op
Field
Type
AutoNumber
MHOo. -Index
MH-OP
1 Text
I
Index in Model
-II
I
Text
..
-
--
-- -
Table 35. OA.MDII Database -description of the table: ;MH-Op.
Materials handling operation
identifier
Description of materials
handling operation identi fer
1
/
Data Table: MH-Subop
Field
Type
MHSubop-Index
AutoNurnber
Text
MH-Subop
h
MH-Subopd
-
Index in Model
Description
Record index
Materials handling
suboperation identifier
Description of materials
handling suboperation
identifier
--
Text
-
Table 36. OA,MDB Database description of the table: MH-Subop.
Data Table: Tech
Field
Tech index
~ech-
Type
AutoNurnber
Text
Tech-d
Text
/
Index in Model
Description
Record index
Key product variable
identifier
Description of key product
variable identifier
-f
-
-
Table 37. O A M D B Database description of the table: Tech.
Data Table: -WH-Req
Field
Type
AutoNumber
MH-ReqIndex
Text
Part
Text
MfgOp
1
Index in Model
-I
s
Machine
MH-OP
Text
Text
j
MH-Subop
Text
h
-
1
-
il
1
Table 38. O A M D B Database description of the table: MU-Req.
1
1
Description
Record index
Part type identifier
Manufacniring operation
identifier
Machine identifier
Materials handling operation
identifier
Materials handling
suboperation identifier
1
Data Table: W-it
Field
W-it-Index
Part
Tech
Index in Mode1 1 Descri~tion
Record index
Type
AutoNumber
1 Text
Text
1 variable t on part type i
-
Table 39. OA-MDB Database description of the table: W-it.
Data Table: W-et
Field
W-et-Index
MH-Equi p
Index in Model
AutoNumber
Tech
Text
N
Number
Description
Record index
Materials handling equipment
identifier
Key product variable
identifier
] Relative weight of the product
/ variable t on materials
1 handling equipment e
1
-
Table 40. OA.MDB Database description of the table: K e t .
Data Table: W-hhe-tirne
Field
' Type
W hhe-Index
AutoNumber
Text
~ H - ~ ~ u i p
Index in Mode1
,
--
i=
Ir
MH-OP
Text
MH-Subop
Text
h
W-hhe
Nwnber
wjt&
Number
hii+
1
MH-Time
1
I
-
Description
Record index
Materials handling equipment
identifier
Materials handling operation
identifier
Materials handling
suboperation identifier
Relative degree of capability
of materials handling
equipment e to perforrn the
operation/sub-operation
combination lzh
Time for equipment e to
perfom materials handling
operation/sub-operation hd
Table 41. OA.MDB Database description of the table: W-hhe-ti ne.
1
I
Please note that Lingo requires that al1 set members be o f type Text, while
attributes of those sets should be of type Number (type Czrrrency is also acceptable).
Also, Lingo requires that the database be registered as a ODBC Data Source
before it can be accessed. The process to register the database is explained in the Lingo
5.0 User Guide (pp. 278-282).
Appendix IV. Solver Program Source Code
The Solver program is composed of a number of different files. Visual Basic
saves each forrn ( f o m attributes and code) in a single file. Similarly, it also saves each
module in a different file. In our case, the source code to Solver consists of 17 files.
There is one project file, one module file and 15 forrn files. Table 42 summarizes the
information about these files.
1
File Name
solver-vbp
1
Description
1 Project file - contains information about the various f o m
datacon-bas
solver. frm
hAbout.frm
hdgMC.frm
fnndgM fgOp. frm
frrndgMHC. f m
f3-mdgMHEquip.h
fmdgMHReq.fnn
frmdgPartP1an.h
1
1
files, module files, objects and compilation options
Module file - contains general procedures required by the
program (ex. report creation)
Form file - contains information and code related to the main
fonn for the program
Form file - contains information and code related to the
About dialog box
Fonn file - contains information and code related to the forrn
where the machine data is displayed
Form file - contains information and code related to the form
where the manufacturing operation data is displayed
Fonn file - contains information and code related to the fonn
where the materials handling cost data is displayed
Form file - contains information and code related to the form
where the materials handling equiprnent data is displayed
Form file - contains information and code related to the form
where the rnaterials handling requirements data is displayed
Form file - contains information and code related to the fonn
where the Part-Plan data is displayed
Form file - contains information and code related to the form
where the Part-Plan-Manufactuïing Operation data is
displayed
Form file - contains information and code related to the form
where the Part-Plan-Manufacturing Operation-Machine data
is displayed
Form file - contains information and code related to the form
where the part type data is displayed
Fonn file - contains information and code related to the form
where the process plan data is displayed
bdgWet.frm
hdgWit.fhn
Fonn file - contains information and code related to the fonn
where the W,, data is displayed
Form file - contains information and code related to the form
where the wildata is displayed
h
frmdgWhhe. fim
where the Whhedata is displayed
Table 42. Source code files in the Solver program.
The source code listing for each file in the project follows. The source code
includes cornments that explain what each section of the programming accomplishes.
Source Code for solver-vbp
T ype=Exe
Reference='\G{00020430-0000-0000-C0000 0 0 0 0 0 0 0 0 C 4 6 ~ = 2 . O W O # . . \ ~ . \ W I N D O ~ S \ S Y S T ~ M \ S t d O e 2 . t b OAutomation
LE
?.eference='\G{00025E01-0000-0000-C000-000000000046}~4.0#0#~.\..\PR0G~~
FILES\,COMMON FILES\MICROSOFT SEARED\DC: \PROGRWl FI $ M i c r o s o f t DAO 3 . 5
Objecr Library
O b j ~ ~ ~ = { 5 Z 9 E 7 8 ~ 0 - 5 3 i B - l I C F - 9 1 F 6 - C 2 8 6 3 C 3 8 5 E 3 0 } 1 . 0MSFLXGRD-OCX
0;
0 ~ j e c t = { ~ ~ E ~ E 7 6 3 - 1 1 7 E - i 0 I 3 - 0 9 3 3 - 0 8 0 0 2 S 2 F 4 5 . } # 1 . DBLIST32.0CX
0;
3 ~ ] ~ ~ ~ = { 0 0 0 2 8 C ~ ~ - 0 0 0 0 - 0 0 ~ 0 - 0 0 0 0 - 0 0 0 ~ 0 0 DBGRID32.0CX
0 0 6 } # . ;
Forn=solvor.frm
!-!c~ule=Modülel;aacacon .bas
Form=frmdgMC.frrn
rorm=frmdgParts.frm
E'orrn=frrndgMHEquip. f-m
Fo rm= frndgMf gOp. fr m
Form=frmdgPlan-frm
Forrn=fmdg?srtPlan.frm
Form=frmdqPartPianOp.fm
Form=frmdgPartPlanOpMC.frrn
Fo rm= ZrmdgMHC . frm
c orr,=frmdqWit.frm
r orrr.=frmdgWet . frm
Form=frmdgWhhe,frm
Form=f rmdgMHReq. frm
Form=frrd-bouc.frm
IconForn="frmMainn
Startup="frrnMâinl'
-
EelpFile=""
Title="solverl'
ExeNarne32="solver.exe"
Command32=""
Name="Projectln
AelpContextID="O"
CompcciDleMode="O"
Ma j orVer=O
MinorVer=l0
i?evisionVer=O
&-utcIncrementVer=O
ServerSupportFiles=O
VersionComments="OA and MHSS Solver Tool"
VersionCompanyName="Jorge Paulo"
V e r s i o n F i l e D e s c r i p t i o n = " S o 1 ~ ~ eTool"
f
V e r s i ~ n L e q a l C o p y r i g h t = ' ~ J o r g ePaulo (1999-2000)"
V ~ r s i o n P r o d u c t N a n e = ~ ' S o v eexel'
r.
CompilationType=O
OptirnizationType=O
fzvorPentiumPro (tm)=O
CodeViewDebuqInfo=O
XoAiiasing=O
2ouzdsCheck=O
OverflowCheck=O
C l "
- I~ointCneck=O
FDIVCnecK-O
UzroünaedFP=3
StartMode=O
ünattended=O
ThroôciPerObjecr=O
:4o:<Xcn=berOf
Thrsads=I
Source Code for datacon.bas
..
. - . L
- L= ~ l ~ ~ ~ ~
VE Mxne
"Modulel"
' D r f i n e s o m e srrays, no size given for now
P u o l i c MyArrayO As String
2 u 5 l i c E q u i p ( ) As String
-ic-
3cblic Sub Reportf(Fi1eName As String, Mode1 As String)
The procedure tâkes two arguments. The first is the
' name o f the model's solution file, including the
' psth. The secona is an indicator tnar tells t h i s
' prccedure wnot mode1 is calling it.
I
This prcceaure secs up Che report headings, parses the
LINGO ouïput, isolates the sub-string that contains the
' zssignmencs and c a l l s 2 other functions to complete the
* work necessary to write the report.
*
Dim TexCLine As String, Indicator As String
Dim ReportFile As String
Dim n As Inteqer
' Set correct indicator for model and
' 2repare report headinqs
If Model = "MH" Then
' Y is the decision variable for che MH model
Indicator = "Y"
' Define the name of the repori file
3eportFile = "C:\THESIS~WORK\SOLVER\MHHREPORTTTXT1l
' Open che report file
Open ReporïFile For Output As 92
' ?rint some header infcrma~ion
?rint 52, "Creation Dace ana Time: " & Now
Print 52, " "
Lrint 52, " l1
?rint $2, TôD (20); "Macerizis Hanaling Assignments"
Frint f2, "-------------------------------------"'
' *1-----,-------,----,,,------------------~1-
' -
Else
' I f w e are writing the report for ihe MHSS problem
' t h e n th? indicator will be X instead
lndicator = "X"
-WO?.K\SOLVPR\CA-REPORT.TXT1l
ReporïFile = llC:\THESTS
Osen ReporïFile For O u t p u c A s $ 2
Print #2, "Creation Dace ana Time: " & Now
Prini t2, " "
Frint #2, " "
crini G2, "Machine Seleciion and Operaricn Assignmenïs"
print $2,
>rint $ 2 , "Pârt"; Tab(8); "Process Plan"; Tab(23); "Operation"; TaD ( 35) ; "Yzcnine"
print # 2 ,
"------------------------------------------l'
"------------------------------------------Pt
-.-- -T -C
Tnri
' Open LINGO output file - noael solu~ior!
Oper! FileName For Input As f l
' Loop until end of file.
Line Input s1, TextLine ' Read lino into variâble.
TextLine = Trim(TextLine) ' Remove leaaing and trailing spaces
If Mid(TexcLine, 1, 1) = Inaicator Then
TextLine = Trim (Left(TesrLine, 2 2 ) ) 'Take first 28 characters
TentLine = Trim (Mia(TextLine, 3) ) 'Trim "Y ( " or "X ( "
TextLine = Mid (TextLine, 1, Len (TextLine) - 1) 'Trim trailinq )
Debug-Print TextLine
Print to Debug window to check string
' Cal1 procedure StringtoArray with appropriate attributes
If Mode1 = "MH" Then
' We send the string TextLine and the size of the necessary
' array to handle i t
StringtoArray TextLine, 6
Zlse
30 Plhile Not EOF(1)
I
I
I
I
4 J C I
Lk
O
'cc
k a 1
O C
ab
a,
LI:
>d
oc
- -
1J
0,
k
ctl a,
au^
c
C U
ci icc -4
W H I
hl
-
LI
.FI
3
.
a
-0
c
O,
u
a
3t-
(J
(O
.ri U
.A
-u
C:
l-i
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
: : :
a, LI r\l
~1 O
l-i 1-4
Lù
II
I
I
I
I
I
t
I
I
I
I
I
I
I
I
I
iJ
c
Dr
' writes the rest of output report.
Dim YHop As String, MHsubop As String
Select Case Val (MyArray( 3 j
Ccse 1
M H o p = " (un)Load"
Case 2
MHop = " (re)Handle"
'MH
Operation
Case 3
MEop = "Trznsporrâtion"
Case 4
i4H0p = "Inspection"
Case 5
XEcp = "S G R"
Case Else
MHop = MyP~ray(3)
E n d Select
Select Case Val(MyArray(4)j ' ME ScDoperation
Case 1
MHsubop = "Orientation"
Case 2
Mi-isubop = "Position"
Case 3
b!Iisubcp = "Quantity"
Cas2 4
MHsubcp = "Timing"
Ccse 5
MHsuScp = "Sequence"
Case 6
MHsubop = "None"
Case Else
X E s u ~ o p= MyArray(4)
Er-C Select
'Prin: t h e solution out-ut into human readable format
Print # 2 , Tab (2); MyArray(0); Ta8 (11); MyP-rray(1); Tab (22);
MyArray(2); ' ï a S ( 2 5 ) ; MHop; Tab(44); PIHsubop; Tsb(62); Equip(MyArray(5) - 1 )
-
Zise
' Same, o u i for the OA mode1
?rint #2, Tob(2); MyArray(O!; Tab(l3); MyArray(1); Tab(261; r4yArray (2); T a 0 (37) ; MyArray ( 3 1
' Let's use ïhe opportunity to write rhe Table for parameter
This is table A in the dôtabase O A - M D B
With frrnMain.dbA. Recordset
.A d d N e w
= MyArray(2)
MyArray ( O )
!Eacnine = MyArray (3)
.Upaate
End Wirh
!Mfq-Op
! Part =
Asij
Enci I f
Ena Sub
Source Code for solver-frm
.,-/c?SION 5 - 0 0
2eqin 'JE. Form f rmMain
3crderScyle
Coptior?
ClientHeighC
ClientLeft
ClientTop
ClientWidth
rillcolcr
Forecolor
LinkTo-ic
MaxBut ton
SczLeXeight
ScalePiidth
SrârtUpPosicion =
Seqin V a . 3 a c s d b A
Côpt ion
Connect
DâccbcseMame
1 'Fixec Sinole
"OA ana XHSS Solving TooL"
3755
150
720
5550
&uooCOCoCO&
&H8000000F&
"Formi"
O
' FâLse
3795
5550
' Winaows DefsuLt
"Dac-1"
"Access"
"C : \ thesis-work\,solver\oz.mdb"
O ' Defaul tCursor
2
' 5seODBC
2 'Ada New
O
' "alse
345
360
O
O
'False
1
'Dynaset
"P."
3120
O
' ialse
1215
2eqin VB.ComandButton cndE:-:iZ
ExiZ"
Cacr ion
Heiqht
=
455
=
3960
Lefc
TabInaex
=
2
=
3000
Top
Width
=
1335
End
Begin VB-CornmandButton cmdMH
Caption
"Solve Materials Hanaling Problern"
'1
Height
Lef t
TobIndex
Top
Width
=
=
=
=
=
615
360
1
1800
3495
Er?d
Begin V3.CommandButton
Câcrion
tieight
=
=
Left
Tab Inde:.:
=
=
Top
=
IJFdth
Ena
"gin VE.Snope Shapel
tieighi
=
L ~ f i
-
:op
WiCth
A
=
=
cmaOA
" S o l v e Operation Allocation Problem"
615
360
O
480
3-55
2415
123
240
5255
r n.d
-.
Begin VS.Label LDlMHValue
Alignment
=
2 'Center
'* O "
Caption
Fieight
=
255
Taft
=
4320
--TâbInae:.:
=
6
=
2150
Top
ni
,.,dth
i
=
735
Ecci
Cesin
V9.Lobel IblMHCost
Aliqnmenr
=
2 'Cenrer
"Total "
Ca-rior3eqi~PropertyFont
=
"MS Sans Serif"
Name
=
5.25
Site
Charsec
=
O
Weiqht
=
703
UnCerline
=
C
'False
I~zlic
=
O
'Fzlse
Strikeïhrough
=
O
'Falce
E~dFropercy
Reiçhï
=
375
LefE
TabIncex
=
4080
=
5
Top
IJiàth
=
1800
1215
=
End
Begin VB.Labe1 lblOACost
=
2 'Center
P-lignment
Caption
"Total Cost"
BeqinProperty Font
"ES Sans Serif"
Name
Size
=
a.25
Charset
=
O
Weiqnt
=
=
=
O
O
Underline
Italic
700
'False
'False
Striketnrough
ZndPr o p e z t y
Ifeight
=
Left
Tabinaex
Top
rridïh
=
=
=
=
O
=
'False
375
4080
4
48C
1215
Enc
2eqFn Va.Label 1blOAValue
?-lignmen:
=
2 'Cecter
O"
Czprion
Eeight
=
255
Left
=
4200
3
TabIndex
=
8
40
L op
II
Victh
=
855
End
Socin VB . men^ mnuFile
"&Filer1
Caption
Begin VB. Yenu mnulauncmccess
Captiori
"G tounch Access"
End
Segin V3,Menu nnuExit
"fl&:<itl'
Caption
Er.d
End
3eqin VI.Menu mnuData
1v &Daia11
Caption
Segin V3.Mtnü mnuparts
11 r c ~ t S n 1
Capt icn
Snà
3egin VE-Menu mnuMacnines
"zdacnineslV
Câpti0n
Enc
3egic VS.Xenu mnuMH-Zquip
"ME Cquip"
Caption
EnC
Legin V3.Xenu anuMfqOp
"Elfg Operaïions"
Caprion
Ena
Begin VB-Nenu mnuPlans
=
"plans"
Csption
End
Begin VB.Menu mnüParrPlsn
II Port-Plan"
Caption
End
3eqin VB. Nenu mnuPartPlonOp
Caption
"Port-Plzn-Op"
End
Begin VS-Menu mnuParïPlânOpMC
"Pôrt-Plon-Op-Machine"
Caption
En0
Begin VB-Menu mnuMHCosts
"MX C o s t s "
Caption
End
Begin VB-Menu mnuW-it
IIpJ itll
Caption
-
End
Begin VB-Menu mnuW-et
Capt ion
Enci
9egin Va. Fenu mnuW-hhe
C â p t ion
-
"31 et"
-
"O? -h h e "
Ei?d
Segin VB. Xenu m n u M H R e q
"ME Requirements"
Cô~tiG?.
Znd
End
Segin VS.Menu mnuReporrs
Caption
" & R e ~ ~ r t s "
Begin VB-Menu mnuOA
&Operocion Allocation"
Capticri
IV
E
c,
Eeain
-
VI. Xenu m!uMH
-Caction
"&Xa~orialsZanaiinq"
Enc
End
m
a e q i n Y B . Kenu mnuHelp
Capcion
"&HelpW
aegin VE.Menu mnuDoc
"iDocumen~~tFon"
captior?
End
aegin VB .X e n u mnuEbout
" &&out
"
Caprion
Znc
Er?d
5nc
n L c r ;
jute V B - b i ~ n e = " frmilain"
.LttriDute VR-GlobalNameSpace = False
A t c r i j u t e Y3-Cresrable = False
9 . t t r i b c t e Va-PredeclaredId = True
-2.ciribute Va-Zxposed = False
DLm oaflzq As Fnteger
Crivace Declore Sub LGVBSCRIPT -LLD
.
"lincpdll.dl1"
(ByVal =Script As ~ t r i n ~-,
2yVal cLoqfile As Strinq, ~NumberOfTransferAreasAs Long, CTransferArees A s Double, nTr6nsferFtr.s A-s Long, nCrrorCoae As Long)
?rivace Sub cmdExit-Click0
End
Cna Silb
?rivace Sub cmaMH-Click ( )
Check if OA probiem has been solved
If oaflag = 1 Then
' Array to trânsfer data to and from LING0
Dim 8TransferAreaa (2) As Double
' ? o i n t t o w h e r e tne t r a n s f e r z r e a s b e q i n i n t h e t r a n s f e r a r r a y
D F n n T r a n s f e r P o i n t o r s s ( 2 ) AS Long
z T r & n s f e r P o i n t e r s s( 1 ) = 1
' Objective function value
' S t a t u s of s o l u t i o n
nTransferPointerss (2) = 2
' S t s r t b u i l d i n g LINGO1s s c r i p c (commands m u s t b e t e m i n a t e d
Dim c s c r i p t t As S t r i n g
' Supress s o l u c i o n r e p o r c s
c S c r i p r t = "SET TERSEO 1" & Chr(l0)
S e t w o r k s p a c e rnemory l i m i t t c 1 6 Meqs
c S c r i p t c = c S c r i p t & "SET plrXN5t4E 16" & Chr(10)
' 3 e a a i n c h e mocel file
cScriptt = cScriptt & "TAKE C:\THESIS -WORK\SOLVER\MHSS-C2D.LNG" G Chr!lO)
l
X r i t e a s o l ~ r i o nr e p o r t
Chr (101
' Qüit LINGO DLL
cScripcc = c S c r i p r t
' Xark eh2 e n a o f t h e s c r i p t w i c h a n u l 1 b y t e
= c s c r i p t t & Chr(0)
rScri?ït
' !?oute standzrd o u t p u t t o a f i l e
D i m c L o g F i l e e 3.s S c r i n g
cLoqFilse
=
"C:\THESIS-WORK\SOLVZR\MH-CUT.LOG"
' Shox rhe cornmanas s e n t t o L i n g o
jj A s I n t e g e r
j j = MsgEox (cscriptt1
Ein
C h o n g e mouse p o i n t e r t o b u s y
Screen.MousePcincer = vbHourglass
' 31-13t n e LING0 s c r i p t
C s l l LGVESCRIPT ( c s c r i p t t , c L o g F i l e e ,
2 , a T r a n s f e r A r e a a ( 1 ), n T r â n s f e r P o i n t e r s s (11 , nErrorCodee1
' Check for p r o b l e m s
Dim ii As Inreger
If ntrrorcodee > O Or dTransferAreaa(2; > O Then
' We have problems, chznge mouse pointer to normal
' anc shox 2rror box
Screen-MousePointer = vbDefsult
ii = MsqBox ("Unâble tc solv?! " )
Zlse
' No pro~lems! Change mouse pointer nack and
print sucess message
Ccreen.MousePointer = vbDefàult
Fi = XsgBox ( "Success ! A 1 1 done. . ." )
Znd If
' Put o b j e c r i v e function value in àizlog n o x
dTransferAreaa ( 1 )
Lbll.II,'Jalue. C a - t ion =
' If O& s r o n l e m hâs not been s o l - ~ e d
Dim I J s I n t e g e r
Else
I = XsqBox ( " ? l e s s e s o l v e the Operation Allocction Problem first ! ",
, -
"Crrar")
' .L.-r -r z y C O t r z n s f a r d a ï a C o an5 from LINGO
D i m CTronsferArea (2) Pas D o u ~ l e
' ?oint to whero the transfer sreâs beqin in the transfer a r r a y
9iz nTransferOointers (2) Ps Long
' Oojectiv- function value
nTronsferPoincers (1) = 1
n2rcnsferPointers ( 2 ) = 2
' S:âtus
of solution
' Stzrc Duilding LINGO'S s c r i p r (cornanas must be terminated
' w i r h an ASCII IO!
Dix cScri-t As String
' Supress solution reports
cScripr = "SET TERSEO 1" C Chr ( 1 0 )
' Set workspcce rnemory limit to 16 M e q s
= cScript & "SET MXMEME 1 6 " & Chr ( 1 0 )
cScript
' S a v e sectings into the configuration file
cScript = cScripc & "FREEZE" & Chr(l0)
' Road in the mode1 file
Solve the model
cScript = cScri-t
&
"GO"
&
Chr(l0j
Xrite a soluïion report
cScript = c S c r i ~ i& " D I y E 3 T C : \THESISWORK\SOLVtR\,OAASOL,UTIONNTXT1* & Chr ( 10 )
cÇczipt = cScript & "NONZ X" & Chr(l0)
cScript = cScript & "RVRT" & C h r ( I O )
Quit LIPIGO D L L
cscr-pt
cScripï
=
&
"QUIT"
&
ChrllOl
KzrR c h e end of the script wirn a nul1 byte
cScript
cScript t Chr(0)
=
,
.
9.cüze srzricarc cctpuc tc a f i l e
P i m cLogFile P-s String
cLogFile
=
"C:\THESIS
-WORK\SOLVER\OA-CUT-LOG"
Show z h e c o m a n d s sent CO Linço
D i r n j As I n c e g e r
j = M s c B o x (cScript1
C 5 â n g e nouse pointer to busy
Screen.Mouse?ointer = vbEourglzss
-
nun the LINGC script
C a L l LGVISCRIPT (cscript, cLoqFile, 2, 8TransferAreo (1), nTransferPointers (1), nErrorCoàe)
1
Check for p r o ~ l e m s
Dim k AS I n t e g e r
I f ~ E r r o r C o a e> O Or dTransfer.c.rea(2) > O Then
Xe have p r o ~ l e m s ,c h a n g e nouse pcinter Co normal
o n c show e r r o r box
$c~een.MousePointer = vbDefzulc
k = MsqBox("Unable to solv~!")
=1
CP
- A - -
' i d 0 problems! Change mocse pointez back and
princ sucess message
Screer-HousePointer = vbDefault
k = MsgSox("Success! Al1 aone . . . ")
' S e i o a f l â g to 1 so that w e can now solve MiSS model
oaflag = I
E n a If
l
P u t o b j e c r i v e function value in dialcg box
lblOAValue. Câpiion = dTransferArea (1)
F r i r e the report
reporcf "C:\THESIS~WORK\SOLVER\CPPPSOLUTIONNTXT'*,"OA"
End Su5
5nd
Scb
F r i v z t e Sub Forn-LoaaO
Dim ÇquipFile, noqood As String
Dim i As Inteqer
i = O
ooffaq = O
Z q ü i p F i l e = "C:\THESIS -WORK\SOLVER\EQUIP.TXT"
0-en E q u i p F i l e For Inpuï As = I
Do Plhile Not S O F ( 1 )
Input + i , nogood
i = i + l
Loop
C l c s e ri
Sebug.
princ i
X e D i m =quis ( i
Open EquipFile For Inpur ?-s = I
i = o
Co While Not EOF(1)
I n p u r +1, Equip (i)
Deoug . Print Equip ( i)
i = i - l
Locp
C l o s e iil
Long
3ecordser
Do While Not .EOF
Plich 8D.q.
.G e l e t e
.K o - ~ e N e : c t
Loop
E n a With
'daïâbasePro8ien:
1
MsgEox "Frouiern opening or using che " & cbP-.DztabsseName & " cocabase.", , 1
"OA and MHSS Solving Tool"
I
'E n c
E n a Sun
Private Sub Form-Unload(Cance1 As Inteqer)
dbA.Recordset.Close
E n c Sub
?rivate Sub mnuAbout-Click0
frmAbout .Show vbModal, Me
Znd Sub
Private Sub mnuDoc-Click()
Din RetValî
R e t V ~ 1 1= Shell ("C:\PROGRAM FiLES',MIC2OSOFT
OfFICZ\OFFICE\WINWORD.EXE C:\TFiESIS-WORK\SOLVEP.\SOLVER-HELP.DGCW, 1)
If RetVai = O Then
M s c j B o x "Problem opening the report.
" &
'Zoes The file: C: \THESIS WORK\SOLVER\SOL%R-HELP.
DOC exisz?"
"Zrror Opening File"
1f
----
P r {, c L e
Dim
I F RettJall = O Then
M s q B o x "Problern openinq tne report. " &
"Does che file: C:\TEESIS -WORK\SOLVER\OA.~DS
"Srrcr Openinq File"
E n d If
Z2d Scn
frmdqMC .Shox vbModal, Me
E n d Sub
F r i v o r e SUD mnuMfg3p-Click()
f rmagNf go?. Show vbModal,
xzc sus
?.etYs1 = Snell ("C:\WINDOWS\??OTEPADD
EXC
C: \TZESIS->ïORK\SOLVZR\FIH-REPORT. TXTrl 1 )
If RerVal = O Then
M s a E o x "Problem opening the report.
& "Does the file: C :\THESIS -WORK\SOLVER\MH-REPORT. TXT
"Errer Opening File"
E n d If
Ena Stlb
Frivorr Sub mnuMH-Equip-Click0
frrndgMSEquip.Show vbModal, Xe
tnà SUD
Privzte Süb mnuMHCosts-Click0
f r m a g M H C .Show vbModal, Me
E n d Sub
Privste Sub mnuMHReq-Click ( )
frmdqMHReq-Show vbModa1, Me
Zr?d Sub
? r i v ~ i eSub mnuOA-Click
()
D i m Eiet'Jal
3 e t V a l = Shell ("Cr\WINDOWS\NOTEPAD. EX€
C : ',TX%SIS-WOXK\SOLVER\OA -RZPORC. TXT", 1)
If RerVcl
=
O Then
KsgBox "?roDlem o p e n i n o the report.
l'
&
"Does :ne file: C:\THESIS-VZ~RK\SOLVER\O-T.TXT
"Error Opening File"
Ica If
End S u b
? r i - r a i e S u b mnuPart Plan-Click ( 1
frmdqParC "an. Show vbMocal, Me
E n c Sub
F r i ï â c e S c 5 mnuPcrtPlanOpMC-ClickU
f r r n c ~ ? a r t P l ~ n O p M C . S h o wvbModsl, Ne
Zrici
sue
?rivace S u 5 i n n ~ P a r t s ~ C l i c k 0
frmdg P a r t s . Show vbModsl , W e
Erid SUQ
- .
S u b mncX-it-Click (
5rnaqWir.Show vbMobal, Me
-rl-;ace
3,o.d S x b
Source Code for frmAbout-frm
VERSION 5 . 0 0
E e q i n VE.Form frmAbout
EorderScyle
=
3
' FFxed D i a l o g
exisï?", ,
-
Câption
"About My.Appn
ClientHeight
=
3555
ClientLef t
=
2340
=
1935
ClientTop
ClientWidth
=
5730
=
O
'False
ClipControls
LinkTopic
"Form2"
N a x B u t ton
=
g
r False
YinButïon
=
O
'Falçe
ScclsHeiqhî
=
2453.724
=
O 'User
SczleMode
ScaleWiath
=
5380.760
ShowIr.Taskbàr
=
O
'Folse
Begin VB-PictureBox picIcon
-1 'True
ActoSize
=
3
' r-alse
ClipConcrols
tfêight
Left
Picïure
ScâleHeight
S c o leMode
ScaleWidth
T ~ Index
D
Top
Wiath
=
=
=
=
=
=
=
Xnd
Eeçin VB.CornrnandBuîton
Câncel
Caption
Eefault
=
Height
Lefc
=
Ta~Incex
Top
=
tiidth
=
=
540
240
"fr~30uc.frx":OOOO
337.12
O 'Vser
337.12
1
240
540
cmdOK
-1 'True
"Of("
-1
?rue
345
4245
1
-
O
2625
1250
End
Begin VB.CcmandSutton cmaCysInfo
Ccpt ion
"GSysrem Info. . ."
tieichc
=
345
=
4260
Left
Tabinde:.:
=
2
=
3075
Top
WicEn
=
End
Begin V3.Label Label1
Capcion
=
Ueiçht
Lefc
L cbInde:<
-op
0
i
Xiac h
1245
=
"by Jorge Paclo (1995-20001"
255
1080
=
7
=
=
560
3975
Cnà
Segin VB.Line Linel
=
Bordercolor
Borderstyle
=
=
Index
X1
=
&H00808080&
6 ' Insiae Solid
1
84.515
X2
5309.398
=
=
=
.iI
Y2
1687.593
1687.583
sna
3 e q l n !]B. L a b e i L b i D e s c r i p r i o n
"Tool CO s o l v e t h e O p e r a t i o n A l l o c a t i o n a n d
Copticn
I ! ~ î t r i a l s Z e n c l i r i g Systern S e l e c t i o n P r o ~ l e m s . R e q u i r e s LING0 a n d
X i c r o s o f t Access. "
Forecolor
=
&H00000000&
HeignC
=
910
=
1050
Left
Tab Iriàex
=
3
=
1485
Tep
=
3885
Wicth
End
Segin VS. L s k l I b l T i r i e
C â ~ r ï c n
-
"OP. a-d MESS S o l v e r "
-
3eqinProperty font
Name
=
Size
=
Charset
=
Xeighr;
=
a n d e ri i n e
=
Itoliî
--
Çtrikethrough
EndProperty
=
Forecolor
K P c
~ h i
..-A
=
-!.,ezr=
T z b Index
=
Top
=
i~iàch,
VJorcYir~p
-
"KS S a n s Serif"
8.25
O
=
730
3
'Fâlse
O
'Faise
=
O
'Fsfse
&H00000000&
240
IC50
5
240
3865
-1
'Truc
rri
U A . "
3eqin V 3 . L i n e L i n e l
BcraerColor
BorcerWicth
I
ncex
XI
:A 2
-
&EOOFtFFFF&
=
2
O
=
=
=
'f 1
=
Y2
=
48.6
5309.398
1697.536
1697.936
Snd
Begin ' v 3 . L o n e l I b l V e r s i o n
Capcion
Heiqhc
Lefc
Ta b 1nbe:.:
Top
-
=
=
=
=
=
"Version 0.1"
225
1080
6
480
3885
Kidtn
End
Begin VB-Label l D l D i s c l â i r n e r
Caption
"Warning: Flease r e a d d o c u m e n t a t i o n a n a
s o u r c e code c â r e f u l l y t o s n s u r e p r o p e r o p e r a t i o n . "
Forecolor
=
&S00000000&
ifeight
=
825
=
255
Left
-cnci
TabIndex
=
Tcp
=
=
Width
End
4
2625
3750
A r t r i S u t e VB-Name = " f r m P b o u t "
P - ~ i r i b u t - Va-GlobalNameSpzce = F a l s e
.+ciribute VB-Creatable = F a l s e
A r c r i b u t e VB -F r e d e c l a r e d I d = True
n--r;
..,,,,buce
Va-Exposed = False
Cccion Esplicic
3eq K e y S e c u r i t y O p t i o n s ...
= &H20000
C o 2 s t KEY-QUZRY -VALUE = & H I
coI?sc READ CONTROL
Const
Consï
ccrist
Const
Ccnsr
Ccnsc
KEY-SET-VALUE
&Hz
=
= &H4
KE-f-CZEAîE-SUB-KEY
KEY ENYMEmTE SU3 K E Y S
KEY-NOTIF?
= &~10-
=
hK8
KEY CREATE L I N K = ~ H 2 0
KEY-ALL
-~
C E S S=
i?eq K e y ROOT T y p e s .
=
-
..
Ccnsc HKEY-LOCDL -MACZITJE
c0r.sc E R 3 0 2 - S U C C E S S
-
KEY-QUER- VALUE
KEY SET-VPLUE + KEY-C R E ~-sua
Ë -KEY + KEY E N U M E ~ T-ESUB -KCYS +
KEY -NOTIZY + KE': -CREATE-LINK + READ-CONTROL
=
&H80000002
O
L'cnsc REG-SZ = 1
C o n s c REG-DWO3D = 3
U n i c o d e n u l terminated s t r i n g
' 32-oit number
C o n s : oREGKEYS'r'SINFOLOC = "SOC"'1 d A R C \ M i c r c s o f t \ S h a r e d T o o l s L o c a t i o n "
C o r s r g R E G V R L S - f S I N F O L O C = "MSIMFO"
C o n s r qRZGKfYS*r'SINFO = "SOFTWARE\Microsoft\Shared T o o l s \ M S I N F O 1 *
gP.EGVALS+YSINFO = "PATH"
CÛIS~
-
,- l ~ tse D e c l s r e F u n c t i o n R e g O p n K e y E z A l i a s "RegOpenKeyExA"
( a y V a l h K e y As L o n g , 3yy/al l p S u b K e y A s S t r i n g , ByVal u l O p t i o n s As Long, Yy'vral s a n D e s i r e c A s L o n g , B y R e f p h k R e s u l t A s L o n g ) A s L o n ?
Crivace D e c l à r e F u n c t i o n R e g Q u e r y V a l u e E x
Lib " d d v a p i 3 i " A l i o s " R e g Q u e r y V a l u e E x R 1 ' !Byval h K e y A s L o n g ,
E y V a l I p V a l u e F l â r n e A s S t r i n g , 3 y : J a l I p R e s e r v e a Pas L o n g , Z y R e f 1 p T - y p e As L o n g , B y V a l l p D a t a A s S t r i n g , 3yRef l p c 5 D a t z As Long) As Long
? r i * ~ c t eD ~ c l z r eF u n c t i o n R e g C l o s e K e y L i o " â d v s p i 3 2 " ( B y V a l hKey A s L o n g ) A s L o n g
- - 7
,
,
*LI^
.
" z c v z p i 32"
P r i u â t e Scb c n d S y c I n f o - C l i c k ( )
Cal1 SrartSysInfo
End SUD
P r i v a t e Sub crndOK-Click0
Unload M e
End S u b
P r i v a t e Sub F o r r n - L o a d ( )
-
l
&
t
Me-Czption = "Phout " & App-Title
IblVersion.Caption = "Version " & App-Major
Upp.Minor & " . " & A p p - R e v i s i ~ n
101Titls.Caption = P-pp.Ticle
&
"." -
Z z c Sr?b
Public Sub SCarCSysInfoO
On Error GcTo SysInfoErr
D i m r c As Long
D i r n SysInfoPath As S t z i ~ q
' Fry To G e x System Info Pragrâm Path\Name From Registry . . .
I f GECKPyTJàlue!HKEY-LOCAL P!ACEINE, qREC-KEYSYS INFO, -REG..=-LSYSINFO,
SysinfoP~rh)Thon
' Try To Ger Sysïen I?fo Proçrâm Path Only F r ~ mRegistry . . .
ElseIf G e t S e y V a l r e ( U K C Y-LOC.2.L -Y$-CEINE, ??.EGKEYSYS INFOLOC, qREGVP-LS-fSI??COLOC,
SysInfoPatn) Tnen
Valicôce Existznce Of Known 32 Bit File Version
If (Dir(SysïnfoPa~h& "\MSINF032.EXE") <> " " ) Then
SysInfoPath = SysInfoParn & "\MS1NF032.EXE1'
rrror
d
A
A
-
File Can Not Se Found. ..
Else
GoTo SysInfoErr
End If
=-ror - 3egistry Encry Con Not Be Found ...
Else
GoTo SysInfoErr
Zn8 If
- A
-
I<sqBo:-:
Ena Sub
" S y s r e m informaiion 1s 5nâvaiiable At This Time", v D O K O n l y
EJcElic C ~ n c r i ~GetKeyValue
n
(Key2oot As Long, KeyName As String,
SuS'n'eyRef As Srring, ByRef K e y T / c l As Srring) As Boolean
Dim i As Long
LGCPCounter
2 i m rc As Long
Recurn Code
Handle To FA Open Reqistry Key
Dim hKey As Long
D i m hDepth As Lon9
Dia KeyValType A s Lon9
Din tmpVal As String
DFm KeyValSize A s Lonq
1
' Data Type Of A Registry Key
'Ternpory Storage For A Registry Key Value
S i z e Of Registry Key Veriâble
1--,---,,--,,,,,,-,------------------------------------------
' Open RegKey Under KeyRoot {HKEY-LOCAL-MACHINE . . . 1
1-,-------,-,---,--,,_,,,,__-_-----------,-----------------------------
Open Registry K e y
rc = RegOpenKeyEx (KeyRoot, KeyName, O, KEY ALL ACCESS, hKey)
If (rc <> E?..90R-SUCCESS) Then GoTo ~ e f ~ e ~ ~ ; r o r '- Handle Error . . .
tmpVdl = String$ (102.4,
KeyValSize = 1024
Oj
' Allocate Variable Space
' Mark Variable Size
r c = R e g Q u e r y V a l u e E x (hKey, SubKeyRef,
KeyValTÿpe, t m p V a l , K e y V a l S i z e )
If
( r c <> LRROR-SUCCESS)
0,
G e t / C r e a t e Key V a l u e
Then GoTo G e t K e y E r r o r
Handle E r r o r s
' Win95 A c a s N u l 1 T e - m i n a r e d S c r i n g . . .
I f ( A s c ( M i c ( t m p V a l , K e y V a i S i z e , I)j = O ) Then
I . I u l l Fcund, E x t r a c t Frcm S t r i n ç
tmpVai = L e f t ( t m ~ V a l , K e y V a l S i z e - 1 )
Elss
WinNT Does NOT M u l l T e r m i n a t e S r r i n g . . .
' b i c l l Not Foxnd, t x r r a c t S t r i n g O n l y
cmpVal = L e f ï ( t m p V a l , K e y V z l S i r e )
End If
1--,--,,--,,,------------------------------------------------
D e t e r m i n e Key V a l u e Type F o r C o n v e r s i o n
...
I----,-------,,-----------i--ii-----------------------------------
S e l e c t C a s e KeyValType
C c s e REG-SZ
KeyVal = t m p V a l
Case 2EG-DWOXC
ror i
7
=
I
L e n ( t n p V a l ) To
S e a r c h Caca T y p e s . . .
S t r i n g R e g i s t r y Key Dâra T y p e
' Copy S t r i n g V a l u e
' Docble Wora R e g i s t r y Key D a t a Type
S t e p -1
' C o n v e r t E a c h Bir
' acild V a l u e C h o r . By C h ô r .
KeyVal
=
KeyVal + Erx ( A s c ( F l i c ( t m p V a l , i, 1) ) )
Kezt
KeyVal
End S e l e c t
=
F o r r n a t S ("&hm
= True
GetKe!;Value
T C = RegCloseKey (hKey1
Exit Funcrion
-
KeyVal)
' C o n v e r t Double Word 7'0 S t r i n g
* Return Success
C l o s e R e g i s t r y Key
Exit
C l e a n u p A f r o r An Z r r o r Has O c c u r e d . . .
' S e t R e t u r n V a l To Ernpty S t r i n g
' Return F a i l u r e
GstKeyVolce = F a l s e
C l o s e R e g i s t r y Key
rc = RegCloseKey ( h K e y )
Ena L1~nrTion
GetKe~Error:
xey'Jcl
=
l
nw
Source Code for frmdgMC.frm
'JERSION 5 . 0 0
Object = "{00028C01-0000-û000-0000-000000000046}#1.00~;
S e g i n 'JB. Form f rmdçMC
ClienrHeight
=
4590
ClientLeft
=
1650
ClientTop
=
1545
=
6150
ClientWidth
"DBGRID32.0CXw
Li~kTopic
"Forml"
ScaleHeight
=
4590
ScaleMode
=
O
'User
ScaleWidth
=
6150
Begin VE-PictureBox p i c E u t ~ o n s
A lign
=
1 'P.iignTo~
Appearance
=
O
'E'lat
Borderstyle
=
O
'Lione
=oreCol_cr
=
lii80000008&
tieight
=
330
=
O
Left
ScâleReiqht
=
330
SczleWidch
=
6150
TabIndex
=
1
TzDS top
=
O
''alse
?cc
=
O
IiiCth
=
Ois0
Begin VE.ComandButton
Caption
iieight
=
Left
=
TabIndex
=
Tzg
=
Top
Width
=
End
E e q i n VB.Comrnand3utton
-Captiori
Xeig;?~
=
=
Lefc
cncClose
"&Closew
330
4398
5
"GCiose"
O
1437
csdFilter
clr l l t e r "
330
I l r F '
,-,
LzbInd~x
=
2924
4
Tag
-
"&Filter"
Top
llidth
=
=
G
1462
End
3egin VE.Co.mondButton
Caption
Heighc
=
Left
=
TabInCex
=
T ,Go
-:na
cndSort
"&Sortw
330
1462
3
"&Sorïw
Tcp
=
O
Xict:?
=
1262
Beçin VB.CorrunandButton c r n a R e f r e s h
Coption
Height
Left
TabIncex
Tag
Top
Wiciti-
-
=
=
=
--
=
=
"Clief r e s h "
330
3
2
"hRefreshW
O
1462
End
End
B e g i n VB-Dora D a t a i
Caprion
-Connect
"Datal"
"Accessl*
-
DatabaseName
DefaultCursorType=
DefaultType
Exclusive
Keight
Left
Cptions
ReadOnl y
RecordsetType
=
RecordSource
Top
Visible
VJidti?
' DefaultCursor
'UseODBC
'Lalse
O
2
O
300
2505
O
'Fclse
'Dynaset
O
I
II 11
~ n c i
Segin MSDSGrid-DBGrid grdDataGrid
1<gn
I
'Olign Top
.2." frrncc$K. fr:.:":S O C 0
aindings
3645
Heiqht
Left
-
01eObjecr31ob
TabIride:.:
Top
=
Wiciïh
C
11 L
F
~~ncqr4c.
fr:<" :OOCE
-
-
-
tnc
S2Q
gsdatabase As String
gs3ecordsocrce A s String
msSorïCol As Srring
n b C t r l K e y As Integer
cndClose-Click
Unload Me
Sub
( )
P r i v s t e Sub cmaFilrer-C l i c k 0
On Error SOTO FilterErr
Dim recRecordset1 As Recordset, recRecordseï2 As Recordset
Gin sFilterStr A s S t r i n c
if Catâl.i?ecordsetType = vbRSTypeTable Then
aeep
Msgaoz "You Cannot F i l t e r a Table Recoraset!", 48
Exit Sub
End If
Set recRecordsetl
=
Datal-Recordset
'copy the recordset
s F i l t e r S t r = InputBox ( " E n t e r F i l t e r E x p r e s s i o n : " )
I f L e n ( s F i l t e r S t r 1 = O Then E x i t S u b
Screen.MousePointer = vbHourglass
r e c R e c o r d s e t 1 . Filter = s F i l t e r S t r
Sec r o c R e c o r d s e t 2 = r e c R e c o r d s e t l . 0 p e n R e c o r d s e t ( r e c R e c o r ~ e }
'escoblish the f i l t e r
S e t D a r â i . 3 e c o r d s e t = recRecordsec2
' ô s s i q n ~ a c kr o o r i g i n a l r e c o r c s e t o b f e c r
S c r e e n . MousePointer = 7~bDefzuli
E:.:i t SUC
?ri---
Sub c ï r d 3 e f r e s h -C l i c k ( 1
O n Y r r o r GoTo R e f E r r
E x i t Sub
?ri-;&ce Süb cncSort-Click
( )
O z E r r o r Go70 S o r t E r r
D i n rec?.ecorasetl
A s Recordset,
D i a SortStr A s S t r i n g
recRecordset2 A s Recoraset
If D c t a l . R e c o r d s e t T y p e
= vbRSTypeTable Then
Seep
PsgBox "?ou Cannot S o r t 2 T a b l e ? . e c o r a s e t ! " ,
48
L : < i t Sxb
Sna
If
Set r e c 2 e c o r d s e t l
=
Daral.R e c o r d s e c
'îopy t h e recordset
If Len (msSorcCol) = O Then
S o r ï S t r = InputBox ( " E n z e r S o r t Column: "1
I f L e n ( S o r t S t r ) = O Then E x i t Sub
Slse
SortStr
5.?d I f
=
msSortCol
Screen.MocsePointer = vbHourglass
recRecordsetl.Sort = SortStr
' e s t a b l i s n rhe Sort
S e t r e c R e c o r d s e t 2 = recRecordsetl.OpenRecordset(recRecordset~.Type)
Set Datal.Recordset
=
recRecordset2
Srree~.MousePointer = vbDefault
Exit S u b
SoriErr:
Screen .MousePointer = vbDefault
Msg9ox "Errcr:" & Err & " " C Err. gescription
C7.d ScD
Fri~jsreSub forrn-load ( 1
Dim bParmQry As Integer
C i r n qdfTap ?.s QueryDef
qsaa tabdse = "C: \THESIS-WORK\SOLVSEi\OFFF
~ s R e c ~ ~ c ~ z=
ü r"Machines"
c e
KDB1'
On Error GoTo LoadErr
'Tc Do
'qsDataDase is a global string thàc needs
' C O be set S y the startup s ~ b
for ~ h e
app
2atal.DctâDaseName = gscatûbase
'gsRecordSource is a global string that needs
e
,O bs sec by the sub routine that loads ihis form
Dâtal.RecordSource = gsReccrdsource
Dztal . RecordsetType = 1
' dynasec
Dacal.Opcions = O
Datcl.Refresn
1
If L e n (9ctal.3ecordSourcel > 50 Thon
Me.Coption = "SQL Statement"
-.
LIS?
Me-Capcion
Znc If
LoadErr:
?4sg9ox "Error:"
Unload Mo
Szd Sub
Datsl.RecordSource
=
C
Err
&
" "
&
Urr-Description
? r i v o c e Sub E'orm-Resize ( 1
On Error Resume Next
If Me.NincowStàte <> i Tnen
grdDacaGyid.Height = Me.Heigni - (425 + picButtons-Height)
End If
End S u b
P r i v a c e Sub qrdDataGrid-BeforeDeIete(Cance1 As Integer)
If MsgBcx("De1ete Current Row?", vbYesNo + vbQuestion) <> vbYes
Then
Cancel
End If
End Sub
=
True
P r i v a c e SUD gràDataGrid-BeforeUpdate(Cance1 As Integer)
If MsqBox("Commit changes?", vbYesNo + vbQuestion1
Conce1 = True
Znd If
Zr1à Sub
vbYes T h e r !
€>
crivace Çub gràDataCria-HeadClick(ByVa1 ColIndex As Integer)
'iet's sçrt on t n i s coiumn
If Datal.3ecordsetType = vb3STypeTable Then Exit Sub
'check for rne use of tne ccrl key for descending sorï
nbCtrLKey
=
O 'reset ic
FISP
nsScrrCv1 = " [ " & 2âtal. Recordsoc (CclIndex].Name
End If
cmcSort-CIFck
m s S o r ~ C o i= vbNullString ' reset iï
Zna
L
"
j"
Sub
lrivate Sub qrcDâraGrid-MouseUp(Button As Integer, Shift As Inteqer,_
:-:As Single, .L'As Sinqle)
nijCtrlKey = Shift
ET.^ Sub
Source Code for fmdgMfg0p.fm
3eqin V a . Forn frndgMfgOp
CLientHeight
=
4590
C l i ~ n ~ L e f t
=
1650
Cliei?îT~p
=
1545
ClientWiath
=
6150
LintTopic
"Forml"
scôleEeFght
=
4590
ScaleMode
=
O 'User
ScaieWidth
=
6150
3eçin VB.PictureE3ox picButtons
i
'F-lignTop
A-lion
Appearance
=
O 'Fllat
BorderStyie
=
O 'None
Forecolor
=
&fi80000008&
Heignt
=
330
=
O
Left
ScaleHeight
=
330
ScaleWidtn
TaoIndes
TâSStop
Top
Width
c m a R e f resh
"L 2 e f resh"
330
O
2
m
lâ g
l1
L3efresh1'
'Pm
O
Wiàch
1462
*
UD
End
End
3egin VB.Dàta Data1
Capticn
Connect
DatabaseName
DefaultCursorType=
D e f âulcType
Exclusive
iieight
Left
Options
ReadOnly
RecordsetType
RecordSource
TOP
Visible
-
=
"Datai"
"Access"
11 ?1
O
'DefâultCursor
2
' UseODBC
O
'False
300
2505
O
O
'False
1 'Dynàset
-
2175
-
O
-
1I 11
'Lâlse
Midth
=
1140
End
seoir? MSDBGrFa.DBGri8 graDâtaGrid
Alion
3ir.dinqs
-
tiei~ht
=
Left
01eObj eccBlob
TabIndex
Top
WFdth
=
=
=
=
=
I 'Align Top
"frndgMfgOp.frx":000O
3645
O
"frmcqMfgOp. frx" :00CE
O
330
6150
End
End
. q t t r i G ~ c eVB -Nama = "frmdgMfq0~"
Arcribute VB-GlobslNameSpace = Fzlse
.--LLriSuteVB-Creaîable = False
,,, s ~ c e 3'0-PredeclaredIU = T r z e
A c c r i n u t e VB-Exposed = False
Vpïion E x p l i c i r
> c c
.yL
D ~ Kgsdacabase As String
D i r n qsRecordsource As String
D i m nsSorîCoi As String
Dim nbCtrlKeÿ As Inteqer
D i m recReroraset1 As Recorcset, recRecordset2 As R e c o r a s e r
D i n s F i l t e r S t r As
Strinç
If DoEâl.3ecorasetType
= v j R S T y p e T z S l e Then
Seep
K s g B o x "?ou Cannot F i l t e r g TsbLe Recordset! ", 48
-t:<i
. t SuY
E 2 c If
Set recRecordset1 = DataI.Recoràse~
recordsec
' c c p y the
sCilterStr = InputBox("Enter F i l t e r Expression: "1
I f Len (sFi1:erÇtr) = O F h e n Exit Sub
Screen.MousePointer = vbHourqlass
recRecordsetl. Filter = s F i l t e r S t r
Set recRecordset2 = recRecordsetl.OpenRecordset(recRecordseti-Type1
'establish the fiiter
Set Datal.Xecordset = recRecordse~2
' c s s i g n back to original recordset o b j e c t
Exit Sub
-
rilCerErr:
Screen.MousePointer =
M s g B o x "Error:" & Err
Znci S u b
G:<i t Sub
Err
P r i w a r e S l ~ bcm8Sort-Click ( )
Cx Error GoTo SortErr
Recordsec
If DaCal.RecordsetType
= vD?.STypeTeble
Then
Beep
MsgEo:~ "?ou Cannoc S o r r a Table Recordset ! ", 4 8
E x i t Su5
Eric! If
Set rrcRecorasetl = Dztal.Recordset
' c o ? ; ~ r h e recordset
If L e n ( m s S o r ~ C o l =
~ O Then
ScrïScr = InputBon("fn:er Sort Colümn:")
I f Len (SortStr) = O Tnen E x i t Süb
Else
SortSir
=
msSortCol
End i f
Screen.MousePointer = vbHccrglass
recRecordsetl.Sorc = SortStr
'esiâblish the Sort
Screen.WousePointer
~ x i tS u b
-
=
vSDefault
ÇortErr:
Screen.MousePointer = vbDefault
MsgBox "Error:" & Err & " " & Err.Descripcion
Lnc Sub
?rivate Sub Form-Load ( 1
Din bParmQry As Integer
Dim adfTmp As QueryDef
çsdatabase = "C:\THESISWORK\SCLVER\OA.MDB'*
qsRecordsource = " M f g O p s "
On E r r o r GoTo LoadErr
' T o Do
'csDatabase is a gloDal strinq ïhoï needs
'Co be Sei by the srartu? sub for the a p p
Dstal.DatsbcseName = gsdatabsse
'qsRecordSocrce is a globzl strinç tnat needs
'to je set b y che süb rourine that loads this form
3 c t c l.3ec3rdSource = çsRecorbsourco
' cynaser
2aral.KzcorcseCType = I
Datal.Opticns = O
Dzïûl . Refresn
if Le2 (Datcl.RecordSource) > 50 Thon
Me-Caption
=
"SQL Statement"
Else
-~
Me-Capcion = Dat~i.RecordSource
n dIf
?ri-~ateS u b Fcrm-Resize ( )
On Z r r o r Resume Next
If Me.WincowState <> 1 Then
qr8DataGrid.Heiqnt = Me-Eeight - (425 + picButions.Reighr)
Z?.a If
Znc S u b
?rivcce S u b qrcDâtaGrid-BeforeCelete(Cânce1 As Integer)
I f MsgBox["Celete Current Row?", vbYesNo + vbQuestion) <> vbYes
Then
Cancel = True
E n d If
E n a Scb
Privace Sub qrdDâtaGrid-BeforeUpdate(Cance1 A s Integer)
If MsgSox("Commit changes?", vbYesNo t vbQuestion) <> vbYes Then
Cancel
=
True
Ena If
End Süb
Private S U S grdDztaGria-AeadClick(ByVa1 ColIridex A s Integer)
'let's sort on this column
If Datal.RecordsetType = vbRSTypeTable Then Exit Sub
'check for the ose of the ctrl key for descending sort
If mbCtrlKey Then
msSortCo1 = "[" & Datal.~ecordset(ColIndex).Name& " 1 aesc"
rrbCtrlKey = O 'reset iï
Else
msSortcol = " [ " & Datal. Recordset (ColIndexj. N a m e & "1 "
End If
crndSorc-Click
nsSortCol = vDNullStrinq 'reset ir
3 n c Çub
Lrivâtt SUD g r c D â c a G r i d ~ M o u s e U ~ ( 3 u t t oEs
z Integer, S n i f t As Inceger,1:.
2 s Single, Y As Single)
inbCtrlKey = Shift
-
Source Code for frmdgMHC.fmi
VERSION 5.00
Object = " { 0 0 0 2 8 C 0 1 - 0 0 0 0 - 0 0 0 0 - 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 4 6 ~ # 1 . 0 0 ' ;
B e q i n VB . F o r m frmdgMHC
Clientueiçnc
=
4530
CliencLefc
=
1650
CliencTop
=
1545
ClientWidtR
=
6150
LinkTcpic
"Forrnl"
ScaleFeignc
=
4590
ScaleMode
=
O 'User
ScaleWidth
=
6150
Begin VS.PicïureBox pic8uttons
i 'Rliqn Tcp
Align
=
C)
'Flat
Papesrance
Borderstyle
=
O 'None
Forecolor
=
&H80000008&
tieight
=
330
Seft
ScaleHeiqht
ScaleWici~h
TabIcdex
=
=
=
-
O
330
6150
1
O
'sase
Top
=
O
Width
=
6150
Becin VB.Co.mandButton cmàClose
"&Closev
Caption
Height
=
330
Left
=
4358
TabIndex
=
5
Tag
"&Close1'
TaDStop
=
"DaGZ1D32.OCXw
-
TOP
Widrh
-
Eric
Beqin VB-ComrnandButton
Caption
Height
-Left
TabIndex
-
Tag
-
Top
Width
End
aeqin VB.CommandButton
Capticn
Heighc
Le f ï
TabIzder.
Tag
Top
Widt h
End
Beqin VB.CommandButton
Càptior!
iieiqnt
Left
Tab Ir.de:-:
Tao
Top
Niath
-zndEnd
Segin V B . D e = o Darsl
Côpticn
Conxect
LktôbaseNârne
333
O
2
"&?,ef resh"
C
1202
-
DsfaulCCursorType=
DefaultType
5:clcsive
Zeight
5efc
Options
ReâdOnl y
RecorasetType
RecoraSource
-
-
=
-
Tep
-
Visible
Widt h
-
-
-
Znd
Sesin MSDBGria-DBGrid grdDataGrid
1
'Align Top
A l ign
" frrnaçYHC. frx": 0000
Eindinqs
3645
Fieight
Left
OleObjectBlob
TabIndex
Top
Width
-
=
-
O
"frmdgMHC.frx":OOCE
O
330
6150
End
End
P.t t ribute VB-Name = "frmdqMHC1'
Attribuce VB-GlobalNameSpace = False
Az-trributeVB Creatable = False
>.ttribute VB-PredeclaredId = True
AïtriSute VB-Cxposed = False
Option Esplicit
-
-
Dim gsdârâbase P-s String
D i r r . gsRecordsource As String
Dim msSortCol As String
Dim mbCrrlKey P.s Integer
P r i v c t e Sun cmcfilter-Click ( 1
On Error GoSo FilterSrr
G i m recRecozdsetl As Recordset, rec3ecordset2 As Recordseï
D i m sFilterStr As Strinq
If Dacal.RecordsetType = vS3STypeTcble Cnen
Eeep
MsgBox "You Cannot Filter a TâCie Recordset! ", 48
Exit S U S
S n C If
Set recRecordsetl
'copy ths reccrdset
=
Da~al.Recorcseï
sFilrerStr = InputBox("Ynter Filcer Expression:")
If Len(sFi1ierStr) = O Then Exit Sub
= vbHourglass
Scr~~n.MousePointer
recRecordserl . filter = sFilterStr
Set recRecordset2 = r e c R e c o r d s e t l . 0 p e n R e c o r d s e t ( r e c R e c o r d s e t ~ . T ~ e ~
'establish the filter
Set Detsl.Recordset = recRecûrdset2
'cssign back to original recorccet object
Scr~en.MousePointer= vbDefault
Exit Sub
rllterErr:
Screen.MoüsePointer = vbDefault
MsqBox "Error:" & Err & " " c Err. Description
Ena Sub
Privâto Sub cmdxefresh-Click()
On Error GoTo R e f E r r
Data1 . Recoraset .Requery
3efErr:
Err
&
? r i v a t e Sub crndsort-Click
()
;.IsqBox
"Error: "
G
"
"
&
5rr.Description
End Sxb
On Error GoTc SortErr
5 i m rec?.ecoraseti As Recoraser, rec3ecorbset2 As Recordser
Dim
SortSrr As Strinq
I f Dztal.RecordsetType
=
3eep
MscBox
vBRSTypeTabie Then
"Lou Cannoc Sor:
Exic Sub
E R G If
Sec recReccrdset1
'ccpy t h e recordset
=
à
T z i b l ? !?eccrcset!", 4 8
Datzi.3ecordset
If Len(msSortCo1) = O Then
SortStr = InputBox ("Fnter Sorc Colurnn: "1
If Ler.(SorCStr) = O Shen Exit SUS
Else
S o r r S t r = xsSortCol
Enc TE
'estcblish the Sort
S?r recRecordsec2 = recRecordseti.OpenRecordsei(recRec~ràsetI~Type)
Set Dâtâl.Recorbset
=
recRecordset2
ScrrErr:
Screen.MousePointer = vDDefaült
& Err & " " & Err-Descriprion
XsgEcx " E r r o r : "
Inc Çub
?rivace Sub Form-LoadO
D i m bParmQry As Integer
Di3 qdfTmp ;
.
s QueryDef
gsciatàbzse = "C:\THESIS-WORK\SOLVSR\OA.MDB"
gsRecordsource = "MHC"
On Error GoTo LoadErr
'To Do
'gsDztabase is a global string that needs
'to be set S y tne startup sub for tne app
Catzil.DâtabaseName = gsdatabase
'qsRecordSource is a global string Chat needs
'ïo oe set by the sub routine that loads this form
Data1 . RecordSource = gsRecordsource
Daral.RecordsetType = I
' dynaset
Doi&l.Oprions = 0
Dstal. Refresh
If Len(Datsl.RecordSou=ce) > JO The=
Me.Capcion = "SQL Statenent"
Else
Me.Cüpïion = Datâl.ReccrdSource
End If
LzrdZrr:
"Error:"
Snioad M e
MsgYo:<
6
Err
C
" " i Err.Descripcion
Z n a Sub
PrFvsce Sub Forrn-Resize ( )
On Error Resume Next
End If
LrFvate Sub grdDataGri8-BefcreDelete (CazceI As Inteqer)
If MsgBox ( "Delete Current Z o w ? " , vb7!esNc + voQüestion) <> vbYes
Ther.
Cancel = Trüe
Er?à If
3r.a S ü b
-r~-;oieSUD grdDâtzGrid-BeforeUpdate ( CdnceI As Integer)
1 f MsgSox ( "Co-mit chances?", vbYesNo + vDQuestion) <> vb?es Then
Cancel = True
E n d If
9
.
Erid SUD
S U D grcDataGrid-HeadClick(ByVoI ColIndex As Integer)
'1~~'
sorr
s
on this column
If Dacal.RecordsetType = vBRSTypeTable Then Exit Sub
'rivate
'check for Che use of the ccri k e y for descending sort
If nbCtrlKey Then
msSortCo1 = " [ " & Dâtai.Recordset(ColIndex).Name 6 " 1 desc"
mbCtrlKey = O 'reset it
Else
msSorCCol = " [ " 6 Datal.Recoraset(ColInàex).Name C " 1 "
End If
cmdSort-Click
msSortCo1 = vbNullString 'reset it
Enc Sub
P r i v a c e . Sub grdDataGrid-MouseUc(Butt0n
x As Single, - As Single)
r n b C t r l K e y = Shift
As Integer, S h i f t As Integer,
-
Ena SUD
Source Code for frrndgMHEquip.fnn
7 r-
. L ? . S I O N 5.00
Objecr = " ~ 0 0 3 2 6 C O i - 0 0 0 0 - O G 0 O - G O G O - O O O O 2 Û O O O O 4 6 ~ t l . O O " ; "DBC3iD32-OCX"
Sesin VE . Form f rmdgMREquFp
=
4590
ClientHeight
CLientLeft
=
1650
CliencTop
=
1545
ClientNicith
=
6150
"FOrmlW
LinkTopic
ScaleHeight
=
4590
ScaleMode
=
O 'Gser
ScaleKictn
=
6i5C
Eegin VB.PiccureBox picButt~ns
=
I 'AIFgnTop
.%lign
=
O
'Fiat
Appearznce
BorderSïyle
=
O 'Ncne
Forecolor
=
&F20000009&
Eeight
=
330
Left
=
O
ScaleHeight
=
330
ScaleWidth
=
6150
TabIncex
TabStop
=
3
'Calse
L op
=
O
Width
=
6150
J e q i n VE.ComrnandButCon cncClose
"&Close"
Capt ion
Height
=
330
Left
=
4398
TabInaex
=
5
Tâg
*'&Closeg1
=
O
Top
Width
=
1437
-
Ena
B ~ o i nVB.CommandButton
Cdption
=
Heiqhc
Left
=
TabInàex
=
Tag
=
Top
Width
=
cmdFilter
"&Filter"
330
2524
4
" &Filter"
O
1462
End
Begin VB.CommandButton
Caption
=
HeFght
Left
=
TabIndex
=
-
Tog
cmdsort
"LSort"
330
1462
3
"GSortW
O
1462
=
TOP
Plidth
=
End
Segin VB.CommandButton cmdRefresn
Capcion
Heignr
Left
ToDIndex
Tag
Top
Width
Zna
Ena
3 ~ g i nVS.Dsca Dctal
Caprion
Co~nect
Da~abâseNam~ 9~faultCursorType=
ZefsultType
Exclusi-~e
iieight
Left
Options
XeodOnl y
3ecordsetType
RecordÇcurca
Icp
Viçi~le
CI
Wiath
"2ato.I"
"Access "
11 Il
=
O 'DefaultCursor
2 'VseODBC
O
'False
300
2505
O
O
' "alse
I ' Dynaset
-
II II
-
2175
O
'talse
1140
-
-
End
Begin MSDaGric. DBGrid
l ign
.E--
Binainqs
Heighc
Le£ t
OleCb jecralob
TabIndex
TOF
Wiàth
d
=
-
Eric
Enc
A~cributeVB-Name = "frmdqMHEquip"
Artribute Va-GlobâlNameSpace = Fslse
Acïri~uteVB-Creatable = False
Arcribute VB-PredeclaredIa = True
o t t r Fbute VB-Exposed = False
Option Explicit
C i r n gsdatabas~A s String
Dim gsRecorasource As String
D i r n msSortCol As String
Dim r n b C t r i K e y As Integer
Pri.~âteSub cndFilcer-Click ( )
On Error GoTo LilterErr
G i n
recXecordset1 As Recordset, recReccrdset2 As Recordsec
D i m ~ E i l t ~ r S tAs
r String
-L L-
Dzta1.?.~cordsetT4~pe
= vb?.S'ïypeT8~1~
Then
-ieep
NsqSox "You Cannot Filter
Exi: S L I ~
Z n c If
Set recRecordset 1
the recordset
=
2
Table Recordset!", 48
Dacal. Recordsec
'ccpy
sFiiterStr = InputBox("Enter Filter Expression:")
If Len(sFilterStr) = O Then E x i t Suo
MousePointer = vcHourgLass
recRecordse~1.Filter = sFilcerStr
Set rerRecordset2 = recReccrdsetl.0penRecordset(recRecordset~.T~e)
'est&lisn
t h e filter
Set Gatci.Recoraset = recXecordset2
'sssiqn 5ack C O original recorcset o ~ j e c t
Screen.
-r iiccrErr:
End
Screen .XousePoinier = vbDefsult
MsgBoz "Zrrcr:" & Err C " " C Err.3escription
Sub
Crivate Süb cindRefresh-Click0
O n Error GoTo RefErr
Datai .Recoràset .Requery
Exit Sub
RefErr:
MsqBox "Error:"
3nc S u b
&
Err
&
Private Sub cmdSort-Click0
On Error GoTo SortErr
" "
C
Err-Description
Dim recRecordsetl A s Recorcset, recRecordset2 As Reccrdset
D i r n SorCStr As String
If Dâtal.RerordsetType
= vb3STypeTzble Then
Eeep
MsgBox "You Cannot Sort a Tabie Recordset!", 4 8
Exit SÜD
End If
Set recRocoraser1
=
Datal-Recordset
' c c p y che recordset
If Len (rnsSortCoT) = C T h e n
SorrScr = Inpu~Box("Enter Sort Colunn:")
i f Len(ScriStr) = O Then E x i t Sub
Slse
-~ n
ScrcStr =
asScrtCcl
d
If
'estoeiish C h e Sort
Set recRecordset2 = r e c R e c o r d s e t l . O p e n R ~ ~ ~ r d s e t ( r e c R e c o r d s e ~ ~ . T y p e l
Set Data l -3eccrds2t = recRecordset2
Screen.MousePointer
-C < i C
=
voDefzult
Sub
SorESrr:
Scre~n-?!ousePointer = vbDefaulï
C 5rr & " " 6 Zrr.Description
Sub
:/isqBox "Error:"
:!?ci
S u b Ccrn-Loàa ( 1
DFm b P a r m Q r y As Inteqer
3 i m qcfTmp As Q u e r y D ~ f
?ri-;ece
qsàatâbase = lVC:\THESIS-WORK\SOLVER\OA.MDB"
qsRecordsource = "MH-fquip"
On Error G o T o LoadErr
'Tri Do
'~sDzczSaseis a globai string t n â t needs
'CO be set o y the starcup sub for the app
Datal.DacâbaseName = qsdatabâse
'~sRecordSourceis a global string that neeas
'to be set by the sub routine that loads this form
Datal.RecordSource = gsRecordsource
D a t z l . RecordsetType = 1
'dynaset
Datai-Options = O
Datal-Refresh
If Len(Datal.RecoraSource) > 50 Then
Me-Câption = "SQL Statement"
Else
Xe-Czption = Datal.RecordSource
End If
Exit Sub
LoadErr :
MsgBox "Errer:"
i J n l o a d Me
&
Err
&
" "
&
Err.DescriptFon
Enc SUS
Frivcce Sub Forn-Resize ( )
O n E r r c r R e s u m e Next
Friwace Sub çrcDataGrid-BeforeDelete(Cance1 As Integer)
-i r- MsqEox("0elete Current Row?", ~;bYesMo t vbQuestion) <> vbYes
Then
Czncel
Ena If
E n a Sc3
=
True
? r i - ~ a c eSuD grcDataGrid-BeforeUpaate(Cânce1 As Integer)
-- n c
W . .
If MsqBo:~( "Commiï changes?", vbYesNo
Cencel = True
Encj I f
-
vbQuestion) c > vb-fes Lhen
Sul>
2 r i v z ~ eSüb qrcDstaGrid-HeadC1Fck !ByVâl Colindex As Integer)
'lei's sory on this colümn
If Dacal.3ecordsetType = vD3STypeTable Then Exit Sub
'check for ïhe use of the ccrl key for descendinq sort
If nbCrrlKeÿ Then
msSoriCol = "[" G Dacz1.Recoràset (ColIndex).Name & "1
nbCtrlKey = O 'resec i t
desc"
-~ l s e
rnsSor~Col= " [ " & D a t a i . R e c o r d s e t ( C o l I n d e : . O .Name
End If
cmaSort-Click
nsÇortCoi = vbNullStrinq 'reset it
&
"1"
Er,d Sub
3 r i v a t s Sub grdDztaGrid-MouseUp(3uticn As Integer, Shift A s Integer,
:-:.&s SFnql?, Y As Single)
mXtrlKey
End SUD
=
Shift
-
Source Code for frmdgMHReq.frm
TIERSION 5 - 0 0
Object = " ( 0 0 C 2 b C 0 1 - 0 0 0 0 - 0 0 0 0 - 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 4 6 } # 0 0 " ;
Seqin VB-Form frmagNHReq
CliencHeighc
=
4590
ClisnzLeft
=
1650
ClientTop
=
1545
ClientWidth
=
6150
LinL.To?ic
"Forrnl"
=
4550
SccleHeignt
ScaleMode
=
O 'üser
=
6150
ScoleWidth
Leqin V a . PiciureBox picBüttor-.s
i
'Aiign Top
Align
Appeorsnce
=
r~;cc
3orcerScyle
=
0 'cione
ForeColcr
=
&Fi800300û8&
ileigkic
=
330
=
O
Left
SczleHeight
=
330
Scalekliaih
=
6150
TabIndex
=
1
TaDStop
=
0
l 7r â l s e
=
O
Top
'siidth
Bi50
=
3egin VB. Commanaautton
Caption
neight
=
Left
=
TabI~dex
Tâg
=
Tcp
rrlidth
-
c~.dClose
" close"
330
4358
5
"&Close1'
O
1437
Enc
Segin V B . CommandButton
Câpriion
Heiqht
=
Left
=
TâbIndex
=
Taq
Top
=
Width
Enci
3e2in VE.CommandButton
Caption
Keighï
Left
=
TâDInaex
=
Taq
'op
-
=
=
cadFilter
"&Filter"
330
2424
4
"&Fi1ter1*
O
1462
cndSort
"&Sortw
333
1462
3
"&Sort1'
O
Wiath
1462
End
Begin VB.CommandButton cmdRefresh
Câption
"&RefreshW
"DBGRID32.0CX"
Height
LefE
TaD 1 ndex
Tag
Top
IiidtR
End
End
segin V a . Daia Datzi
Capcion
Co~nect
DatabâseXame
DefauliCursorTy-pe=
DefcultType
=xclcsive
Eeignc
Lef t
-
Gpt 1cns
'
3eaaOnly
RecordsetType
3ecordSource
TOP
Visible
kliath
-
-
=
-
O ' DefaultC~rsor
2 'UseODBC
I)
' Folse
300
2505
O
0
1
' 'alse
'Dynaset
II '
1
f~d
Segin XSDBCrid-DBGrid qrdDacaGrid
1 'A1Fqn Top
Aliqn
"frrn~qMHReq.Erx":OOOO
3inainçs
3645
i-ieiohc
O
L e fi
LrmC-MHReq.frx":OOCE
c
OleObjec~91ob =
O
TzbIndex
330
Top
6150
Widrh
'9
Eric
End
r.LL-Lbute Va-N d m e = "frmagMHReq"
P-rrricüte V B -GlobalNameSpacz = F à l s e
.'ttribute
Va -Croatable = F a l s e
.L.~ïributeVB-PredeclaredId = True
A t ï r i ~ u c eVB-Exposed = False
Option Explicir
-.++'C,
Dim
Dim
gsdatabase As String
gs?.ecordsource As String
Cix msSortCoi As String
Integer
D F m mbCcrlKey As
Sub cndClose-Click
Unloaci Me
Enc Sub
()
Private Sub cmdFilter-Click0
On Error GoTo FilterErr
Dim recRecordsetl As Recordset, recRecordset2 As Recordset
Dim sFilterStr A s String
If Data1.RecordsetType = vbRSTypeTable Then
Beep
MsgBox "You Cannot Filter a Table Recordset!", 48
Exit Sub
End i f
Set recR?ccrdsetl
'copy C n e recordset
=
Datai.RecordseC
sFilterStr = InputBox("Enter Filier Zzpressicn:")
If ien(s€ilcerStr) = 0 The2 Exit Sub
S c r e e n . XousePointer = vbEourglass
recF.ecordsetl.Filcer = sFilcerScr
Set recRec~rdset2= r e c R e c o r d s e t l . 0 ~ e n R e c o r d s e ~ ( r e c R e c o r d s e t I . T ~ ~ e ~
' establish the filter
Sei Datal.3ecordset = recRecordset2
'assign back to original recordset object
Screen-MousePointer = -:bDefault
Exit Sub
-.
r;lterErr:
Screen.MousePointer = vbDefault
XsqBo:.: "Error:" & E r r & " " C Err-Description
S n c St;5
?rivace Sub cmaxefresh-Clicki)
OR Error GoTo 2efErr
C a c a l . Recordset.Requsry
E:.:i " c u b
RefGrr:
End
MsgBox "Error:"
Sub
&
Err
&
" "
G
Err.9escription
P r i ~ . ~ a c Sub
e
cadSori-Click ( 1
O n Error CoTo SorcErr
Dim recRecordset1 As Recorcser, recRecordset2 As Recordset
Dim SorcStr As String
If Datal. RecordsetType = vSRSTypeTable Then
3eep
MsgBox "You Cannot Sort a T a b l e Recordset!", 4 8
Exit Sub
2nd If
Set recRecordsetl
'copy the recordset
= Datal.
Recordset
If Lsn(msSortCo1) = O Then
SortStr = InputBo:.: ("Enter Sort Column: " )
If Len (SortStr) = O T h e n Exit Sub
Zlse
SorcStr = msSorlCol
End If
Screen.MousePointer = vCHocrqlass
recR~corasetl.Sort= SortStr
'escablish rhe Sort
recRecordset2 = r e c R e c o r d s e t l . C ~ e n R e c o r d ~ e t ~ r e c R e ~ 0 r d ~ e t 1 . T y p e )
Set De~àl.3ecoraset= recRecordset2
Set
S o r t f rr:
S c r ~ e .MocsePointer
n
= vbDefeult
MsgBox "Crror:" 6 Err & " " & Err-Description
End Sub
?ri-~ateSUD Fora-L o a d O
Dim BParmQry As Inteqer
Dim a a f T r n p As QueryDef
'7'0 Do
'cjsDatabzise Fs a global srring tnar needs
' c c ne set b y the s t a r r u p s u b for che app
2ztal.Datz5oseNaae = gsdatcbzso
'~s?.ecorcSocrceis a global strinq chat needs
'ïo oe S E C Dy the sub r o u c i ~ etnzt loâds this form
D~tal.Recor8Source = qsRecordsource
Dzcai.RecordsetType = I
'dy~aset
Dscül.Options = O
D a t â l . Refresh
I f Lon~Data1.RecordSource) > 50 Then
Me.Caption = "SQL Staternsnt"
Me-Caption
End If
Ezic
Datal-RecordSource
=
Sub
LoaciErr :
MsgBox "Errer:"
Unload I4e
End Sub
6
Crr
Privüte Sub Form-Resize ( 1
&
"
"
6
Err.Description
Error Resume Next
If Me-WindowState o 1 Then
grdDataGrid.Heiqht = Me-Eeight
E n d If
sus
On
-
( 4 2 5 + picButtons-Height)
-
rrivate Sub gràDataGrid-SeforeDelete(CanceI As Integerl
If MsgBox ( "Delete Current ~ o w ? " ,v8YesNo + vbQuestion)
Then
Cancei = True
End If
C>
vbYes
Znc Sub
Privzce Sub graDataGrid-BeforeUpaate(Concei As Inteqer)
If MsgSox ( "Commit changes?", vSYesMo + vbQuestion) <> vbYes Then
Cancei = True
E n d If
E n d Sub
Sub qrdDacaGrid-HeôdClick(3yVal ColInde:< P-s Integer)
'let's sort on this column
If Datal.RecordsetType = vb3STypeTonle Tnen Exit Sub
Frivare
'check for the use of che crrl key for descending sort
If m b C t r l K e y Then
msSortCol = " [ " & Datal. Recorcset col Inde:^) .Name & "1 desc"
mbCtrlKey = O 'reset it
61se
msSorcCol = " [ " & Dctsl.Recordset(ColIndex).Nane & " 1 "
Gna If
cnaSort-Click
nsSottCol = vbNullStrincj ' r e s e t ic
? r i v a c e Sub grcDataGrid MouseUp (Suttcn As Integer, Snifr As Integer,
:.:
>.s Single,
',i
.As singre)
mbCcrlKey
=
Shift
-
Z z c Sub
Source Code for frmdgPartPlan.ft-rn
;!E?SiON
5-00
O D j e c t = "{00C28C01-0000-0000-0030-000000000046}~l.00v; "DBGR1D32.0CX1'
Begin VB-Form frmdgPartPlan
=
4590
ClientHeight
ClientLeft
=
1650
ClientTo?
=
1545
ClientWidth
=
6150
LFnkTopic
"Forml"
ScâleHeighz
=
4590
ScaleMode
=
O
'User
ScaleWidth
=
6150
B e o i n Va.PictureBox picButtons
=
1 'Align Top
Align
Appecrance
=
O
'Flat
BorderSïyle
=
O
'None
Forecoior
=
&~80000008&
9eight
=
330
Left
ScaleEeight
ScaleWicith
TobLnaex
TâbStop
TG?
rS d. -r
acL
L.i
=
=
=
O
330
=
=
=
O
O
-
6150
L
'False
0150
cndRe f r e s h
"~Refresh"
330
O
2
"&?,efresh"
O
1462
DatabaseMame
DefaultCursorType=
DefaultType
Exclusive
Height
Left
Options
ReadOnlRecordserType
=
RecordSource
Top
Visible
Wiatn
Lnci
S e g i n M S D E G r i c . DBGrid
A
Eirdinqs
Eoiqht
-
Lpft
-
.1 1 ; on
- AA
O 'DefaultCürsor
2 'UseODBC
O
'E'alse
300
2505
O
O
"alse
i
'Dynaset
1'
11
2175
O
'False
1140
-
Ol~OBjec~Blob =
TabInaex
Top
-
Widtn
-
End
Enci
>ctribute VB-Nsme = "frmdgPart?lan"
At tribuce VB -GlobdlNameSpace = E'alse
K i r i b ü c e VB-Creatable = False
Arrribuîe V a -PredeclsredId = T r u e
?.c~ribcieVB -Ezposed = C o l s e
Ozrion E ~ p l i c i ~
3in gsdatabase As String
D i n gsRecordsource As String
D i m msSortCol As String
D i n m b C t r l K e y As Integer
Sub cndllose Click (
)
'Jnload MG
Enc Su5
SUD rmcFilter-Click (
On Errcr GoTo FilterErr
3riT.7zte
Dim recRecordset1 As RecorCset, recRecordset2 As Recordset
D i r n sFilt~rStrAs String
If Datal.RecordsetType
= vb3STypeTable Then
Beep
Msqeox "You Cannot Filter a Table Recordset!", 18
Zxit Stib
End If
Set recRecordsetl
'copy c n e recordset
=
Datal-Recordset
sFilterStr = InputBox("Enter Filter Expression:")
If Len(sFi1terStr) = O Then E x i t Sub
Screen.~o~se?ointer= vbHourglass
recRecordsetl.Filter = sFilterStr
Set recRecordset2 = recRecordsetl.O~enRecordset(rec~ecRe~ordset1~T~/~e)
'esieblish the filter
Set D a t a 1 . Recordset = rec3ecozdset2
'ôssiqn back to original recordset oDject
-.
:~lïerErr:
Screen.McusePoinzer = : ~ S D e f s u l t
.
.
"Srror:" & C r r 6 " " & E r r . J e s c r ~ ~ ; ~ o n
2nd Sub
PIsgZox
? r i v a c e Su5 cmcRef resn-Click ( 1
On Frror GoTo R e f E r r
D s r â l . Reccraset.Requery
aefzrr:
!?sqBo:c
Enc Sub
"Error:"
& Err
c
"
"
&
Err.Description
P r i u a t e Çub cmciSorr-Click ( )
O n Error GoTo SortErr
Dim recRecordserl As Recorcset, recgecordset2 As Recordset
DFm SortStr As String
If Dzital.RecordsetType
= vbRSTypeTzSle
Then
Eeep
"Sou Cannoe Sort
Exit S u 5
End If
TLsgBo:.:
Set rec2ecordsetl
'copy C h e recordseï
=
.ï
T a b l e Recordset ! ", 48
Dütol.F,ecordset
-L 1-
Len (rnsSorrCol) = O Then
SortStr = InputBo:<("Enter Sort Column: ")
If Len(SortStr) = O Then Exit Sub
Else
SortStr = msSortCo1
Enfi If
Screen.MousePointer = vbHourglass
recRecordsetl.Sort = SortStr
'establish the Sort
Set recRecordset2 = recRecordsetl.OpenRecordset(recRecord~et1~T~ype)
Set Datal.Recordset = recRecordset2
Screen .MocsePointer
Exit Sub
=
vbDefault
SortSrr:
Sczeen.Mous~Pointer = vDDefault
:CsgBo:< "Error:" & Err & " " & Lrr-Description
End Sub
?ri~.râteSub Form-Loâd ( )
Dim b2armQry As Integer
Dim qafTmp As QueryCef
On
Error GoTc LoadErr
1 0 Do
'qsDztabdse is a global s ~ r i n gt h â c needs
' C O S e set by the scartup sub for the app
2atal.DatabaseNarne = gsdaïâ8sse
'gsEecordSource is a global string chat needs
'te ne set Dy the sub routine thac loads this f o m
Dacai.RecordSource = gsRecorasource
D â r c l .RecordsetType = I
' dynaset
Darsl.Opcions = O
D o t s : . Ref resh
1
r?
If
.RecordSocrce) > 5 0 Then
Xe-Caption = "SQL Statement"
Len (Dâcal
Else
End
Me.Captlon
If
Dâtal.RecoraSource
=
LocdCrr :
C/!sqBo>: "Errer:"
&
Err
C
" "
C
Err-Description
Uziriad I d e
E n d SUD
Scb Forrn-Resize ( 1
On Srror Resume Next
If Me.WinaowState <> 1 Then
qrdDataGrid-Height = M e - H e i g h t - (425 + picButtons.Heignt)
End If
E n d Sub
Privare
As Integer)
I f MsgBox("De1ete Current Row?", vbYesNo + vbQuestion) <> vbYes
P r i v a t e Sub grdDctaGrid-BeforeDelete(Cânce1
Then
End
Câncel
If
=
True
Lrivate Sub grdDataGrid-EeforeUpdate(Cance1 As Integer)
If MsgBox("Commit changes?", vbYesNo + vbQuestion) <> vbYes Then
Cancel = True
End If
Snc Sub
--ri-~oïeSu5
grdDataCrid_HeadClick(ByVa1 ColIndex As Integer)
'let's sort on this column
If Dotsl.RecordsetType
=
vbRSTypeTcDle Then E x i t Sub
'cneck for the use of Che c r r l key for descending s o r z
If ribCtrlKey Then
nsSortCol = " [ " & Daïal.Recoraset (ColIndex).Name & "1
:
mbCtrlXey = O 'reser i
desc"
Else
mssorrcol = " f " C Datal-Recordset(ColIndex).Name
ZnC! If
c~dSorc-Click
nsSortCcl = vbKullString 'rîset ir
&
"1 "
Sna S u b
2 r i ~ a t eSu8 çrSCataGrid-YousêUp
>: .a.s Sinole, Y. As Single)
Zr.a
mbCtrlKey
Sub
=
(Button
-2-s I n t e q e r ,
Shift As Integer, -
Snift
Source Code for fnndgPartPlanOp.frm
*b'ZXSION 5 . 0 0
ODject = " { G 0 0 2 5 C 0 1 - 0 0 0 0 - 0 0 0 0 - 0 0 0 0 - 0 0 0 9 0 G 0 0 0 0 4 6 } 1 0 0 ;
Seqin VB. Forn f rmdgPartPlanCp
ClientEeionï
=
4590
ClientLeft
=
1650
=
1545
ClientTop
ClienrWiath
=
6150
-orrnl "
,c
LinkTopic
ScaleHeignt
=
4550
ScaleMode
=
O 'User
ScaleWicith
=
6150
3eqin Va.PictureBox picButtons
Align
=
1 'Align Top
Appearance
=
O
'Flat
=
O 'None
BorderSt yle
Forecolor
=
cHô0000008&
Height
=
330
=
O
Lef c
fl
"DBG3ID32.0CXW
ScaleHeight
=
330
ScaleWidth
=
6150
TabIndex
=
1
TabStop
=
O
'False
=
O
TOP
Widtn
=
6150
3 e g i n VB.CornmandButton c a d C l o s e
"&Close"
Capt i o n
Eeight
=
330
Left
=
4398
TzbIndex
Tôg
Top
=
-
5
"&Closer1
=
=
O
1437
Width
Enu
S e g i n VB.ComrnandButton c n d F i l ï e r
"&Filter"
cgpr ion
Seight
330
=
2524
Left
îabi n a e x
=
4
"&Filter"
Tag
=
O
Top
Width
=
1462
-~ n d
B e c i n VB.ComrnandButton crndSort
l ' C s ~ r ~ l l
Câption
Yeighï
=
220
=
1-62
Left
4
Ta~Inaex
=
Tao
-
op
=
r?
L
-= n a
d
3
"CSort"
O
1462
W i O t P.
=
Zna
S e g i n Va.ComrnandButtcn c n c R e f r e s n
"i3efresh"
Cacticn
EeFghr
=
330
=
O
Left
TabIndex
=
2
"C?.efresh"
Tag
=
O
Top
=
1462
Width
End
B e g i n V B . D a t o Data1
Czption
Cormec:
DarabdseMame
DefaultCursorType=
=
DefaultType
Exclusive
=
iieight
=
Left
=
=
Options
ReadOnl y
=
RecordsecType
=
RecordS~urce
TOP
=
llilâtâL'l
" A ~ ~ e ~ ~ "
1llI
O
2
O
'DefaulcCursor
"u'seODX
'Fâlse
300
2505
O
O
'False
1 'Dynaset
1'
11
2175
Visibie
Width
O
-
-
'False
1140
Znd
Begin MSDEGrid-DBGrid grdDataGrid
I ' A l i g n Top
Align
"frm~gPartPlanOp.frx":OOOO
aindings
Height
3645
O
Left
"frrndqParï?la~Op.frx'~:OOCE
OleObjecrBlob
=
TâDInaex
O
-C p
L
Widïh
-~
-
330
6150
zr:c
n d
.L.ttrinute V9-M a n e = "f,rmdgParti?lànOp"
Aïtribure VI3-GloDalNameÇpace = False
-L-= t ,,
;
,c
fi
~e
I l 3
Createble = Fslse
Attrihuîe VE -Predeciaredid = T r ~ e
Actrinü~eVB-Exposed = False
Option Explicic
-
D i n gsdarabase As String
D i x gs~ecorasourceAs String
Cin msSorîCol As String
D F n aDCtrlKey A s Integer
S L cmdClcse
~
-Click!)
End
ünload Me
Sub
Privete Sub cmdfiltte-Click0
On Crror GoTo LiltexErr
rec3eccrdsecl As Recorcset, recRecordset2 As Recordseï
Cin sFilterScr As Strinq
DFm
If
XecordsetType = vb3STypeTzDle Then
aeep
MsgBox "You Cannot Filcer a Table Recordset! ", 48
Exit Sub
E n c If
Datal.
Set recRecordset1
'copy t h e recordset
=
Datal.Recordset
sFilterStr = InputBox("Enter Filter 2cpression:")
If Len(sFi1terStr) = O Then Exit Sub
Screen-HocsePointer = vbHourglass
recRecordset1. Filter = sFilterStr
Set recRecordset2 = recRecordset1.OpenRecordset(recRecordsetl.T~e)
'estâblish the filter
Set Dstal.Recordset = recRecordset2
'assign back to original recordset object
Screen.MousePointer
Esit Sub
vwCefault
=
FilterErr:
Screen.t.iousePointer = v~Default
MSCJEOX "Errer:" & Err &
& Err.Description
End S u b
2riïaie Sub cm8Refresh-C l i c k
On Error GoTo RefErr
()
Exit Sub
.--
Sub cmcisort-Click ( !
On trror GoTo SortErr
Z
,r < ,cte
A
A
Dix recRecordset1 As Recordset, recRecordset2 As Recordsec
Dim SortStr As Strinq
If D a t a l
Seep
.RecordsetType
= vS3ST'ypeTcble
Then
MsqBox "You Cannoi Sorr a Table Recordset!", 48
Z:.:it
SUD
E n d If
Sec
recReccrdset1
=
Doial-Xecordsec
' c o p y rne recoraset
If L e n (nsScrrCo1) = O Then
SortStr = InputBo:~("Enc~r
Sort Column:")
If Le5 (SorcStr) = O Then Exit Süb
-~ l s e
Eric!
SorrStr = msSortCol
If
Screen-MousePcinter = vbHourglsss
recR~coraseïl.Sort = SortStr
'establish the Sort
Set recRezordset2 = recRecordsetl.3penRecordset(recRecordset1.Type)
Ser Dacal.Recordset = recRecordset2
Screen.C4ousePointer
E x i t Sub
=
vbDefault
SortErr:
Screen.MousePointer = vbDefault
M S ~ B O X"trrcr:" & Err & " " & Err.Description
End SUD
Privace Sub Forrn-Load (
D ~ K bParmQry
L
As Integer
Dim qdfTrnp As QueryDef
On Error SOTO LoadErr
'Ta Do
'gs9atabase is a global string that needs
'ro be set b y t h e startup ç u b for ïke app
Dàtal.DatsDaseName = gsaatcbase
'gsRecordSource is a global string that necds
' r c 5e set S y the sub routine that Loads this forrn
3 a ~ a l . ? . e c s r d S o c r c e = gsi?ecordsourc?.
' dynaset
DztoI.RecorasetType = I
Datai.Cptio3s = O
Dzïai. Refresh
If Len(DataI.RecordSource) > 50 Then
Me. Caption = "SQL Statenent"
Else
Me.Ca?tion
End
--
Datai.RecordSource
=
LI
LoadErr :
Xsq30u "Errer:"
&
C r r L
"
"
L
Srr.Description
LJnloab Xe
5 n c Scb
Drivate 5 x 8 Forx-Resize ( 1
On Error Resume Next
If M~.WindowStcte<> I Tnen
orlDaraGrid.Heighr = M ~ . H e i q h ï - (425
EnC If
cr!a
+
picButcons.Heignt!
Scb
Private Sub grdDataGrid-BeforeDelete(Cance1 A s Inteqer)
If MsqEoflDelete Current Row?", v b Y ~ s N o t vbQuestion) <> vbYes
Then
Cancel
Enc! If
=
True
Znci S u b
?rivate Sub g r d D a t a G r i d - B e f o r e U + e ( C a n c e l
As Integer)
I f WsqBo:~("Cornmit chafiges?", -ibYesNo + vbQues~ion)o vb'fes Then
Czncel = True
End If
End Süb
Pri-zate Sub grdDataGrid-HeadClick(ByVa1 ColIndex As Integer)
'let's sort on this column
I f Datal.RecordsetType = v b R S T y p e T a b l e Then Exit Sub
'check for the use of the ctrl Xey for descending sort
If mbCtrlKey Then
rnsSorïCol = " [ " & Datai. Recordset (ColIndex).N a m e & " j desc"
mbCtrlKey = O 'reset it
Else
nsSorcCol = "[" G Datal.3ecordset (ColIndex).Nane
End if
cmdSort-Click
msSorïCol = vbNullString 'rose+ iï
&
"j
"
End S u b
P r i v ô ï e Sub grcDataGrid McuseUp(auïcon .z.s
:< A.s Single, -f As .Singre;
-
-
mbCErlXey
.
nn
-.-A
=
Inteçer, Shifc As Inteqer, -
Shift
CIL^
Source Code for frmdgPartPlanOpMC.fmi
*JZ?SION 5 . 0 0
Cbjecz = "{OC028COI-0000-0000-0000-000000000046~00";"DBGRID32.0CX1*
aeqin V9.Form frmdgPartPlznOpMC
C1FentSeiqhz
=
4590
ClientLeft
=
1650
1545
ClientTop
Clientwidth
=
6150
1' Forrnl"
LinkTopic
=
4590
ScaleHeight
SceleMode
=
O
'User
ScâleKidZh
=
6150
3egin VB.FicrureBox pic3uttons
Al ig n
=
1 'U1Lqn T c p
Appear~nce
=
0
'Flac
BorcerStyle
=
O
'Nane
ForeColcr
=
&H8000C008&
Zeight
=
330
=
O
Left
ScâleHeiqht
=
330
Scâlewidth
=
6150
TabInde:.:
=
1
TabStop
=
O
'False
=
O
TOP
Widch
=
6150
aegin VB.CommandButton crndclose
"&Close"
Caption
Height
=
330
Left
=
4398
TabIndex
=
5
-
-
Tsg
=op
"&Closew
O
1437
=
Width
=
End
E e g i n V a - C o m a n d B u t t o n cmdFilter
Caption
"& F i l
ter1'
Seignt
=
330
Lef t
=
2924
TabIndex
=
4
-
9
-
"&cilter"
Top
=
3
1462
la
-a n cWidth
&gin
=
V B . C o m m a n d B u t ~ o ~c n d S o r t
"~SOIC~"
Caption
Eeiqhc
=
TaDInaex
Te9
=
=
-
T e F r
---
Top
330
1462
3
"&Sort'*
O
1462
=
=
Width
End
3 ê g i n VB. CorrmandBut'con
Caption
Heiqht
=
Lsfc
=
TâbInOex
"CXefresn"
33G
O
=
2
"&i?efresh"
O
=
1462
=
-
Tag
Top
Width
cmdRefres3
d
End
Snci
3 e q i n VB-Dôta Datâl
Capiion
Connect
DctobaseN~rne
D e f âultCursorType=
DefaultType
=
S:~clusive
=
"Dâtol"
"F..ccess"
11 II
O
2
O
' C e faulcCursor
' EseODBC
''clse
Iieiqht
L e £c
=
300
=
2505
Options
ReadOnl y
RecordseïType
XeccrdSource
Top
C'isible
Piidth
=
=
O
O
=
I
-
'False
'Dyndset
11 11
=
2175
O
'False
=
1140
=
Ena
3 e q i . n i-SDBGrid. DBGrid g r c D â t â G r i d
=
1 ' S - l i g n Top
Aligri
Bindings
"frmdqPartPlanOpMC.frx1':OO0O
Height
=
3645
Left
OleObjectBlob
TabIndex
To?
=
=
=
=
O
"frmdgPartPlanOpMC.frx1':0OCE
O
330
kïidrh
=
6150
End
Enc
VB Wame = "frmdgPârtPlanOpMC"
Artribute ~ ~ I ~ l o b a l ~ a m e= ~False
~âce
$-itribuYe VB-Creatable = False
r3
y-;c,Lbute
VB-FredeclâredIc = True
Atïribuce VB-Zxposed = F a i s e
03cion Explicit
7
C
C
3im qscccabaso As Srring
DFm qsRecordsource As String
D i n irissortCo1 P-s String
D i x xbCtrlKeÿ As I n t e g e r
Privcre Sub cndfilter-C l i c k 0
On Zrror GoTo FilterErr
D i m recRecordset1 As Recorcset, recRecordset2 As Recordset
Dim sFilterStr As String
I f Ddial.RccordsetTy-e = vbRSTypeTcble Then
Eeop
MsqBox "You Cannot Filcor a Table Recordset!", 48
%:iï S U D
Z n 8 If
' cûp:;
Set recRecocdsetl = Da~al.Recordset
c h e reccrdset
s F i l t e r S t r = InputBo:<("Enter Filter Expression:")
I f Len(s7ilterStr)
=
O Then E x i ï SUE
Screen.MousePointer = vbHourqlass
recRecordsetl.Filter = sFilcerStr
S e = recRecordset2 = recRecordsetl.OpenRecordset(recRecordseC1.Type~
'ests~iishthe filter
Set D a t a l .Recordset = recRecordset2
'âssign B a c k to original recorcset object
Fil ïerErr:
Screen-MousePointer = v b D e f a u l t
!4sgBo:~ "Error:" & Err & " " G Err-Description
End S u b
P r i ~ ~ a tSub
e
cmdRefresh-Click ( 1
O n Error GoTo RefErr
Exit Çub
Re fErr :
Msgaox "Error:"
&
Err
" "
&
&
Err-Description
E n d Sub
Privcie Sub cmdSort-Click ( )
3 n Error CoTo SortErr
Din recRecordset1 As Recoraset, recRecordset2 As Recordset
Gim SortScr As String
If Datai.RecordsetType
=
vcRSTypeTonle Then
Beep
MsgBoz "You Cznnoï Sor:
Exii SUD
End If
Set recoecordsetl
' copy the recordset
=
a Tabie ?.ecordsec!",
48
Daial-Recordset
If Len (msScrtCo1) = O Then
SortStr = InputBox!"Enrer Sort Column:")
If Len(SortScr) = O Thon Exit Sub
-Lise
-
SortScr
=
msSortCol
E n d If
Screê~.MousePointer= v~Eourglass
recRecordseïl.Sorï = SortStr
' ~ s ~ G D ~the
F sSort
~
Set recRecordset2 = r e c ~ e c o r d s e ~ l . 0 p e n R e c o r d s e t ( r e c R e c o r ~ s e t ~ ~ T y p e )
Set Dâtâl.Recor8set = recRecordsec2
SortErr:
Screen.MousePointer = vbDefdult
& Err i " " & Err-Description
MsqBo:< "Error:"
ERC Ç u b
Privace Sub Forrn-Load ( )
Cin bParmQry As Integer
3 i m qafTrnp .&s QueryDef
gsdatabase = "C:\THESIS-WORK\SOLVER\OA.h.IDB"
gsRecordsource = "PartPlanOpMC"
On Error GoTo LoadErr
'To Do
'qsDatabase is a global string that needs
'Co be set by the startup sub for the a p p
D6tal.DatabzseName = gsdatabase
'~sRecorcSourceis a glooal string chat needs
'CO j e sec Dy the sub routine that loads this form
Dâîsi.RecordSource = gsR~cordsource
Dccâi.RecordsetType = 1
'aynaset
D ~ C à i . O p t i o n=
~ 0
Dora l .R e f resh.
If Len(Daczl.RecordSource) > 50 TRen
Me. Capcion = "SQL Stâtezen~"
Zlse
= Dacal-RecoraSource
-L R M~.Cap:ion
~If
LoccErr:
"Error:"
Unload Me
% n a Süb
MsgBo:.:
&
Err
&
"
"
&
Zrr-Description
?rivote SUD Forrn-Resize ( 1
O n Error Resune Next
If Me.WindoviStaïe <> I T h e n
Snc Sub
?rivaCe SUS g r a D a t a G r i d - E i e f o r e U p d a t e ( C a n c e 1 As Integer)
If M s c ~ B o x( "Commit chânges?", vcYesNo
vbQuestion) <> vbIes TRen
C a n c e l = True
F n- d If
-.
E n 0 Slib
-
? r i - ~ c ï eSub qraDataGria-HeadClick(ByVal
Collndex As Integer)
'lei's sort on this colninn
If Dotal.RecordsetType = vbRSTypeTable Then Exit Sub
'check for c h e use of the ccrl key f ~ descending
r
sort
If .nbCtrlKey Then
msSortCol = " [" c D a t a l . Recordset (ColIndex).Name h " 1
mbCtrlKey = O 'reset ir
desc"
Else
rnsSortCol = "[" & Datai.Recordset(ColIndex) .Name
Erid If
crndSort-Click
nsSortCc1 = vbNullScring 'reset it
&
"1"
End Sub
P r i v a t e Sub graDataGrid-MouseUp ( B u t t o n Pas I n t e g e r ,
:< As S i n g l e , Y A s S i n g l e )
mbCtrlKey = Shift
E n c i SUD
S h i f t As Integer,
-
Source Code for fmdgParts.fnn
VERSION 5 . 0 0
O b j e c c = "{00028C0i-0000-0C00-0000-000000000046}#00; "DBGRID32.0CX1'
3 e q i n VB. F o m f-rmdgParts
ClientHeight
ClienrLef t
ClientTcp
=
=
=
=
6810
1650
1545
ClientWidtn
7380
9' FOrm l 'l
Lin kTopic
ScaleHeight
=
6810
ScaleMoae
=
O
'Zser
ScaleWicth
=
7380
B e g i n VB.PictureBox p i c B u t t o n s
t = ~ l g nTop
1 ""
A l ign
Appearance
=
O
'Flat
BorderScyle
=
O
'gone
=
&H!30000008&
Forecoior
Heighc
=
330
Left
=
O
ScaleEeiqht
=
330
ScaleNiaih
=
7380
1
TzDIncex
TabStop
=
O
'False
L op
=
O
Wicith
=
7380
B e g i n VB.ComrnandButton cmdClose
"&Close"
Caption
Height
=
330
4398
Left
TsbInàex
=
5
"&Close"
Tag
=
O
TOP
Width
=
1237
C1
Enc
B e c i n Va.CommandButton c m a F i l t e r
Caption
"&Filter"
Height
=
330
Left
=
2924
TabIndex
=
4
"C F i l t e r "
Tag
TOP
=
O
Width
1462
=
Erid
B e g i n VB.CommandButton
Caption
Heiqnr
=
Left
=
TzSIndex
=
Tag
F,
i OP
=
Width
=
End
a e q i n V5.CommanbButïon
Caption
iieiqhc
=
Left
TabIndex
Tog
Top
-
crncRefresn
"CRefresh"
330
O
2
"&?.efresk"
=
O
=
=
-
Width
cndSort
"&Sortw
330
1462
3
"&Sortm
O
i462
1162
-
End
- -,c
-
d
B e g i n VB. D a i s D a t a 1
Caption
Connecc
Data~aseName
DefaultCursorType=
DefaülcType
=
Exclcsive
=
ueight
=
Lefï
=
OpEions
=
"~~t-1"
"Access"
II 1;
O
'DefaultCursor
2
'VseODBC
O
'Folse
345
2505
O
ReadOnly
=
o
RecordseïTpe
RecordSource
=
1
ToF
=
Visible
Widih
=
=
-
nr z l s e
'D!;naset
11 II
2175
O
'Calse
1260
End
9egin M S D E G r i d - D B G r i d q r a D a t é G r i d
I ' A l i q n Top
A li g n
Ziridirigs
" f r m a q P ô r t s . fr x " : 0 0 0 0
Heignr
=
3645
=
O
Lfft
OleOb j e c t B l o b
=
" fr r n d q P a r t s . f r x " : OOCE
TâbIndex
=
O
Top
Width
=
=
330
7380
Enci
C,d
ï i t t r i b u t e VB-Name = "frmdgParrs"
A t c r i b u t e VB -G l c ~ a l N a m e S p a c e= F a l s e
A r t r i b u t e VB-Creatable = F a l s e
A r t r i D u t e VB-PredeclaredId = Trüe
A t t r i b u t e VB-Exposed = F a l s e
Option Explicit
Dirn g s d a ï a b a s e A s S t r i n g
D i m g s R e c o r ~ s o u r c eA s S t r i n g
D F m nsScrtCol A s String
Dira r n b C t r l K e y As Integer
Su3 cmdClose~Click0
ünload M e
Enci S U D
Enc S U D
C r i v a c e SUD cndlilter-Click ( )
On Error GoTo FilterErr
Din recRecordset1 As Recorcsec, recRecordset2 As Recordset
DFm sFilCerStr A s Strinq
Beep
MsgBox "You Cannot Filier a Table Recordset! ", 48
E x i ï Süb
If
Set recRecordset1 = Dâtal.Recordser
recordset
' C G ~ Ythe
InputBox ( " E n ï e r Filter Ixpression:" )
If Len(sE'FlterStr) = O Then Exit Sub
sFilterStr =
Screen-MoüseOointer = vbHourglass
recRecordsetl-Filter = sFilterStr
Set recRecgrCse~2= recRecordsetl.ûpenRecoraset(recRecordset1.Type)
' e s t s b l i s n the f ilter
Set D a c a l . 3ecordset = recRecordset2
'ossiçn bdck to original recordset abject
Screen.MocseCointer
Exit S u b
=
vbDefcult
-~ -~ L i e r E r r :
Scrren.MousePointer = vbDefcult
EISCJBOX "Errer:" & Err t " " C Err-Description
Znd S c b
?ri-~cte
Sub cmaRefresh-Click
O n Error GoTo RefErr
EiefErr:
MsgBox "Error:"
End Sub
&
Err
&
()
"
"
&
Err.Description
Brivate S L cmdSort-Click0
~
On Error GoTo SortErr
Dim recRecordseC1 A s Recorcset, recRecordset2 As Recordset
DFm SortSïr A s String
If Dctai.2ecorasetType
vbRSTypeTâble Then
=
Beêp
End
Msg9ox "You Cannot Sort a Table Flecordser ! ", 4 8
Exit Sub
If
Sec recRecoruset 1
=
Dacci. 3.ecordser
' c o p y Che recordset
If Len (msSorrCol) = O Tnen
SorcSrr = InputBox("Ezter Ç o r î Column:")
If Len (SortStr) = O Shen Exit SLD
Else
SortStr = msSortCo1
E n d If
'establish the Sort
recRecordset2 = r e c R ~ c o r d s e ~ l . C ~ e n R e c o r d s e t ~ r e c R e c o r d s e t I . T y p e )
Datal.Recordset = recRecordse~2
Sec
Ser
Screen.MoüsePointer = vbDefault
xçqaox "Errer:" & Err &
L Err.Description
II
l1
End Sub
Fri:.r~te
Sub Forn-loâd
()
D i m b9crmQry As Integer
Dim q c f T n p P.s QueryDef
qsastabase = "C: \THESIS-N09K\SOLVER\OA.MDB1'
gsRecordsource = "Parts1'
trror GoTo
'To Go
'gsDatabsse is a global string that needs
,O Se set by the startup S U D for the app
Datal.DatâbaseName = gsdatabase
'cjsRecordSource is a qlobal string t h a t needs
'CO be set by the sub routine tnat loads this form
Datal.RecordSource = çsRecordsource
'dynâset
Datal-RecordsetType = 1
1
C
If Len(Datal.RecordSource) > 50 îhen
bIe.Caption = "SQL Staterent"
ZLse
Ne-CsptFon = Datal.RecordSource
End If
SoccErr:
i4sg3ox "Lrror:"
Unload Me
&
Err
&
" "
&
Err. Description
Sna Su5
Cern-Resize ( 1
Zrror Resume Next
If Me.WFndowSta:e
c > I Then
grà3ataGrid.Heiqhr = P!e.Heiqnt - (425 + picButcons.Xeignc!
g n à If
3 n C Sub
r r r v c r e Sub
9
.
Cn
2 c i v a t z S U D g r ~ 5 D a t a G r i d - B e f o r e D e l e t e ( C c r ? c e lAs Inteqer)
If ?4sgBox("Deiete Currenï Zow?", vDYesNo + vbQuestion) <> vbYes
Then
Cancel
End I f
End Sub
?ri-;ore
=
True
S U D graDâtaGrid-Beforeüpdote{Cü~.c~l
As Integer)
vbQuestion) <> VD-Yes T h e n
If MsgBo:~( "Commit changes?", vbYesNo
Cancel = True
E n C If
s2c S u 5
- r. i v z z eS u b grdDatâGrid-EeadClick(ByVa1 ColInaex s.;
~
Integer)
'let's sort on this column
If Datcl.R~corasetTy~e
= -~bRSTypeTableThen Exit Sub
'cneck for the use of the c c r l Key for descending sort
I f niDCtrLKey Tnen
msSortCol
rnbCtrlKey
=
=
[ " & Datâl . Recorcset (ColIndex). Name
O 'reset ir
If
&
" ] desc"
&
"1"
Zlse
msSortCol = " [ " & Datal.Recor<seC(ColIndex).Name
End If
crnascrt-Click
rnsSorrCol = vDNullSïring 'reset it
Private Sub qrdDataGrid-MouseUp(Eutton As Integer, Shift As Integer, :-: As Single, Y As Single)
mbCcriKey = Shift
End S L L ~
Source Code for frrndgPlan.fm
V E 3 S I O N 5.CO
0 8 j e c t = " ( 0 0 0 2 8 C 0 1 - 0 0 0 0 - 0 0 0 0 - 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 4 6 ~ ~ 0 0 ~ ; "DBGRID32.0CX"
l e q i n V E - F o r m frrndgPlan
=
4590
ClientHeighc
ClientLeft
=
1650
ClientTop
=
1545
CliencNiach
=
6150
LinkTopic
"Fo-ml"
Scz1eHeiqhr
=
4590
ScaleMode
=
O
'User
0150
ScaleNicith
2 e g i n VB.PictureSox p i c B u t ï o n s
Aliqn
=
1 'AlignTop
=
O
'Flat
Appea r a n c e
=
O
'None
SorcerSty l e
Forecolor
=
&i!80000008&
Heiqht
330
=
O
Left
ScaleEeignt
=
330
ScaleWictn
=
6150
-1
TanIndejc
TabSrop
=
O
''alse
=
O
Top
2Jia:h
=
6150
S o c i n V 2 . C o m a n d B u t t o n cmdClose
"&Closew
Caption
=
33C
Seighr
4398
Left
TabInaex
=
5
"&Close"
Taq
L 03
=
O
1.37
Width
End
B e g i n VE.Co.mandButton c r n d F i l t e r
"&cilLer1'
Càpti0n
Yeighc
=
330
Left
=
2924
=
4
TabIndei:
"&Filt-r"
Tâg
-
Top
Width
=
=
O
1462
End
Begin Va-ComrnandButton cmCSort
Caption
Height
Left
TaDIndex
-
"&Sort"
=
330
=
1462
3
=
-
-
Tag
TOP
Widch
IV&Scrt"
0
=
=
1462
End
Begin VE3,CommandButton cndRefresh
"cRefresh"
Caption
Hoight
=
330
Left
=
O
TabInaox
=
2
"&X?fre=h"
Tao
=
O
Top
Vidth
=
1462
Er,d
Ena
VB.Caca Data1
Caption
-
5eqin
Cor.nerc
-
DatabaseNôme
DefaultCcrsorType=
=
Cefaul tTyce
=
E:.:clusive
=
Seiqiit
Left
Opt loris
ReadOnly
RecordsetType
RecordSource
'
=
=
=
=
-
"Datsl"
"&,"c~SS"
Il n
O 'DefaclïCursor
2 'UseOGBC
O
'False
300
2505
O
O
'False
i
'Dynâset
11~1
Tcp
=
2175
Visible
Nidt h
=
0
=
1140
* -ralse
End
aegin FSDBGrid.DBGrid gràDacâGrid
1 'Align TQ?
Align
1'frmcgPlan. frx" : 0000
Eindinqs
..
.
ze~qiit
3645
Left
=
O
OleObjectUlo8
TabInde:.:
=
=
"frrncqPlan. frx":00CE
O
330
6150
m
=
Nidth
=
L op
Enc
EnC
.-., ,ribute
V9-Fiâme
= "frmdqPlanV1
Artribuce VS -GlcbaiNameSpace = Calse
>-rtribute VB-Creatabie = False
.-.,,ribute VB-PredeclaredId = True
A i ~ r i b u ~VB
e -txposed = False
C p ~ i o nExplicic
-.cc
" . C C
3im gsdatz~aseAs Srring
DFm qsRecordscurce As String
D i r n msSûrtCol As String
Dim mDCtrlKey As Integer
Unload Me
End Su5
Lrivate Sub cmdFilter-Click0
On Lrror GoTo FilterErr
Dirn recRecordset1 As Recordset, recRecordset2 As Recordsec
Dirn sLiicerStr As String
If Dâral.R?c~rdsetType = vbRSTypeTable Then
Beep
MsqBox "You Cannot Filter a Tanle Recordset!", 48
Zxit Sub
End If
Set recRecoràsetl
=
Datal.2.ecordsec
sFilterStr = InputBox ("Enter Filter ?<pression:
Tf Len(sFi1cerStr) = O Then Exit Sub
")
Screen.MousePointer = vbHourglass
rccRecordsetf.Filter = sFilrerStr
Set recRecordset2 = recRecordsetl.OpenRecordset(recRecorasetI.Type)
' e s r s ~ l i s hthe filter
Sei Daïai.Recordset = recRecordsei2
'cssiqn ozck to original recordset objocr
-.
r
~1terSrr:
Screen.MousePointer = vDDefaült
MsgBox "Error: " & Err & " " & Err-Description
E z c Scb
O?.
SuD cmcRefresh-Click0
Zrror GoTo RefErr
Exit Sub
55fErr:
~/:sqBo:.:"Error:"
Tnd S u b
&
Err
?ri:;ate SUD crndSort-Click (
On Error GoTo SortErr
G
"
"
G Err.Descriprion
)
Dirn recRecordsetl As Recoraset, rec2ecordset2 As Recordset
Dirn SortStr As String
If Datal.RecordsetType = vDRSTypeTable Then
Beep
MsgBox "You Cannot Sort a Table Recordset!", 48
Ena
Exit SUD
If
Sec recRecordset1
'copy tne recordset
=
Dâtcl.Recordset
I f Len (msSorrCol1 = O Then
S o r t S t r = InputBox ("Enïer Sorc Column: " )
If Len (SortStr) = O Then Exiï Su8
Else
SortStr =
msSortCol
End If
' e s r a b l i s h the Scrt
Set recRecorbsei2 = recRecordsetl.O~enRec~)rd~et(recRecorcisetI.Type~
Sec Dotal.Recordset = recRecordset2
S ~ r r E r r :
Screen.MousePointer = vbDefault
XsqBox "Error: *' & Err & " " h Err-Descri-tion
5ri.a S U D
? r i - . ~ s ï eSub
Form-Load
()
DFm DParnQry As ïnceger
G i m q a f T m p As ÇueryDef
gsàatabase = "C:\THESIS-WORK\SOLVER\OA.MDB"
gs?.ecordsource = " P l a n s "
On E r r o r Go70 LcadErr
'To Do
'qsDâtâbase is a g l o b a l s t r i n g that needs
' 7 0 be set by the startup sub for rne app
Dctàl.DaiabaseName = gsdatsnzse
'gsRecordSource is a g l c b a l strinq t h a t needs
'ro be set by the sub routine thac loads this forrn
D a t s l .PecordSource = gsRecordsource
Da~zl.RecordsetType = I
' dyriasec
Deccl.Options = O
Datôl.Refres-h
If Len(Datal.RecordSource) > 50 Then
Me-Caption = "SQL Statement"
Else
Me.Caption
End If
Exit Sub
=
Datal.Recor8Source
Loadlrr :
MsgBox "Error:"
Unloâd Me
Ena S u b
&
Err
&
" "
&
Err-Description
Crivate S u b Form-Resize ( )
On Error R e s u m e Mext
If M~.WindowState<> 1 Then
qraDataSrid.Heighc = Me-Heignt - (425
E n d If
+
picButtons.Height)
C n a Sub
C r i v a ~ eS U D grcDataGrid-BeforeDelete(Cance1 As Intessr)
I f MsqBox("De1ete Current PGW?",
Csncel
=
vbYesNo + vbQuestion) < > vbYes
True
?rivars Sub graDâtaGrid-BeforeUpdate (CznceL P a s Integer)
If MsgBox ("Commit changes?", vbYesNo + vbQuestion) <> vbYes T h e n
Cancel = True
End If
Enci S u b
Privace S u b qraDâtaGrid-HesdClick(ByVa1 ColIndex 3-s Lnleger)
'lei's sorc on this colunn
If Decal.R~cordsetType = vD3SSypeTcble Then Exit SUD
for che us2
-L'check
I rnbCtrlXey Then
msSorcCol
rnbCrrlKey
of the crrl key for descending sort
= " [ " & Dcral.Recorcset(ColIndex).Name
= O 'resec i+
h
"1
&
"1"
aesc"
Else
msSortCo1
=
"["
&
Dacal. Recordset (ColIndex).N a m e
Znd If
cnaScrt-Click
nsSorïCol = v~NullString 'reset it
P r i u â t o S u b graDotaGrid-t.louseUp(Button
:-: P.s
Single, -Y .%s Single)
~ B C t r l K e y= Shift
ZRQ Sub
Source Code for frmdgWet.fmt
As Integer, Shift As Integer, -
VSXSION 5 . 0 0
Object = " { O O O 2 8 C O l - 0 O O O - O O O O - O O O O - O O O O O O O O O O 4 6 }
3egin V B . C o m frmdgWet
ClientHeight
=
4590
ClientLeft
=
1650
ClientTop
=
1545
Clientplidth
=
6150
LirkTopic
"Formln
ScâieHeignt
=
4590
ScaleMode
=
O
'User
ScaleWidtn
=
6150
3egin VB.PictureBox picButtons
i ' A l i g To?
Elign
Appeorance
=
O 'Flat
Borderstyle
=
O 'None
=
&U80000008&
Forecolor
330
iieighc
=
O
Lefc
ScaLeAeight
=
330
ScaleWiath
=
6150
TabIndei:
=
I
TaDS top
=
O
'False
i op
C)
=
O
Nidth
=
6150
Beqin VB.CommandButton
Capcion
Eeight
Left
TabIndex
i acj
ToWidth
m
r-.
n.C
Segin Vi3.CommanaEutcon
Ccpt ion
Eeight
Left
TabInaex
Tag
Top
Width
End
Segin VB-CommandButton
Cap*c l 0 2
Height
Left
TabLndex
Tag
Top
Ilidth
tna
Begin VB.CommandButton
Caption
Height
Left
TabIndex
'
cmdRefresh
"cRef resh"
330
O
2
#
0 0 ' ; "DBGRTD32 .OCX1'
Top
Wicit h
End
End
Segin VB.Data D a t a l
Capt ion
Connect
DatabaseName
DefzultCursorType=
DefâultTtlpe
Exclusive
Heiqht
Lefï
loris
Opt'
3eadOnly
3ezordsetType
=
?.eccrcSczrce
Top
-
VisiDle
Piidch
rnd
Begin MSDBGrid-DSGrid
P.1 ign
Bindings
Height
"Datal"
"P.ccess"
Il 1
'
O 'DefaultCursor
2 ' UseODBC
O
'False
300
2505
O
O
' t-alse
1 ' Dÿnaset
'f
11
2175
O
'false
1140
7
d
Left
-
O1eOb j ecrBlob
TabIndea
=
-
? O
,:
Ilidch
ZnC
-
End
D i x qsdstabase As String
D i n gsRecorcsocrce As S t r i n q
rnsSorcCol As Strinq
Cir. mbCtrlKey As Integer
Dim
Sub
cmdClose-Click ( )
Unload Me
Er?d Sub
r r i v o c e Sub crndFilter Click ( )
On Error GoTo ~ i l t e r ~ r r
Dim recRecordset1 As Recordset, recRecordset2 A s Recordset
Dim sFilterSrr A s String
Beep
MsoBox "You Cannot Filter a Table Recordset ! ", 48
Exit Sub
End If
Set recFtecordsetl
'copy the recoraset
=
Datal-Recordsec
sFilterScr = InputBox("Znter Filter Expression:")
If L-n(sFFlterStr) = G Thec Exit SUS
Screen-MousePointer = vbRourglass
recRecordsecl.Filter = sFilrerStr
Set recRecordser2 = recRecordsetl.OpenRecordset(recRecordsetI.Type~
'esrcblisn the fiiter
Set 9a~ôl.Recordset= recRecordseï2
'zssign câck r o originzl recorcset ~ b f o c t
Screen-MousePointer
sue
=
vbDefault
r..;
e
,*..AL
-.
:iLterZrr:
Screeri-PIocseFointer = vDDefault
XsgBox "Error:" & Err 6 " " C Err-Description
Z n d Srib
?rivate Sub cmaRefresh-Click0
On Error GoTo RefErr
.Exit Sub
RefErr:
EsqBo:-: "Error:"
Zr?.a Suk
&
Err
C
" "
&
Err.Description
?ri-.rcîe Su8 cmdSort-Click ! )
On Error GoTo SorcErr
recRecordset1 As Rscorciser, recRecoraset2 As Recordset
Din SortStr As String
9im
If Dacol. RecordsetTlfie = vbRSTypeTable Then
aeep
MsgBox "You Cannot Sorc a Table Recordset! ", 48
E x i t Sub
E n a If
Set recRecoraset1
the recordset
=
Dâtal.Recordset
'copy
If Len(msScrtCo1) = O Then
SortStr = InputBox("Enrer Sort Column:")
If Len{SortStr) = O Then Exit Sub
Else
SortStr
End If
=
msSortCol
Screen.MocsePoincer = vbHo~rglass
recRecordsêt 1. Sort = SortSt r
' e s t a ~ l i s h che Sort
Set recRecordset2 = recRecorcsetl.OpenRecordset(recRecordse~1.Type)
Set Datàl.3ecordset = recRecordseï2
Screen.MousePointer
- .
5 x 1t
=
vDCefzult
süo
Private Sub Fcrn-Load ( )
Dim bParmQry As Integer
Dim qdfTmp As QueryDef
gsdatabase = "C:\THESIS-WORK\SOLVER\OA.LIDB"
qs2ecordsource = "W-et"
On
Zrrcr Goïo LoâdErr
'?'O DO
'cjsû~tô8zseis a glonal string c h a t needs
'+O
b? set by ïne startup S U D for che zpp
Dccal . DatebeseNâme = gsdatabase
'gsRecordSource is a global scrinq chat needs
'to be set b y the s u b roucine chat loads rhis form
Datai.RecordSource = gsRecordsource
Dâtcl . RecordsetType = 1
'dynaset
Datal.Options = O
D a t a l . Ref resh
-1: -.
Len(D~cal.RecordSource)> 50 T h e n
Ne.Ca-cion = "SQL Sïctenent"
Lise
Xe-Capïion
End If
Datâl.RecordSource
=
LoaciErr:
MsqEox "Error:"
Unload Me
&
Err
&
" "
&
Err-Description
Ena Sub
Private Sub Form-Resize ( 1
Or, Error Resume Next
If Me-WindowState <> 1 Then
gtaDatâGrid.Height = Me-Height
End If
-
(425 + picButtons.Height1
PriveCe Sub grdDataGrid-BeforeDeIete(Cance1. A s Integer)
If MsgBox("De1ete Current Row?", vbYesNo + vbQuestion) <> vbYes
i fien
Cancel = True
End If
Enci Sub
m.
? r i v o t e Sub grcCataGrid-BeforeUpàaic;(Cânce1 As Integer)
If MsgEox ("Commit chanqes?", vb-fesNo vbQuestion) <> vbYes Then
Cancel = True
-
End If
End Sub
P r i v a c e S U D grdDâtaGrid-HeâdClick(3yVa.i Collndex As Integer)
' ;et'
- s _cor-, on this col:lrnn
If Datai-RecordsetType = v S X S T y p e T z S i e Then Exit Çub
A
'check for the use of tne ccrl k e y for descending sort
If mDCtrlKey Then
= " [ " & Datal.Records~t(ColIndex).Nanie & " 1
mDCCrlKey = O 'reset it
msÇortCcl
51se
msSortCo1 = " [ " & Datal.Recordseï(ColIridex).Name
End If
crnbSorr-Click
nsSorCCol = vbNullString 'reset ii
F r i - ~ a c eSxb grdDatâGrid-MoüseUp(Button
x ?s Sinçle, 3' As Single)
ri-.bCcrlKey = Shift
&
desc"
"1"
As Integer, Shift As Integer, -
,-.
=na S u b
Source Code for frmdgWhhe.frm
.I5fi.SION
.- abject
5.00
= "{0002aC01-0000-0000-0000-000000000046):100";
L e g i n VB. Form frmdgwhhe
ClientHeight
ClientLeft
ClieniTop
ClientWidth
LinkTopic
ScaleHeignt
ScaleMode
ScaleWicith
=
=
=
4590
=
6150
"Forml"
4590
O 'User
=
=
=
1650
1545
6150
"DBGRID32.0CX1'
Begin Va.PictureBox p i c B u t t o n s
Align
=
1 'AlFgnTop
=
O
'Flat
Appearz~ce
Borderstyle
=
O
'None
Forecoloc
=
&H80000008&
Heiqhr
=
330
Left
=
O
ScaleHeight
=
330
SccLeWicith
=
6150
i
TabIndex
TabScop
=
O
'Calse
=
O
Top
Siicit h
=
6150
B e q i n V3,ComrnandButton c x d C l o s e
Càption
"&Closew
3eiqhr
=
330
T
,
Cc
le L L
TabIridex
Tag
iop
Width
-
=
4398
=
5
-
"CClose''
O
1437
=
-
Ena
S e q i n VB.CornmandButcon cmaFiiter
Caption
"&Filter"
Heiqht
=
330
Lefr
=
2924
iâ ~ I r i a e x
=
4
"&"ilter"
Toq
=
O
Top
'didth
=
1462
End
B e c i n VB.CominandButcon cmdSorr
Czption
"&SorCW
z. e i g h t
=
330
Le f i
=
1462
TabIcdex
=
3
"&Sort"
Tàq
FI
+
.
Top
P l i c i %h
O
=
=
1462
End
B e c i n VB.CommandButton
Caprion
Height
=
Left
=
TabIndex
=
lag
m
Top
Width
=
=
crnaRefresh
"&3efreshW
330
O
2
"~Refresh"
O
1462
End
End
B e g i n V3.Dara D a t a 1
Capt i o n
Connect
DatabaseName
DefaultCursorType=
=
Defaul tType
Exclusive
=
"Datai"
"ACC~SS"
l? "
O
2
O
'DefaultCursor
'UseODBC
'False
CO
w'
5
-.
1J
a,
II)
Tl
L4
O
U
a,
d.
9,
4
.n
(0
P
m
k
U,
1J
r{
.r c
G A :
0
tu
m o t
0 V ) W
c,
O
c
C
m
U
3
+O
: a
3
>: w
O
Screen.PIousePointer = vbHourglass
recRecordseïl.Filter = sFilrerStr
Set recRecordset2 = recRecordsetl.OpenRecordset(rec~ecRecordset1.T~pe)
'estzblish the filter
Set Datal.Recoraset = recRecordset2
'assign back to original recordset onject
Screen.!4ousePointer
=
vbDefault
6:iic Sub
Exit Su5
3efErr:
Xsgaox "irror:"
&
Err
&
" "
fi
Err-Description
Ena S ü b
P r i - ; a ï e S h crndSort-Click ( )
O n E r r o r GoTo SortErr
Dim recRecordsetl As Recordser, rec3ecordset2 As Recordsec
SorcStr As String
DFm
1 f Dacal.R e c o r c s e t T y p e = vbRSTypeTzble Then
aeep
MsgEox "You Cannot Sorr a Table ?.ecordset!", 48
E x i t SUD
End If
Set recRecordset1
'cocÿ the recsrdset
=
Datzl.3ecordset
If Len (msSortCc1) = O Then
SortStr = InputBox("Enter Sort Colurnn:")
If Len(SortStr) = O Then Exit Sub
Else
SortStr = msSortCof
End If
Screen.MousePointer = vbHourglass
recRecordsetl.Sort = SortStr
'establisn the Sort
Set recR~ccrdset2= recRecordsetl.0penRecordset(recRecordsetl.T~e)
Set Datal.Recordset = recRecordset2
Exi t Sub
SorcEzr:
Screen.Mouse?ointer = v b D e f a u l t
MsqBox "Error:" & Err & " " & Err.!kscription
Ena Sub
Frivzte Sub Form-Lozd! )
Dim OParmQry As Inteqer
D i m qdfrinp P.s QueryDef
-
' io Do
' ~ S D S C ~ D Z Si ~s a giobâl s c r i n q thoz needs
'co be set D y the startup S U D for zhe app
Datal.DataDaseName = qsaatabase
'qsRecoraSource is a qlobzl string c h a t neeas
' C O be sec D y the sub routine that loads this fom.
Datal.RecordSource = gsRecordsource
'dynaset
Dâtal.RecordsetType = 1
Datal.Options = O
D a t s l . Refresn
If Len(Dsta1.RecorcSource) > 50 Then
Me-Caption = " S Q L Stacement"
Slse
Ena
Me-Caprion = Datal-RecordSource
If
LoadSrr :
ÀIISOBOX "Errer:" L Err
&
" "
&
Err.Descriprior?
gnloaa Me
Eric Sub
Privace S u n Form-Resize ( 1
On Error Resuae Nexc
I f Me-WindowState <> 1 Then
graDaroGria. Heigkt = M e . u e i g h t - (425
E n d If
t
picButtons. H e F q h t )
E n C SUC
Privsra Sub grcDataGfid-BeforeDeIete (Cance1 As Integer}
I f !4sgBox("Delete Current Row?", vbYesNc + vbQuestion) <> vDYes
Then
Cancel
=
True
E n d If
End Sub
Private Sub grdDataGrid-BeforeUpdate(Cance1 A s Integer)
If MsgEox("Comrnit changes?", vbYesNo + vbQuestion) o vbYes Then
Cancel
End If
End Sub
=
True
Frivàte Sub çrdDataGrid-HeadClicIc(ByVa1 ColIndex As Integer)
'let's sorr on this cclilmn
If Dâtal.P,ecordsetType = vbZSTypeTzble Then Exit SUD
'cneck for tne use of che ccrl key for descending sort
If mbCtrlKey Then
msSortCol = " [" & Datzi. Recordset (ColIndey,). Nâme & " 1 desc"
mbCtrlKey = O 'reser ir
Zlse
rnsSorîCol = " [ " & Datal. Recordset (ColIndex). Name
End I f
cadScrc-Click
zisScr~Col= vbNullStri2c 'reset it
&
"j
%na Sub
? r i v a t e Sub graDataGrid-MouseUp(3utton As Integer, S h i f t As Integer,
.v. As Sinçle, -f As Single)
nbCtrlKey
=
-
Shift
P r i a Sub
Source Code for frmdgWit.frrn
iiE2SION 5 . 0 0
= "{00028COL-0000-00GO-OOOO-OOOOOOOOOO46}l.O";
z e g i z Va. Form frmdgWit
Ojject
-
ClientHeight
ClientLefi
ClieniTop
CiientWiàth
Li~kTopic
=
=
4550
1650
=
1545
6150
ScâleHeighï
=
=
-
"Formi"
4590
O 'User
ScaieMode
=
=
6150
ScâleWidtn
Begin VB.PiciureBox picButtons
I
'Align To?
Align
Appearânco
=
O
'Flat
=
O 'None
Borderstyle
ForeCol~r
=
c480000008C
Aeiqht
=
330
=
O
Left
ScaleHeight
=
330
ScaleWidth
=
6150
TabIndex
=
1
TabStop
=
O
'False
"DSGRID32,OCX"
='op
=
O
Width
=
6150
E e g i n VB.Comrr.andButton
Caption
Heiqht
Left
TabIndex
Tac
'-,
I ûp
Wiaïh
End
S e g i n VB.CornmândButton
Caption
Hoighc
Left
TabIndex
-
-
-rzq
-
T ~ P
ifidth
-
End
B e q i n VB.Command~utcon
Càption
2eigb.z
Left
TabIndex
-
Tag
Top
-
-
Pliath
Er?d
Begin VB.ComandButton
Câption
Height
Loft
Tablndex
Tag
Top
'Ji
8 atk!
cnDRe fres n
"&,?efr e s h "
330
O
2
"bRef r e s n "
O
1462
Enc
End
B e g i n VB.Dâta D a t a l
Caption
Connect
DaisbaseName
Def â u l t C c r s o r T y p e =
Def â u l t T y p e
Exclusive
Eeight
Left
Options
ReadOnly
RecordsetType
=
RecordSource
A
Top
-
Visible
Width
-
-
End
B e g i n MSDBGrid-DBGrid
"Datal"
"P.ccess"
'1 I l
O
2
O
' DefaultCursor
'VseODaC
'False
3gO
2505
O
O
'Calse
1 'Dynaset
II ' 1
2175
O
'False
1140
Al ign
Bindings
iieight
Left
OleOb jectBlob
TabIndes
P
L
op
Widch
Znd
=
1 'AlignTop
"frmàgWit. frx" :0000
3645
O
'l frmagWit . frx" :OOCE
=
O
=
330
6150
=
=
=
=
Eric
.-- ibute Va-Nase
= "frmdgWit"
cr cri bute VE-GlobalNameSpace = Fslse
>-ttribute VB-Crestable = False
;.c~ri8ute VB-PrececlarecIc = T r u e
A c r r i b u t e VB-Ex-osed = False
C?:ion
Explicic
T C C Y
L,
Ilin osdatabase As String
D i r n gsRecordscurce As String
DFm rnsScrCCol As Scring
3 i ~ .mbCtrlKey As Integer
SUD cnaClose-Click()
Unlcaa Me
End Sub
- ~ r i u s ï tSUC cmdFilter-Click0
On
Error GoTo FilterErr
Dim recRecordset1 As Recorcset, rec2ecoraset2 As Recorasec
Dim sFilterScr As String
If Dzcal-RecordsetType = vbRSTypeTzble Then
Beep
MsqBcx "Ycu Cannot Filier a T o ~ l eRecordsec!", 48
Exit Sub
3nd If
Set recRecorasetl
=
Data1.Rerordser
' r o p y tne recordset
sFilterStr = 1nputBoxf"Enter Filter Expression:")
If Len(sFilterStr) = O Then Exit S u b
Screen.Mous~Pointer= vbHourglass
recRecordseïl.Fiiter = sfilierstr
Set recRecordset2 = r e c R e c o r d s e t l . O p e n R e c o r d s e t ( r e c R e c o r d ~ e t i ~ T ~ ~ p e )
'esta~lishthe filter
Set Datal.Recordset = recRecordset2
'assiqn back to original recordset object
Screen-MousePointer = vbDefault
Exit Sub
Screen.MousePointer = vbDefault
MsgBox "Error:" ti Err & " " & Err-Description
E n d Süb
Priïare Sub cmdRefresh-Click ( 1
O n Error GoTo RefErr
?.efErr:
MsgEox "Error:"
ZRC Scb
&
Err
&
" "
&
5rr.Description
S u 5 cxcSorr-Click ( !
On Error GoTo SortErr
?rri-,-a:e
Dim recRecordset1 As Recordset, rec3ecordset2 As Recordsec
3Lm SortStr As String
-Lr-
Datal.XecordsetType = vbRSTypeTâble Then
Beep
MscjBox "You Cannot Sort a Table Recordset!", 48
Exic Sub
End If
Set recRecordsetl
=
Dâcal.Zecordseï
'cspy ihc recordset
If Len(nsSortCo1) = O T h e n
SortSïr = inputBox("Encer Sorc Column:")
If Len(SorïStrj = O Then Exit S c 5
I s e
SortStr
=
nsSortCol
Z n C If
Screen.MousePointer = vbHoürqlass
recRecorbsetl.Sort = SortStr
'estâblish the Sort
Set recRecordset2 = recRecordsetl.GpenRecordset(recRecoraset1.T~ej
Set Dazal.2ecordset = recRecordset2
Scrern.Mousefointer
E x i t Sub
=
vbDefault
Screen-MousePointer = vbDefault
?4sqBox "Errer:" & Err & " " & Err.Description
End Sub
Private Sub Form-Load ( 1
Dirn bParmQry As Integer
D i m qdfTmp As QueryDef
asdatabase = "C:\THESIS-WORK\SOLVE4\0A.MDB1'
csRecordsource = "W -it"
On Error GoTo LoadErr
'To Do
'osDatabzse is a global string thoc needs
'to be set by the startup sub for the app
Datai.Data~~seName
= gsdatzbase
'~sRecorcSourceis a global strinq chat needs
' C O be set by the sub routine that loads this form
5atal.RecordSource = gsRecordsource
D a t â l . RecordsetType = I
' dynaser
Datzl.0ptions = O
Dütâl. R e f r e s h
If Len (Datcl.2ecordSource) > 50 Then
Me-Ccpcion = "SQL Statexent"
Zlse
Me.Caption = Datai-RecordSource
End If
LoacErr :
14sgEox "Error:"
Unload Me
E n d Sub
&
Crr
C
" "
&
Err-Description
-krivate
Snc
Sub Forn-Resize ( )
On G r r c r Resüme Next
If Me.WincowState <> i Tnen
graCâ~sGrid.Height = Me-i-ieight- (425 + picButtons.Eeiqhc1
E n d If
Süb
F r i r c ~ eSub qraDataGrid_BeforeDe1ete(Cancel As Integer)
If MsgSox!"Delete C u r r e r t Row?", vDYesNo
vbQuestion) <> vbYes
T
- .--..
-'"&"
Cancel
-m à
=
True
Snd If
Sui3
?rivate Sub grdDàtaGrid-BeforeUpdate(Cance1 As Integer)
If MsgEox ("Cornmit changes?", vbYesNo + vbQuestion)
Câncel = True
E n c If
End Sub
vb?es
Then
? r i v a c e Sub graDataGrid-HeacCLick ( B y V c I ColIndex A s Integer)
'let's sorï on this column
If Datal.RecordsetType = voRSTypeTable Then Exit Sub
'check for the use of the ctrl key for descending sort
If rrhCtrlKey Then
msSortCo1 = " [ " & Data1 .Recordset (ColIndex).Name & "1 desc"
mbCtrlKey = O 'reset it
Else
rnsSortCc1 = " [ " & Data1 .Recordset (ColIndex) .Name
n dI f
cmdsort-Click
icsSorECo1 = vbNullString 'rsset it
-~
P r i v a c e S u b grdDataGrid-MouseUp(Button As ï n t e q e r ,
x As Single, ï As Single)
rnbCtrlKey = Shift
S n c Scb
&
"1"
S h i f t As I n t e g e r ,
-
NAME:
Jorge Paulo
PLACEOF BIRTH
Vila do Conde, Portugal
EDUCATIOX
Kingsville District High School, Kingsville, Ontario
1990- 1994
University of Windsor, Windsor, Ontario
1994- 1998 B.A.Sc.
University o f Windsor, Windsor, Ontario
1998-2000 M.A.Sc.