Document not found! Please try again

Extracting Performance Parameters of a Citrus

0 downloads 0 Views 4MB Size Report
Dec 11, 2008 - Research and Education Center, Lake Alfred, Florida, ehsani@ufl.edu ...... Canvas.TextWidth(Grid.Cells[Column, iGrid]); if W > WMax then.
An ASABE Meeting Presentation Paper Number: 090035

Extracting Performance Parameters of a Citrus Mechanical Harvesting Machine from Yield Data Ramin Shamshiri, PhD student University of Florida, Department of Agricultural and Biological Engineering, Rogers Hall, 32611, Gainesville, Florida, USA, [email protected]

Reza Ehsani, Assistant professor Agriculturaland Biological Engineering Department, University of Florida, IFAS,Citrus Research and Education Center, Lake Alfred, Florida, [email protected]

Written for presentation at the 2009 ASABE Annual International Meeting Sponsored by ASABE Grand Sierra Resort and Casino Reno, Nevada June 21 – June 24, 2009 Abstract GPS systems and load cells are used widely in modern agriculture such as citrus yield monitoring. Traditionally farmers measure crop yield for whole field or for large sections. With the available modern technologies, high tech instrumentation and computer software it is possible to measure yield more specifically. Yield mapping is considered as the first step in precision agriculture and its purpose is to determine variability in the field. A citrus yield monitoring system usually records GPS and load cell data every second or less. This results huge number of data points in a harvesting season. After data are collected, they are sent to laboratories for interpretation in order to be converted to yield table which is then used in GIS software to create yield map. These yield maps reveal the harvested mass per unit area. Yield variability in citrus groves as shown in the yield map depends not only on agricultural and biological variables (such as soil nutrition and property) but also driver’s and machine’s performance. Farm machinery indexes play important roles in agricultural mechanization and technical managements especially during the busy pick periods when timing becomes an issue. Shortening machine operation time while keeping work quality is desired to produce optimum output. This can be done with predicting machine performances. The purpose of this project was to eliminate the procedure of sending raw yield monitoring output data to laboratory by designing a standalone computer application that can be used on the farm and is capable of calculating yield table, field efficiency, machine capacity and field machine index and observing driver’s performance using three simple steps.

The authors are solely responsible for the content of this technical presentation. The technical presentation does not necessarily reflect the official position of the American Society of Agricultural and Biological Engineers (ASABE), and its printing and distribution does not constitute an endorsement of views which may be expressed. Technical presentations are not subject to the formal peer review process by ASABE editorial committees; therefore, they are not to be presented as refereed publications. Citation of this work should state that it is from an ASABE meeting paper. EXAMPLE: Author's Last Name, Initials. 2009. Title of Presentation. ASABE Paper No. 090035. St. Joseph, Mich.: ASABE. For information about securing permission to reprint or reproduce a technical presentation, please contact ASABE at [email protected] or 269-429-0300 (2950 Niles Road, St. Joseph, MI 49085-9659 USA).

1.

Introduction For a GIS software to create a yield map, a yield table which contains yield information should be created first. Citrus yield tables are generated from huge raw GPS and load cell data. Extracting yield table from these raw data require expert persons and goes through a time taking procedure. In addition to that, yield data are also affected by driver’s performance and machine efficiency. For example, a reckless driver can spend much of the harvesting time on turnings, or stopped for breaks. Maintaining on a constant speed is sometimes very important for the farm operation which can also affect yield data. It is obvious that not 100% of the spent on field has been used for effective harvesting. Harvesting time or effective time of operation is the total time spent on field minus ineffective time (Turnings Th and stopped time Ta). Th and Ta both refers to two categories of unknown time that machine has spent on the field but no efficient work has been done. Generally this wasted time may include filling sprayer tank, fixing a disk or chisel plow setting, driver’s resting time, etc. Since larger theoretical field capacity of machineries leads to smaller effective times (Te), these wasted times become more critical in larger machineries. Machine effective and ineffective times are not fixed and vary from condition to condition (different machineries, different drivers, different field, etc). Precise determination of these wasted times together with the measurements of machine travel speed will provide accurate calculations of driver’s performance, field efficiency and machine capacities which leads to a better interpreting of yield map. Traditionally farmers measured crop yields for whole fields or for large sections, while modern technological advances permit farmers to measure yield more precisely. The procedure to create yield map in modern agriculture involves recording positions by DGPS, measure yield by measuring flow rate, area and moisture content. There are three different methods to measure crop yields, Collectand-weigh, batch-type yield monitoring and instantaneous yield monitors (different methods are measuring crop volume and weight the crop). Instantaneous yield monitor system measure and records yield on-the-go. Measuring process is continuous as the grain is being harvested. In this procedure, site-specific yield maps can be generated. For citrus yield mapping, flow rate can be measured using impact cells. Data are then analyzed and displayed as yield map. Instantaneous yield calculation:

Calibration included comparing known weights with actual yield monitor estimation, generate calibration curves, test over wide range of conditions, calibrating moisture sensor. Yield map can reveal yield variation across the field, Relationship between yield variations and soil type, fertility, weed, drainage, soil compaction, equipment malfunctions, etc. Effect of hybrids, seeding/fertilizer application rates, pesticide types and rates, etc. The main objective of this project was to design and develop a standalone computer application to calculate yield, field efficiency, machine capacities and field machine index from raw GPS and load cell output data of a citrus yield monitoring system. 2.

Materials and methods Information such as timing, latitude and longitude from standard NMEA ($GPGGA) GPS sentence together with load cell voltage was extracted in order to determine below parameters. Total number of data points, Total harvesting time, Total stopped time (ineffective harvesting time, area unrelated wasted time), Total turning time (ineffective harvesting time, area related wasted time), Total effective time (effective harvesting time), Total traveled distance , Total area covered , Average travel speed. These parameters were then used to calculate yield, field

2

efficiency, machine field and material capacity and field machine index. A schematic block diagram of the project is shown in Figure 1. Impact Plate (Load Cell) (Mass weight sensor)

DGPS Antenna

DGPS Receiver

Data analyzing software

Hardware interface (Amplifier, Signal conditioning, etc)

Power Supply Laptop computer Equipped with DAQ cards, interface software and programs GPS txt file Load Cell txt file

Yield table, Field efficiency, Machine capacity, Machine Field capacity, Machine Material capacity, Field Machine Index Figure 1: Schematic view of the project

2.1. Machine performance parameters Machine field or material capacity is the rate of operating a particular task, (i.e. tillage, planting or harvesting, etc) by a particular machine. Because of the high price of operating hour, agricultural machineries are usually designed for large field efficiency to be economical. Field capacity is the total work done by a machine in one hour and can be expresses as machine field capacity (area/time) or material capacity (mass/time or volume/time). Machine field capacity is determined through eq.1: Eq.1 where Ca is the machine field capacity (ha/h), V is the travel speed (km/h), W is the machine operating width (swath) (m) and is the machine field efficiency (%). When , machine field capacity is presented by Cat and is called theoretical machine field capacity. Machine material capacity is calculated through eq.2: Eq.2 where Cm is the machine material capacity (Mg/h) and Y is the yield (Mg/h). When , this value is presented by Cmt and is called theoretical machine material capacity. Theoretical field capacity (area or material) is gained when 100% of machine swath is used, but this is almost impossible in reality and there is always some overlapping. For machineries such as windrower, the swath is equal to numbers of rows times the distance between rows and is considered fixed. In other machineries like bailers and choppers which their capacity is expressed in material (either mass or volume), can be assumed one [1]. Field machine index is the percent of machine’s efficient working time divided by machine turning time and efficient working time (eq.3). Eq.3

3

Where FMI is the field machine index and are the total field time, stop time and turning time respectively. Machine’s theoretical working time is the theoretical time needed for a machine to perform a task in field and is determined by dividing the working area by theoretical field capacity of that machine (eq.4). Eq.4

where Tt is the theoretical time (h) required for a machine to complete a task, Cat is the theoretical machine’s field capacity (ha/a) and At is the total area (ha) to be worked (theoretical are). Because of overlapping, the actual time for particular operation includes machine turning time and charging-discharging reservoirs time which makes the field efficiency less than 100%. Field efficiency can be calculated through eq.5. Eq.5

where is field efficiency (%), Tt is theoretical operation time (h), Ta is work-area related wasted time(h), Th is unrelated work-area wasted time (h), and Te is the effective time (h) which can be also determined through Eq.6 or Eq.7. Eq.6 Eq.7

where Kw is the actual operation width of the machine that is used, Aa is the actual area (ha) that machine has covered and Ca is the machine field capacity (ha/h),. 2.2. Implementation of linear regression Regression Analysis is a statistical method for analyzing a relationship between two or more variables in such a manner that one variable can be predicted or explained by using information on the others. The independent variable (X) is the variable in regression that can be controlled or manipulated. For this project, the independent variable was load cell voltage (v). The dependent variable (Y) is the variable in regression that cannot be controlled or manipulated. For this project, the dependent variable was mass (m). The correlation coefficient computed from the sample data measures the strength and direction of a linear relationship between two variables. The symbol for the sample correlation coefficient is r and the symbol for the population correlation coefficient is ρ. The range of correlation coefficient is from -1 (strong negative linear relationship between the variables,) to +1 (strong positive linear relationship between the variables). Formula for the correlation coefficient r: Eq.8 ∑ √



∑ ∑

∑ ∑



The simple linear regression model is of the form: Eq.9

This model is often referred to as the regression of y on x. The two parameters, β0 and β1 are called regression coefficients. β1 is the slope of the regression line and β0 is the intercept. The individual values of Є are assumed to come from a population of random variables having the normal distribution with mean zero and

4

variance . The assumption are that the linear model is appropriate, the error terms are independent, the error terms are (approximately) normally distributed, and the error terms have a common variance, . The three criteria for best fits are: ∑ Minimizes the sum of the residual ∑ , Minimizes the |, and sum of the absolute values of the residuals: ∑ | | ∑ | Minimizes the sum of squared residuals. The most popular criterion is minimizing the sum of squared residuals which is called least square criterion and results in an estimated line that minimizes the variance of the residuals. The least squares criterion requires that we choose estimates of β0 and β1 that minimize Eq.10 ∑

̂



|

̂

̂ Eq.11

̂

̅

̂ ̅ Eq.12

̂

∑ ̅ ∑

̅ ̅

2.3. Implementation of distance calculation from GPS data GPS receiver communication is defined within NMEA-0183 standard protocol. The output is an ASCII file which contains several comma delimited lines of data called sentence or string, each of which including the entire position, velocity and time (PVT) computed by the GPS receiver. Different brands use different types of NMEA sentences. The two most common string format used in agricultural applications are GPGGA and GPRMC. The format of latitude and longitude in both arrangements is recorded in degrees-and-decimal minutes ( ). Another way of expressing latitude and longitude is in angular units of degrees, minutes and seconds ( . It is usually necessary to convert this format to decimal degrees or radians for geometric computational purposes. This conversion is illustrated in the below table: Decimal degrees (

)

Radian

Deg, minutes and decimal minutes

Deg, minutes and seconds Table 1: latitude and longitude conversions

In order to use latitude and longitude readings of a GPS receiver in distance calculations, they should be converted into linear units such as x and y. This conversion is complex due to the model representation of the earth (ellipsoid or sphere) and the change in point’s altitude; however size of a farm field is small with respect to earth and can be considered as a flat surface. The purpose of transforming angular units to linear x-y coordinates is to determine the distance change corresponding to one degree of change in latitude and longitude. The following sets of calculations are based on WGS-84 spheroid earth model and can be used to calculate distance between two GPS points expressed in decimal degrees. The assumptions used in developing these equations result in errors of less than 0.1 m in 400 meter at 45 degrees latitude. [

(

(

))]

5

[

[

[

(

(

))]

(

)

(

)

(

)

(

)

]

]

, ,

, √

, ,

(

)

, and . Here a= equatorial radius =6378137, b= polar radius √ =6356752.3142, h= Elevation, and = true angle, and = Radius of each point, , , and = XY coordinates, = X-coordinate, = Y-coordinate. A simple yet very accurate method to calculate distance between two points in the field is to use ellipsoidal Vincenty formula, given below. The latitude and longitude in this method should be provided in radian format.

For sufficiently close points in a field (within 1 minute change in longitude and latitude), the following equation from USGS Bulletin 1532 (1987) discussed in [3] can be used:



√ where a=equatorial radius =6378135 m. b=polar radius=6356752.3 m, e=0.081819803 m, Long= Longitude (rad), Lat= Latitude (rad), = Horizontal displacement, = Vertical displacement, D= Distance (m). Another similar method is discussed in [4] and is given below: (

) (

√(

) )

(

)

Where a=equatorial radius =6378135 m, b=polar radius=6356752.3 m, Lat=Latitude (degree decimal), Long= Longitude (degree decimal), = Latitude conversion factor, = Longitude conversion factor, and = Distance (m) 2.4. Hardware and software Major hardware component used in this Citrus Yield Mapping included position sensor (DGPS), Mass flow sensor (Impact force sensor), Ground speed sensor(GPSbased speed measurement), Display/processor console. Using this hardware setup, raw GPS and load cell data was collected by AOM5435 students from University of Florida campus biological field on Nov. 5, 2008. Three major software were used to complete this project (Figure 2). Delphi programming language was used to design and program the standalone application. MATLAB and Excel were used to test the results and plot the data. Raw GPS and load cell data was used as the input of this project. The aim was to automatically create a yield table and calculate field

6

efficiency, machine capacities and field machine index from raw GPS and load cell data using three steps, reading data, extracting data and processing data.

Figure 2. Delphi language V7.0, MATLAB software, Microsoft Excel

2.5. Designing graphical user interface The raw data was originally mixed with other GPS sentence format and blanked lines. An algorithm was first written to read the original raw GPS data and sort the proper NMEA sentences out of it to create a clean file that only contains $GPGGA sentences as shown in Figure 3. A user interface form was designed in Delphi environment and is shown in Figure 4 and 5. Tab-page control was used to ease the accessibility of different sections. In fact, the goal was to make a simple outlook and minimize redundant calculation and buttons. As it can be seen in figure 5, major calculations are done within three easy steps, “Open data”, “extract data” and “process data”. Progress bars were used in the last two steps to show the elapsed time while calculations are in progress. The application was programmed through several hundred command lines in Delphi environment. It has the ability to calculate yield information in two standard units, US and SI. Main button section is shown in Figure 5. The “Open GPS data” button Opens raw GPS data ($GPGGA) as a text file, removes any blanked line between data if there is any and load data into the software memory. The “Open Load Cell data” button opens raw load cell data (voltage) as a text file and load data into the software memory. At this time, user can view the raw data and check for accuracy or do any modification if necessary. The “Calibrate Load cell” opens a new form which uses linear regression method (minimizing sum of squared residuals) described in literature review to calibrate load cell using data points provided by user. The “Extract data” buttons reads and extracts information from raw data stored in the temporary memory of the software and store them in a table as shown in Figure 5. The “Process data” button first reads the extracted information and load cell data. Using regression model information, load cell data are converted to mass data. Information such as distance between pairs of points, travel speed and area are then determined and mass per unit area (yield) is calculated. This button also determines total field operation time, total effective and total ineffective time (including stopped time and turning time) to calculate field efficiency, machine capacity and field machine index. As a result, the output table is created which contains all the detailed information.

7

Program extension

Multiple GPS files

Single GPS file

Main program

Output result (overall and specific days) Accurate time and distance calculation Primary and support function time Field efficiency and field machine index

$GPRMC raw data Load cell data

$GPGGA raw data

Result.txt Yield table, Field efficiency Machine capacity, Machine Field capacity, Machine Material capacity, Field Machine Index

Figure 3. Schematic view of the software process

Figure 4: Demonstration of original raw GPS data containing broken lines (top), and the software extension for fixing and sorting the $GPVTG sentence (bottom)

8

Program outlook

Extracted data For further calculations

Main Buttons

GPA raw data Load cell data (simulated)

Main menu

Program outlook, Specific day result

Raw data from yield monitoring system (GPS & Load cell data mixed)

Sorted GPRMC data

Statistics summary For the selected day

Machinery Index for the selected day

Result by date

Program outlook, sorting data

Figure 5: Demonstration of the user interface of the final version of the Software

9

3.

Results and discussion Data collection was done in a one-second time interval. This is shown in Figure 6. In the other words, it was found out that there has been no interruption in collecting data. Since no mass was collected during data collection, it can be seen from Figures 6 that mass has been just oscillating around zero during the operation time. Plots of load cell data vs. time and mass-per-second vs. time as shown in Figure 6. The oscillation observed is due to the ground surface which has produced vibration on the load cell. As we expected, no increase in the mass vs. time plot is observed. Moreover, as we expected no increase in yield is observed since no real harvesting was performed. It can be seen that yield has been only oscillating around 0 lb/ft2. Negative values of yield are due to the impact of ground surface to the load cell that has produced negative vibration.

20

Speed (km/h)

15

10

5

0

0

240

480

720 960 1200 1540 Time (second) Figure 6. Demonstration of speed profile (left) and load cell data (right) for the experimental driven path

Distance between two points was calculated using an algorithm shown in appendix A. Area was then calculated as harvesting width (assumed 20ft) times distance. Since several people were involved in the data collection procedure, The machine was stopped several times to change the drivers. This can be clearly seen from Figure 7. It is now possible to view performance of each driver individually from Figure 6 and 7 to determine who has driven faster, who has had less effective time, etc. Yield table was created according to the load cell voltage and area measurements. As explained in the literature review, two important parameters to calculate field efficiency is the turning time and stopped time. Once field efficiency is calculated, machine capacities can be calculated easily. Three algorithms were written to determine turning points to extract corresponding turning times. Comparisons of these three algorithms are shown in Figure 7 and 8. The third algorithm showed better performance and was therefore selected to calculate turning times. Stopped time was considered those points at which traveled distance has been zero. These points were found as shown in Figure 7. Ineffective time was then calculated as the sum of turning time and stopped time. Once these parameters are determined, the user needs to input standard travel speed and total area to be harvested (farm size) in the software and press on the “calculate” button to see the field efficiency, machine capacities (theoretical, field and material) and field machine index. Reports are provided for an actual field experiment involving citrus canopy shaker (Table 2 to 6, and Figure 9 to 14)

10

29.6406

29.6406

Stop points Moving points

Lat

29.6405

29.6405

29.6405

29.6405

29.6404

29.6404

29.6404

29.6404

29.6403

29.6403

29.6403

29.6403

29.6402

29.6402

29.6402

-82.3622

-82.362

Original points Turning points

29.6406

29.6402 -82.3618 -82.3616 -82.3614 Long

-82.3622

-82.362

-82.3618 Long

-82.3616

-82.3614

Figure 7. Experimental driven paths for testing algorithm to detect row-end turnings Row end turnings

Figure 8. Improvement of the turning time algorithm on actual field experiment (using citrus canopy shaker)

11

Table 2. Report summary for November 2008 data set, total of 12 days Dates Collected points Time % of total hrs : min operation 1 17/11/08 13656 3: 47 8.080 2 18/11/08 16186 4:29 9.577 3 19/11/08 7434 2:3 4.398 4 20/11/08 15436 4:17 9.133 5 21/11/08 12713 3:31 7.522 6 22/11/08 13923 3:52 8.238 7 24/11/08 13434 3:43 7.9487 8 25/11/08 212 0:3 0.125 9 26/11/08 21816 6:3 12.908 10 28/11/08 31788 8:49 18.808 11 29/11/08 21229 5:53 12.561 12 30/11/08 1180 0:19 0.6981 Total 169007 46:56 100 Day #

(hr)

(hr)

46.944

34.104

Time losses (hr) 11.654

1.186

(%)

(hr)

(%)

96.63

40

85.20

Figure 9. Report summary for November 2008 data set, total of 12 days

12

Day # 1 2 3 4 5 6 7 8 Total

Table 3. Report summary for Dec-02-2008, 1st data set, Total of 8 days Dates Collected points Time % of total operation hrs : min 14/11/08 109 00:01 0.114 17/11/08 14296 3:58 15.029 18/11/08 16294 4:31 17.130 19/11/08 7521 2:05 7.906 20/11/08 15484 4:18 16.278 21/11/08 12862 3:34 13.522 22/11/08 13997 3:53 14.715 24/11/08 14556 4:02 15.302 95119 26:25 100

(hr)

(hr)

26.42

19.71

Time losses (hr) 6.161

0.548

(%)

(hr)

(%)

97.291

22

83.27

Figure 10. Report summary for Dec-02-2008, 1st data set, Total of 8 days

13

Table 4. Report summary for Dec-02-2008, 2nd dataset, Total of 8 days Day # Dates Collected points Time % of total hrs : min operation 1 25/11/08 235 0:3 0.173 2 26/11/08 22264 6:11 16.435 3 28/11/08 32115 8:55 23.707 4 29/11/08 21804 6:3 16.095 5 30/11/08 1259 0:20 0.929 6 01/12/08 33573 9:19 24.783 7 02/12/08 4398 1:13 3.246 8 03/12/08 19815 5:30 14.627 Total 135463 37:37 100

(hr)

(hr)

37.626

25.702

Time losses (hr) 10.942

0.982

(%)

(hr)

(%)

96.31

30

79.73

Figure 11. Report summary for Dec-02-2008, 2nd dataset, Total of 8 days

14

Day # 1 2 3 4 Total

Table 5. Report summary for Dec-18-2008, 2nd data set, Total of 4 days Dates Collected points Time % of total hrs : min operation 11/12/08 35504 9:51 44.256 12/12/08 31583 8:46 39.368 16/12/08 11955 3:19 14.902 17/12/08 1182 0:19 1.473 80224 22:17 100

(hr)

(hr)

22.283

12.306

Time losses (hr) 8.991

0.986

(%)

(hr)

(%)

92.58

15

67.31

Figure 12. Report summary for Dec-18-2008, 2nd data set, Total of 4 days

15

Day # 1 2 3 4 5 6 7 Total

Table 6. Report summary for Dec-18-2008, 1st dataset, Total of 7 days Dates Collected points Time % of total hrs : min operation 03/12/08 16288 4:31 10.315 04/12/08 21039 5:50 13.324 05/12/08 20231 5:37 12.812 06/12/08 27396 7:36 17.350 08/12/08 23534 6:32 14.904 09/12/08 25819 7:10 16.351 10/12/08 23594 6:33 14.942 157901 43:51 100

(hr)

(hr)

43.859

30.717

Time losses (hr) 11.875

1.267

(%)

(hr)

(%)

96.03

35

79.80

Figure 13. Report summary for Dec-18-2008, 1st dataset, Total of 7 days 10

Actual operation time Stop time

12 10

Turning time Effective time

6

Time (hr)

Field time (hr)

8

4

Actual operation time Mean of actual time Theoretical operation time mean of theoretical time

8 6 4

2

2

0 1

3

5

7

9

11 13 Days index

15

17

19

21 22

0

2

4

6

8

10 12 14 Days index

16

18

20

22

Figure 14. Comparison between actual operation time, stop time, row-end turning time and effective time of operation

16

4.

Conclusion Available modern technology like GPS can be used in modern agricultural mechanization for precise determination and automatic storing of variables such as time, travel speed, travelled distance, working area, fuel consumption, yield information, etc. Yield information that are calculated using this software can be fed into a GIS software to create yield map. This application was shown to be capable of eliminating time taking procedures of yield data creation and replacing it with a three easy step procedure. For 1540 data points, it only took nearly 10 seconds for this standalone application to calculate yield data table, field efficiency, machine capacities and field machine index. It would be then possible for a farm owner to view performance of a contract based driver on field before getting him paid as well as easily understanding of the potentials to increase efficiency of his harvesting operation. The ultimate goal of this project can be thought of as a standalone platform device capable of creating and updating a particular machine performance data base for a specific region. Statistical analysis and graphical representation of such accurate data over time can be utilized in farm & machinery management, i.e. to make decisions on machine size selection and driver’s skill/performance. A standalone computer application was developed to determine yield map data, field efficiency, machine capacities and field machine index from standard NMEA GPS strings and load cell data. The implemented algorithm extracts position (latitude and longitude) and time/date stamps from GPS file and link with the corresponding harvested mass signal from load cell file. Using these as input, the algorithm generates the following outputs. The program provides growers with an easy tool to visualize field and machine potentials to increase benefits and reduce lost. The application was successfully used for processing of GPS data for automatic calculation of machine total time in field, total travelled distance, covered area, machine time spent at row-ends turning and stopped time, field efficiency and field machine index. The entire processing time of 1540 lines of GPS string on a Pentium III machine was 4 seconds. It contributes to the following: To eliminate the cumbersome procedure in creating yield map data by developing a standalone computer application, To determine field efficiency and machine performance from raw GPS data. The software can calculate: Numbers of data points, Numbers of harvesting days, Lat/Long map, Moving points map, Stopped Points map, Turning points map, Straight Points map, Operation time, Stopped time, Turning time, Effective time, Total driven distance, Total covered area, Speed statistics, Mass/voltage calibration, Yield statistics, Statistics for individual days

References 12-

American society of agricultural engineering (1995) ASAE Standard, 24th edition John Deere (1975), Fundamental of machine operation. Machinery management. John Deere.

17

Appendix: Delphi codes, author: Ramin Shamshiri, 2008-2009, University of Florida, [email protected] unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Menus, Grids, ComCtrls, StdActns, ActnList, Spin, XPMan, OleServer, ExcelXP; type TForm1 = class(TForm) MainMenu1: TMainMenu; File1: TMenuItem; New1: TMenuItem; Open1: TMenuItem; Save1: TMenuItem; N1: TMenuItem; Exit1: TMenuItem; ActionList1: TActionList; FileOpen1: TFileOpen; PageControl1: TPageControl; TabSheet1: TTabSheet; GroupBox1: TGroupBox; Memo1: TMemo; GroupBox2: TGroupBox; StringGrid1: TStringGrid; TabSheet2: TTabSheet; FileSaveAs1: TFileSaveAs; FileOpen2: TFileOpen; Memo2: TMemo; StatusBar1: TStatusBar; GroupBox5: TGroupBox; Label10: TLabel; Label11: TLabel; Label12: TLabel; Label13: TLabel; Label15: TLabel; Label16: TLabel; Button5: TButton; Button7: TButton; Edit11: TEdit; Edit12: TEdit; Edit13: TEdit; Edit14: TEdit; Edit16: TEdit; Edit17: TEdit; Label17: TLabel; Edit18: TEdit; Label14: TLabel; Edit15: TEdit; Label18: TLabel; Edit19: TEdit; FileSaveAs2: TFileSaveAs; GroupBox3: TGroupBox; Label5: TLabel; Label6: TLabel; Button2: TButton; Button1: TButton; Button3: TButton; SpinEdit1: TSpinEdit; RadioButton1: TRadioButton; RadioButton2: TRadioButton; Button6: TButton; Button9: TButton; GroupBox6: TGroupBox; Label3: TLabel; Label19: TLabel; Edit2: TEdit; Label20: TLabel; Edit3: TEdit; Label21: TLabel; Edit4: TEdit; Label7: TLabel; Edit5: TEdit; Label8: TLabel; Edit6: TEdit; Label9: TLabel; Edit7: TEdit; Label22: TLabel; Edit8: TEdit; Label23: TLabel; Edit9: TEdit; Label24: TLabel; Edit10: TEdit; Edit1: TEdit; Label26: TLabel; Label27: TLabel; TabSheet3: TTabSheet; GroupBox7: TGroupBox; Label25: TLabel; Label28: TLabel; ComboBox1: TComboBox; StringGrid3: TStringGrid; ProgressBar1: TProgressBar; GroupBox4: TGroupBox; Label4: TLabel; Label2: TLabel; StringGrid2: TStringGrid; ProgressBar2: TProgressBar; Label1: TLabel; Label29: TLabel; Label30: TLabel; Label31: TLabel; Label32: TLabel; Label33: TLabel; Label34: TLabel; Label35: TLabel; Label36: TLabel; Label37: TLabel; Label38: TLabel; Label39: TLabel; Label40: TLabel; Label41: TLabel; Label42: TLabel; Label43: TLabel; Label44: TLabel; Label45: TLabel; Label46: TLabel; GroupBox8: TGroupBox; Label47: TLabel; Label48: TLabel; Label49: TLabel; Label50: TLabel; Label51: TLabel; Label52: TLabel; Label53: TLabel;

Label54: TLabel; Label55: TLabel; Label56: TLabel; Label57: TLabel; Label58: TLabel; Label59: TLabel; Label60: TLabel; Label61: TLabel; Label62: TLabel; Label63: TLabel; Label64: TLabel; Label65: TLabel; Label66: TLabel; Label67: TLabel; Label68: TLabel; Edit20: TEdit; Edit21: TEdit; Edit22: TEdit; Edit23: TEdit; Edit24: TEdit; Edit25: TEdit; Edit26: TEdit; Edit27: TEdit; Edit28: TEdit; Edit29: TEdit; GroupBox9: TGroupBox; Label69: TLabel; Label70: TLabel; Label71: TLabel; Label72: TLabel; Label73: TLabel; Label74: TLabel; Label75: TLabel; Label76: TLabel; Label77: TLabel; Label78: TLabel; Label79: TLabel; Label80: TLabel; Label81: TLabel; Label82: TLabel; Label83: TLabel; Label84: TLabel; Label85: TLabel; Label86: TLabel; Button4: TButton; Button8: TButton; Edit30: TEdit; Edit31: TEdit; Edit32: TEdit; Edit33: TEdit; Edit34: TEdit; Edit35: TEdit; Edit36: TEdit; Edit37: TEdit; Edit38: TEdit; FileOpen3: TFileOpen; OpenLoadcellfile1: TMenuItem; Saveresultbydates1: TMenuItem; E1: TMenuItem; DataSort1: TMenuItem; LoadCellSimulator1: TMenuItem; FileSaveAs3: TFileSaveAs; N2: TMenuItem; N3: TMenuItem; SaveGPRMCSentences1: TMenuItem; Save2: TMenuItem; FileSaveAs4: TFileSaveAs; procedure Button1Click(Sender: TObject); procedure FileOpen1Accept(Sender: TObject); procedure FileSaveAs1Accept(Sender: TObject); procedure RadioButton2Click(Sender: TObject); procedure RadioButton1Click(Sender: TObject); procedure FormShow(Sender: TObject); procedure FileOpen2Accept(Sender: TObject); procedure Button9Click(Sender: TObject); procedure Exit1Click(Sender: TObject); procedure New1Click(Sender: TObject); procedure FormDockOver(Sender: TObject; Source: TDragDockObject; X, Y: Integer; State: TDragState; var Accept: Boolean); procedure FormDragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); procedure ComboBox1Change(Sender: TObject); procedure Button2Click(Sender: TObject); procedure Button8Click(Sender: TObject); procedure Button7Click(Sender: TObject); procedure Button5Click(Sender: TObject); procedure Button4Click(Sender: TObject); procedure FileSaveAs2Accept(Sender: TObject); procedure DataSort1Click(Sender: TObject); procedure FileSaveAs3Accept(Sender: TObject); procedure FileSaveAs4Accept(Sender: TObject); private { Private declarations } public { Public declarations } StringGridku:TStringGrid; end; var Form1: TForm1; i,gaprows,gaprows2,gap3:integer; rows,cols: integer; dayrows,step:integer; Yield,Mass,Volt,AveYield:real; implementation uses Unit2, Unit3, Unit4; {$R *.dfm} //---------------Save TStringGrid contents to a textfile----------------------// procedure StringGridToFile(var AGrid: TStringGrid; const AFileName: string); var SaveOutput: TextFile; Save_r: Integer; begin AssignFile(SaveOutput, AFileName); Rewrite(SaveOutput); Save_r := 0; while Save_r < AGrid.RowCount do begin WriteLn(SaveOutput, AGrid.Rows[Save_r].CommaText); Inc(Save_r);

end; CloseFile(SaveOutput); end; //..............END of Save TStringGrid contents to a textfile................// //-----------------------AutoSizing StringGrid--------------------------------// procedure AutoSizeCol(var Grid: TStringGrid; Column: integer); var iGrid, W, WMax: integer; begin WMax := 0; for iGrid := 0 to (Grid.RowCount - 1) do begin W := Grid.Canvas.TextWidth(Grid.Cells[Column, iGrid]); if W > WMax then WMax := W; end; Grid.ColWidths[Column] := WMax + 5; end; //......................End of AutoSizing StringGrid..........................// //-----------------------Button : rocess Data---------------------------------// procedure TForm1.Button1Click(Sender: TObject); label 00,0,1,16,stop, GPGGA, GPRMC,turntime,stopturn; var decLat,decLong,degLat,degLong, minLat,minLong, secLat,secLong,min1,min2,h1,h2, deltat,Lat1,Lat2,Long1,Long2,dist,speed,time,sumdist,avespeed,d_sum:real; t1,t2,date1,date2,day, sec1,sec2,regrow:integer; var temp:string; begin //-----------------------Form Preparation-------------------------------------// pagecontrol1.TabIndex:=1; combobox1.Items.Clear; //clearing previous data in the combobox label27.Caption:=''; //.......................End of Form Preparation..............................// //-----------------------Preparing Tables' records----------------------------// //-----------------------Clearing table 1 (Stringgrid1)-----------------------// //-----------------------Initialization Progressbar2--------------------------// progressbar2.StepBy(-progressbar2.Position); progressbar2.Min:=1; progressbar2.MAX:=StringGrid1.ColCount; progressbar2.Step:=1; progressbar2.Update; label4.Caption:='Preparing records 1...'; label4.Update; form1.Update; //.........................End of Initialization Progressbar2.................// for cols := 0 to StringGrid1.ColCount do begin progressbar2.StepBy(1); StringGrid1.Cols[cols].Clear; end; form1.Update; //.......................End of Clearing table 1 (Stringgrid1)................// //-----------------------Clearing table 2 (Stringgrid2)-----------------------// //-----------------------Initialization Progressbar2--------------------------// progressbar2.StepBy(-progressbar2.Position); progressbar2.Min:=1; progressbar2.MAX:=StringGrid2.ColCount; progressbar2.Step:=1; progressbar2.Update; label4.Caption:='Preparing records 2...'; label4.Update; form1.Update; //.......................End of Initialization Progressbar2...................// for cols := 0 to StringGrid2.ColCount do begin progressbar2.StepBy(1); StringGrid2.Cols[cols].Clear; end; cols:= 0; //.......................End of Clearing table 2 (Stringgrid2)................// //-----------------------End of Preparing Tables' records---------------------// //-----------------------Start Extracting Program-----------------------------// //-----------------------Initialization progressbar2--------------------------// progressbar2.StepBy(-progressbar2.Position); progressbar2.Min:=1; progressbar2.MAX:=memo1.Lines.Capacity; progressbar2.Step:=1; progressbar2.Update; label4.Caption:='Extracting data...'; label4.Update; form1.Update; //-------------------Initialization Memo1 and Table1 rows---------------------// cols:= 0; rows:=0; gaprows:=0; for rows:= 1 to memo1.Lines.Capacity do begin progressbar2.StepBy(1); i:=0; cols:=1; 00: temp:=''; temp:=memo1.Lines.Strings[rows-1]; if temp='' then begin if rows=memo1.Lines.Capacity then begin goto 16 end else begin inc(gaprows); goto 00; end; end else begin

// Begin For #1

StringGrid1.RowCount:=rows-gaprows+2; StringGrid1.Cells[0,rows-gaprows]:=inttostr(rows-gaprows); 1:

inc(i); if copy(temp,i,1)',' then begin

if copy(temp,i,1)'' then begin stringgrid1.Cells[cols,rowsgaprows]:=concat(stringgrid1.Cells[cols,rows-gaprows],copy(temp,i,1)); goto 1; end else begin temp:='.'; goto 16; end; end else begin inc(cols); goto 1; end; end; 16: form1.Update; end; // End of FOR #1 label4.Caption:='Extracting Completed.'; label4.Update; form1.Update; //.........................End Extracting Program.............................// //-----------------------Fixing interupted data points------------------------// //------------------------Initialization progress bar2------------------------// progressbar2.StepBy(-progressbar2.Position); progressbar2.Min:=1; progressbar2.MAX:=StringGrid1.ColCount; progressbar2.Step:=1; progressbar2.Update; label4.Caption:='Checking data...'; label4.Update; form1.Update; //.................End of Initialization progress bar2........................//

rows:=0; //reset rows for rows:=2 to stringgrid1.RowCount-1 do begin progressbar2.StepBy(1); if stringgrid1.Cells[2,rows-1]='' then stringgrid1.Cells[2,rows1]:=stringgrid1.Cells[2,rows]; //Fixing time cell if stringgrid1.Cells[4,rows-1]='' then stringgrid1.Cells[4,rows1]:=stringgrid1.Cells[4,rows]; //Fixing Lat if stringgrid1.Cells[6,rows-1]='' then stringgrid1.Cells[6,rows1]:=stringgrid1.Cells[6,rows]; //Fixing Long if stringgrid1.Cells[7,rows-1]='' then stringgrid1.Cells[7,rows1]:=stringgrid1.Cells[7,rows]; //Fixing Long if stringgrid1.Cells[10,rows-1]='' then stringgrid1.Cells[10,rows1]:=stringgrid1.Cells[10,rows]; //Fixing date end; form1.Update; //................End of Fixing interupted data points........................// //-----------------------Labling Column for GPGGA-----------------------------// if stringgrid1.Cells[1,1]='$GPGGA' then begin stringgrid1.Cells[0,0]:='No'; stringgrid1.Cells[1,0]:='GPGGA'; stringgrid1.Cells[2,0]:='Time'; stringgrid1.Cells[3,0]:='Lat'; stringgrid1.Cells[4,0]:='N/S'; stringgrid1.Cells[5,0]:='Long'; stringgrid1.Cells[6,0]:='W/E'; stringgrid1.Cells[7,0]:='Quality'; stringgrid1.Cells[8,0]:='No of Sat'; stringgrid1.Cells[9,0]:='HDOP'; stringgrid1.Cells[10,0]:='Altitude'; stringgrid1.Cells[11,0]:='M'; stringgrid1.Cells[12,0]:='H of Geoid'; stringgrid1.Cells[13,0]:='Last Update'; stringgrid1.Cells[14,0]:='Station ID'; stringgrid1.Cells[15,0]:='checksum data'; end; //.......................END Labling Column for GPGGA.........................//

//-----------------------Labling Column for $GPRMC----------------------------// if stringgrid1.Cells[1,1]='$GPRMC' then begin stringgrid1.Cells[0,0]:='No'; stringgrid1.Cells[1,0]:='$GPRMC'; stringgrid1.Cells[2,0]:='Time Stamp'; stringgrid1.Cells[3,0]:='Validity'; stringgrid1.Cells[4,0]:='Lat'; stringgrid1.Cells[5,0]:='N/S'; stringgrid1.Cells[6,0]:='Long'; stringgrid1.Cells[7,0]:='W/E'; stringgrid1.Cells[8,0]:='Speed'; stringgrid1.Cells[9,0]:='True Course'; stringgrid1.Cells[10,0]:='Date Stamp'; stringgrid1.Cells[11,0]:='Variation'; stringgrid1.Cells[12,0]:='E/W Checksum'; stringgrid1.Cells[13,0]:='Lat'; stringgrid1.Cells[14,0]:='Long'; stringgrid1.Cells[15,0]:='FPS'; stringgrid1.Cells[16,0]:='ADCRAW'; stringgrid1.Cells[17,0]:='COUNTER'; stringgrid1.Cells[18,0]:='THRESHOLD'; stringgrid1.Cells[19,0]:='YIELD'; stringgrid1.Cells[20,0]:='BOX'; end; //....................End of Labling Column for $GPRMC........................// //-----------------Error Message GPS and Load cell NOT MACH-------------------// if (stringgrid1.RowCount-2)memo2.Lines.Capacity then begin

// initialization progress bar progressbar2.StepBy(-progressbar2.Position); progressbar2.Min:=1; progressbar2.MAX:=StringGrid1.ColCount; progressbar2.Step:=1; progressbar2.Update; label4.Caption:='Preparing records...'; label4.Update; form1.Update; // Clearing table 1 for cols := 0 to StringGrid1.ColCount do begin progressbar2.StepBy(1); StringGrid2.Cols[cols].Clear; end; form1.Update; progressbar2.StepBy(-progressbar2.Position); label4.Caption:='Data Not Mached!'; showmessage('GPS data and load cell not mach! Process Stoped.'); goto stop; end; //................End of Error Message GPS and Load cell NOT MACH.............// //-----------------------Begin Process Data-----------------------------------// form3.Close; //Make sure Message form is closes form1.Update; //Update Main form //---------------- Labling Column for Result Table (Stringgrid2)--------------// stringgrid2.Cells[0,0]:='Wpt'; stringgrid2.Cells[1,0]:='Time'; stringgrid2.Cells[2,0]:='dt'; stringgrid2.Cells[3,0]:='Lat'; stringgrid2.Cells[4,0]:='Long'; stringgrid2.Cells[5,0]:='Distance'; stringgrid2.Cells[6,0]:='Speed'; stringgrid2.Cells[7,0]:='Area'; stringgrid2.Cells[8,0]:='Voltage'; stringgrid2.Cells[9,0]:='Mass'; stringgrid2.Cells[10,0]:='Mass/Sec'; stringgrid2.Cells[11,0]:='Yield'; stringgrid2.Cells[12,0]:='StoppedLat'; stringgrid2.Cells[13,0]:='StoppedLong'; stringgrid2.Cells[14,0]:='TurningLat'; stringgrid2.Cells[15,0]:='TurningLong'; stringgrid2.Cells[16,0]:='StraightLat'; stringgrid2.Cells[17,0]:='StraightLong'; stringgrid2.Cells[18,0]:='MovingLat'; stringgrid2.Cells[19,0]:='MovingLong'; //............... End of Labling Column for Result Table (Stringgrid2).......// //--------------------- Begin Main Program -----------------------------------// //Setting numbers of rows for stringgrid 2 stringgrid2.RowCount:=stringgrid1.RowCount; //setting t2 (next time after last row) equal to a value to avoid calculation mess stringgrid1.Cells[2,stringgrid1.RowCount1]:=floattostr(1+strtofloat(stringgrid1.Cells[2,stringgrid1.rowcount-2])); //--------------------- Calculation for GGA format----------------------------// if stringgrid1.Cells[1,1]='$GPGGA' then begin label27.Caption:='1';

//Number of days for GPGGA sentence, only one day

//--------------------- Reading table (StringGrid1)---------------------------// // ---------------------initialization progress bar 2-------------------------// progressbar2.StepBy(-progressbar2.Position); progressbar2.Min:=1; progressbar2.MAX:=stringgrid1.RowCount; progressbar2.Step:=1; progressbar2.Update; label4.Caption:='Processing Lat Long...'; label4.Update; form1.Update; // ....................End of initialization progress bar 2...................// //Lat Long Calculations rows:=0; //reset rows for rows:=2 to stringgrid1.RowCount-1 do begin progressbar2.StepBy(1); if stringgrid1.Cells[3,rows-1]='' then stringgrid1.Cells[3,rows-1]:='0'; //Fixing empty cell ; Missing data if stringgrid1.Cells[5,rows-1]='' then stringgrid1.Cells[5,rows-1]:='0'; //Fixing empty cell ; Missing data // reading Lat & Long decLat:=strtofloat(stringgrid1.Cells[3,rows-1]); decLong:=strtofloat(stringgrid1.Cells[5,rows-1]); if stringgrid1.Cells[6,rows-1]='W' then decLong:=(-1)*decLong; //Converting Lat degLat:=trunc(decLat/100); minLat:=(trunc(frac(decLat/100)*1000)/10)/60; secLat:=((frac((frac(decLat))*10))/10)/60; //Converting Long degLong:=trunc(decLong/100); minLong:=(trunc(frac(decLong/100)*1000)/10)/60; secLong:=((frac((frac(decLong))*10))/10)/60; //Printing Output stringgrid2.Cells[0,rows-1]:=(inttostr(rows-1)); //Printing Wpt point stringgrid2.Cells[3,rows-1]:=floattostr(degLat+minLat+secLat); //Printing Lat stringgrid2.Cells[4,rows-1]:=floattostr(degLong+minLong+secLong); //Printing Long end; //Time calculation // initialization progress bar 2 progressbar2.StepBy(-progressbar2.Position); progressbar2.Min:=1; progressbar2.MAX:=stringgrid1.RowCount; progressbar2.Step:=1; progressbar2.Update; label4.Caption:='Processing Time...'; label4.Update;

form1.Update; // End of initialization progress bar 2 rows:=0; //reset rows for rows:=2 to stringgrid1.RowCount-1 do begin progressbar2.StepBy(1); if stringgrid1.Cells[2,rows-1]='' then stringgrid1.Cells[2,rows-1]:='0'; //Fixing empty cell ; Missing data if stringgrid1.Cells[2,rows]='' then stringgrid1.Cells[2,rows]:='0'; //Fixing empty cell ; Missing data t1:= trunc(strtofloat(stringgrid1.Cells[2,rows-1])); t2:=trunc(strtofloat(stringgrid1.Cells[2,rows])); sec1:=t1 mod 100; sec2:=t2 mod 100; min1:=100*frac((t1-(t1 mod 100))/10000); min2:=100*frac((t2-(t2 mod 100))/10000); h1:=(t1-(((t1 mod 100))+100*(100*frac((t1-(t1 mod 100))/10000))))/10000; h2:=(t2-(((t2 mod 100))+100*(100*frac((t2-(t2 mod 100))/10000))))/10000; deltat:=(h2-h1)*3600+(min2-min1)*60+(sec2-sec1); if deltat3 then begin

//If No.3 Starts

inc(gaprows2); //gaprows2:=gaprows2+1; stringgrid2.Cells[14,(rows-1)-gaprows]:=stringgrid2.Cells[3,rows+1]; stringgrid2.Cells[15,(rows-1)-gaprows]:=stringgrid2.Cells[4,rows+1];

end else begin inc(gaprows); //gaprows2:=gaprows2+1; gaprows2:=gaprows2-1; //Correcting gaprows2 end;

if abs((dist)-(d_sum))>12.5 then begin stringgrid2.Cells[14,(rows-1)-(gaprows)]:=stringgrid2.Cells[3,rows1+gap3]; stringgrid2.Cells[15,(rows-1)-(gaprows)]:=stringgrid2.Cells[4,rows1+gap3];

//If No.3 Ends

stringgrid2.Cells[14,(rows)-(gaprows)]:=stringgrid2.Cells[3,rows+gap3]; stringgrid2.Cells[15,(rows)-(gaprows)]:=stringgrid2.Cells[4,rows+gap3];

end else begin inc(gaprows); //gaprows2:=gaprows2+1; end;

stringgrid2.Cells[14,(rows+1)(gaprows)]:=stringgrid2.Cells[3,rows+2+gap3]; stringgrid2.Cells[15,(rows+1)(gaprows)]:=stringgrid2.Cells[4,rows+2+gap3];

//If No.2 Ends

stringgrid2.Cells[14,(rows+2)(gaprows)]:=stringgrid2.Cells[3,rows+3+gap3]; stringgrid2.Cells[15,(rows+2)(gaprows)]:=stringgrid2.Cells[4,rows+3+gap3];

end else begin inc(gaprows); //gaprows:=gaprows+1; //straight points

gaprows2:=gaprows2+1; gap3:=4; end else begin

stringgrid2.Cells[16,(rows)-gaprows2]:=stringgrid2.Cells[3,rows-1]; stringgrid2.Cells[17,(rows)-gaprows2]:=stringgrid2.Cells[4,rows-1]; end; //If No.1 Ends end; //End For statement

showmessage('data points not sufficient to calculate turning time '); end; //End if statement to check sufficient data points

for rows:=2 to stringgrid2.RowCount-4 do begin

if stringgrid2.Cells[14,rows]='' then begin edit3.Text:= floattostr(0.001*trunc(1000*(rows/60))); Turning time goto stopturn; end;

//Total

end; Stopturn: end; //End of if statement for $GPRMC ////////////End of Calculating total Turning time///////////

stop: end;

end else begin

//----------------------------------------------------------------------------// //.......................End of Process Data..................................// //----------------------------------------------------------------------------//

showmessage('data points not sufficient to calculate turning time ');

procedure TForm1.FileOpen1Accept(Sender: TObject); begin form3.Label1.Caption:='Opening GPS data file, Please Waite...'; form3.Label1.Left:=40; form3.Label1.Font.Color:=clMaroon; form3.Update; form3.show; form3.Update; form1.Update; Memo1.Lines.LoadFromFile(fileopen1.Dialog.FileName); form1.Update; form3.Update; form3.Label1.Left:=80; form3.Label1.Font.Color:=$00804000; form3.Update; form3.Label1.Caption:='GPS file opened successfully.'; form3.Update; form1.Update; sleep(600); form3.Close; form1.Update; form1.Update; end;

//////////////////////////////////////////////////////////// ////////////Calculating Total Turning time////////////////// //////////////////////////////////////////////////////////// // initialization progress bar 2 progressbar2.StepBy(-progressbar2.Position); progressbar2.Min:=1; progressbar2.MAX:=stringgrid2.RowCount; progressbar2.Step:=1; progressbar2.Update; label4.Caption:='Processing Turning time...'; label4.Update; form1.Update; for rows:=2 to stringgrid2.RowCount-4 do begin

//////*********************END OF Calculating turning time No.1*********************//////

// initialization progress bar 2 progressbar2.StepBy(-progressbar2.Position); progressbar2.Min:=1; progressbar2.MAX:=stringgrid2.RowCount; progressbar2.Step:=1; progressbar2.Update; label4.Caption:='Processing Turning time...'; label4.Update; form1.Update; // End of initialization progress bar 2

Stopturn: end; //End of if statement for $GPRMC //////////////////////////////////////////////////////////// ////////////End of Calculating total Turning time/////////// //////*********************END OF Calculating turning time No.2*********************////// }

if stringgrid1.Cells[1,1]='$GPRMC' then time begin

if stringgrid1.Cells[1,1]='$GPGGA' then begin

//////////////////////////////////If Statement for GPGGA turning time///////////////////////

//If statement for GPRMC turning

//if statement to check sufficient data

for rows:=2 to stringgrid2.RowCount-10 do begin

//Start For statement

progressbar2.StepBy(1); if strtofloat(stringgrid2.Cells[6,rows-1])>0 then begin

//If No.1 Starts

d_sum:=strtofloat(stringgrid2.Cells[5,(rows-1)+gap3])+ strtofloat(stringgrid2.Cells[5,rows+gap3])+strtofloat(stringgrid2.Cells[5,rows+ 1+gap3])+strtofloat(stringgrid2.Cells[5,rows+2+gap3]); Lat1:=strtofloat(stringgrid2.Cells[3,(rows-1)+gap3]); Long1:=strtofloat(stringgrid2.Cells[4,(rows-1)+gap3]); Lat2:=strtofloat(stringgrid2.Cells[3,(rows+3)+gap3]); Long2:=strtofloat(stringgrid2.Cells[4,(rows+3)+gap3]); dist:=365222*SQRT(((Lat1-Lat2)*(Lat1-Lat2))+ ((Long1-Long2)*(Long1Long2))); //Valid Distance, same day speed:=dist/(strtoint(stringgrid2.Cells[2,rows-1])); Speed, same day //Corrects Speed and distance if speed>15 then begin dist:=1; //Invalid Distance, different day speed:=1; //Invalid Speed, different day end;

//Total

end;

//Turning time algorithm for Dr.Ehsani project rows:=0; gaprows:=0; gaprows2:=0;

if stringgrid2.RowCount>50 then points begin

//Start For statement

if stringgrid2.Cells[14,rows]='' then begin edit3.Text:= floattostr(0.001*trunc(1000*(rows/60))); Turning time goto stopturn; end;

{ /////////////////////////////////////////////////// //////////////////////////////////Calculating turning time NO.2///////////////////////////

//Valid

////****************************End of Creating yield table and Field efficiency****************************////

end; //End For statement

end; //End if statement to check sufficient data points

//Start For statement

edit2.Text:= floattostr(0.001*trunc(1000*((strtoint(label2.Caption))(gaprows))/60)); edit4.Text:=floattostr((strtofloat(edit1.Text))((strtofloat(edit2.Text))+(strtofloat(edit3.Text)))); edit15.Text:=floattostr(0.01*trunc(10000*(((strtofloat(edit4.Text))/((strtofloa t(edit4.Text))+(strtofloat(edit2.Text))+(strtofloat(edit3.Text))))))); //Calculating and printing Field Machine Index

label4.Font.Color:=$00804000; label4.Caption:=concat('Process Completed for Total Numbers of ',label2.caption,' data points.'); progressbar2.StepBy(-stringgrid2.RowCount);

end; //If No.1 Ends

//////////////////////////////////////////////////////////// ////////////Calculating Total Turning time////////////////// //////////////////////////////////////////////////////////// // initialization progress bar 2 progressbar2.StepBy(-progressbar2.Position); progressbar2.Min:=1; progressbar2.MAX:=stringgrid2.RowCount; progressbar2.Step:=1; progressbar2.Update; label4.Caption:='Processing Turning time...'; label4.Update; form1.Update;

for rows:=2 to stringgrid2.RowCount-1 do begin progressbar2.StepBy(1); if strtofloat(stringgrid2.Cells[5,rows-1])0.000005 then begin stringgrid2.Cells[14,(rows-1)-gaprows]:=stringgrid2.Cells[3,rows+1]; stringgrid2.Cells[15,(rows-1)-gaprows]:=stringgrid2.Cells[4,rows+1]; gaprows2:=gaprows2+1; end else begin gaprows:=gaprows+1; stringgrid2.Cells[16,(rows-1)-gaprows2]:=stringgrid2.Cells[3,rows-1]; stringgrid2.Cells[16,rows-gaprows2]:=stringgrid2.Cells[3,rows+2]; stringgrid2.Cells[17,(rows-1)-gaprows2]:=stringgrid2.Cells[4,rows-1]; stringgrid2.Cells[17,(rows)-gaprows2]:=stringgrid2.Cells[4,rows+2]; end; end; edit3.Text:= floattostr(0.001*trunc(1000*((strtoint(label2.Caption))(gaprows))/60)); //Total Turning time end; //End of if statement for GPGGA turning time //////////////////////////////////END If Statement for GPGGA turning time///////////////// //Caclulating stop time//// rows:=0; gaprows:=0; gaprows2:=0; // initialization progress bar 2 progressbar2.StepBy(-progressbar2.Position); progressbar2.Min:=1;

procedure TForm1.FileSaveAs1Accept(Sender: TObject); begin form3.Label1.Caption:='Saving result data file, Please Waite...'; form3.Label1.Left:=40; form3.Label1.Font.Color:=clMaroon; form3.Update; form3.show; form3.Update; form1.Update; StringGridToFile(StringGrid2, filesaveas1.Dialog.FileName); form1.Update; form3.Update; form3.Label1.Left:=65; form3.Label1.Caption:='Result data file saved successfully.'; form3.Label1.Font.Color:=$00804000; form3.Update; form1.Update; sleep(600); form3.Close; form1.Update; form1.Update; end; procedure TForm1.RadioButton2Click(Sender: TObject); begin if radiobutton2.Checked then begin label5.Caption:='Swath (cm)'; label32.Caption:='(km)'; label33.Caption:='(hec)'; label34.Caption:='(km/h)'; label35.Caption:='(Kg/m2)'; label36.Caption:='(Kg/m2)'; label37.Caption:='(Kg/m2)'; label38.Caption:='(km/h)'; label39.Caption:='(hec)'; label40.Caption:='(Kg/hec)'; label42.Caption:='(hec/h)'; label44.Caption:='(hec/h)'; label44.Caption:='(Kg/h)'; label63.Caption:='(km)'; label64.Caption:='(hec)'; label65.Caption:='(km/h)'; label66.Caption:='(Kg/m2)'; label67.Caption:='(Kg/m2)'; label68.Caption:='(Kg/m2)'; label78.Caption:='(km/h)'; label79.Caption:='(hec)'; label80.Caption:='(Kg/hec)'; label82.Caption:='(hec/h)';

label84.Caption:='(hec/h)'; label85.Caption:='(Kg/h)'; end; end; procedure TForm1.RadioButton1Click(Sender: TObject); begin if radiobutton1.Checked then begin label5.Caption:='Swath (ft)'; label32.Caption:='(mile)'; label33.Caption:='(acre)'; label34.Caption:='(mil/h)'; label35.Caption:='(lb/ft2)'; label36.Caption:='(lb/ft2)'; label37.Caption:='(lb/ft2)'; label38.Caption:='(mil/h)'; label39.Caption:='(acre)'; label40.Caption:='(lb/acre)';

begin form3.Label1.Caption:='Opening Load cell data file, Please waite....'; form3.Label1.Left:=40; form3.Label1.Font.Color:=clMaroon; form3.Update; form3.show; form3.Update; form1.Update; Memo2.Lines.LoadFromFile(fileopen2.Dialog.FileName); form1.Update; form3.Update; form3.Label1.Left:=48; form3.Label1.Font.Color:=$00804000; form3.Update; form3.Label1.Caption:='Load cell data file opened successfully.'; form3.Update; form1.Update; sleep(600); form3.Close; form1.Update; form1.Update;

for cols := 0 to StringGrid2.ColCount do StringGrid2.Cols[cols].Clear; cols:= 0; end; procedure TForm1.FormDockOver(Sender: TObject; Source: TDragDockObject; X, Y: Integer; State: TDragState; var Accept: Boolean); begin form1.Update; end; procedure TForm1.FormDragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); begin form1.Update; end; procedure TForm1.ComboBox1Change(Sender: TObject); var comboindex:integer; sumdist,AveSpeed,AveYield,Time: real; label stop2;

label42.Caption:='(acre/h)'; label44.Caption:='(acre/h)'; label44.Caption:='(lb/h)';

end;

begin

procedure TForm1.Button9Click(Sender: TObject); begin

combobox1.Enabled:=false; // Disabling Combobox while processing data

label63.Caption:='(mile)'; label64.Caption:='(acre)'; label65.Caption:='(mil/h)'; label66.Caption:='(lb/ft2)'; label67.Caption:='(lb/ft2)'; label68.Caption:='(lb/ft2)';

form2.Show;

label78.Caption:='(mil/h)'; label79.Caption:='(acre)'; label80.Caption:='(lb/acre)';

procedure TForm1.Exit1Click(Sender: TObject); begin form1.Close; end;

label82.Caption:='(acre/h)'; label84.Caption:='(acre/h)'; label85.Caption:='(lb/h)'; end; end; procedure TForm1.FormShow(Sender: TObject); begin spinedit1.text:='20'; memo1.Font.Size:=6; memo2.Font.Size:=6; pagecontrol1.TabIndex:=0; if radiobutton2.Checked then begin label5.Caption:='Swath (cm)'; label32.Caption:='(km)'; label33.Caption:='(hec)'; label34.Caption:='(km/h)'; label35.Caption:='(Kg/m2)'; label36.Caption:='(Kg/m2)'; label37.Caption:='(Kg/m2)'; label38.Caption:='(km/h)'; label39.Caption:='(hec)'; label40.Caption:='(Kg/hec)'; label42.Caption:='(hec/h)'; label44.Caption:='(hec/h)'; label44.Caption:='(Kg/h)'; label63.Caption:='(km)'; label64.Caption:='(hec)'; label65.Caption:='(km/h)'; label66.Caption:='(Kg/m2)'; label67.Caption:='(Kg/m2)'; label68.Caption:='(Kg/m2)'; label78.Caption:='(km/h)'; label79.Caption:='(hec)'; label80.Caption:='(Kg/hec)'; label82.Caption:='(hec/h)'; label84.Caption:='(hec/h)'; label85.Caption:='(Kg/h)'; end; if radiobutton1.Checked then begin label5.Caption:='Swath (ft)'; label32.Caption:='(mile)'; label33.Caption:='(acre)'; label34.Caption:='(mil/h)'; label35.Caption:='(lb/ft2)'; label36.Caption:='(lb/ft2)'; label37.Caption:='(lb/ft2)'; label38.Caption:='(mil/h)'; label39.Caption:='(acre)'; label40.Caption:='(lb/acre)'; label42.Caption:='(acre/h)'; label44.Caption:='(acre/h)'; label44.Caption:='(lb/h)'; label63.Caption:='(mile)'; label64.Caption:='(acre)'; label65.Caption:='(mil/h)'; label66.Caption:='(lb/ft2)'; label67.Caption:='(lb/ft2)'; label68.Caption:='(lb/ft2)'; label78.Caption:='(mil/h)'; label79.Caption:='(acre)'; label80.Caption:='(lb/acre)'; label82.Caption:='(acre/h)'; label84.Caption:='(acre/h)'; label85.Caption:='(lb/h)';

form2.StringGrid3.Cells[0,0]:='Voltage'; form2.StringGrid3.Cells[1,0]:='Mass'; end;

procedure TForm1.New1Click(Sender: TObject); begin form3.Label1.Caption:='Clearing records, Please Waite...'; form3.Label1.Left:=40; form3.Label1.Font.Color:=clMaroon; form3.Update; form3.show; form3.Update; form1.Update; //clearing memo1.Clear; memo2.Clear; edit1.Clear; edit2.Clear; edit3.Clear; edit4.Clear; edit5.Clear; edit6.Clear; edit7.Clear; edit8.Clear; edit9.Clear; edit10.Clear; edit11.Clear; edit12.Clear; edit13.Clear; edit14.Clear; edit15.Clear; edit16.Clear; edit17.Clear; edit18.Clear; edit19.Clear; edit20.Clear; edit21.Clear; edit22.Clear; edit23.Clear; edit24.Clear; edit25.Clear; edit26.Clear; edit27.Clear; edit28.Clear; edit29.Clear; edit30.Clear; edit31.Clear; edit32.Clear; edit33.Clear; edit34.Clear; edit35.Clear; edit36.Clear; edit37.Clear; edit38.Clear; // Clearing table 1 for cols := 0 to StringGrid1.ColCount do begin StringGrid1.Cols[cols].Clear; end; // Clearing table 2 for cols := 0 to StringGrid2.ColCount do begin StringGrid1.Cols[cols].Clear; end; // Clearing table 3 for cols := 0 to StringGrid3.ColCount do begin StringGrid1.Cols[cols].Clear; end; //end of clearing form1.Update; form3.Update; form3.Label1.Left:=60; form3.Label1.Font.Color:=$00804000; form3.Update; form3.Label1.Caption:='Records Cleared successfully.'; form3.Update; form1.Update; form1.Update; sleep(600); form3.Close;

end;

// Clearing table 1 for cols := 0 to StringGrid1.ColCount do StringGrid1.Cols[cols].Clear; cols:= 0;

procedure TForm1.FileOpen2Accept(Sender: TObject);

// Clearing table 2

end;

//Clearing fields edit20.Text:='0'; edit21.Text:='0'; edit22.Text:='0'; edit23.Text:='0'; edit24.Text:='0'; edit25.Text:='0'; edit26.Text:='0'; edit27.Text:='0'; edit28.Text:='0'; edit29.Text:='0'; edit30.Text:='0'; edit31.Text:='0'; edit32.Text:='0'; edit33.Text:='0'; edit34.Text:='0'; edit35.Text:='0'; edit36.Text:='0'; edit37.Text:='0'; edit38.Text:='0'; label58.Caption:=''; //This section just works for GPRMC sentences if stringgrid1.Cells[1,1]='$GPRMC' then //Start of If loop 1 begin //////////////Clearing StringGrid3////////////// // initialization progress bar progressbar1.MAX:=StringGrid3.ColCount; progressbar1.StepBy(-progressbar1.Position); progressbar1.Min:=1; progressbar1.Step:=1; progressbar1.Update; label28.Caption:='Preparing records...'; label28.Update; form1.Update; //////////////Start Clearing table (Stringgrid3) for cols := 0 to StringGrid3.ColCount do //Start of For Loop 0 begin progressbar1.StepBy(1); StringGrid3.Cols[cols].Clear; end; //End of For Loop 0 form1.Update; //////////////End of Clearing table (Stringgrid3) //Writing Labels // Labling Column// stringgrid3.Cells[0,0]:='Wpt'; stringgrid3.Cells[1,0]:='Time'; stringgrid3.Cells[2,0]:='dt'; stringgrid3.Cells[3,0]:='Lat'; stringgrid3.Cells[4,0]:='Long'; stringgrid3.Cells[5,0]:='Distance'; stringgrid3.Cells[6,0]:='Speed'; stringgrid3.Cells[7,0]:='Area'; stringgrid3.Cells[8,0]:='Voltage'; stringgrid3.Cells[9,0]:='Mass'; stringgrid3.Cells[10,0]:='Mass/Sec'; stringgrid3.Cells[11,0]:='Yield'; stringgrid3.Cells[12,0]:='StoppedLat'; stringgrid3.Cells[13,0]:='StoppedLong'; stringgrid3.Cells[14,0]:='TurningLat'; stringgrid3.Cells[15,0]:='TurningLong'; stringgrid3.Cells[16,0]:='StraightLat'; stringgrid3.Cells[17,0]:='StraightLong'; stringgrid3.Cells[18,0]:='MovingLat'; stringgrid3.Cells[19,0]:='MovingLong'; // End of Labling Column //Finding Selected Date rows:=0; //reset rows comboindex:=0; //Variable to find which date is selected if combobox1.ItemIndex=comboindex then begin // initialization progress bar progressbar1.MAX:=stringgrid1.RowCount; progressbar1.StepBy(-progressbar1.Position); progressbar1.Min:=1; progressbar1.Step:=1; progressbar1.Update; label28.Caption:='Processing data, Please wait...'; label28.Update; form1.Update; for rows:=2 to stringgrid1.RowCount-1 do begin

//For Loop 1

progressbar1.StepBy(1); //Date Calculation (only for $GPRMC) stringgrid3.RowCount:=rows+1; //Setting Row Numbers of Stringgrid3 //Printing detailed Statistic for the selected date stringgrid3.Cells[0,rows-1]:=stringgrid2.Cells[0,rows-1]; stringgrid3.Cells[1,rows-1]:=stringgrid2.Cells[1,rows-1]; stringgrid3.Cells[2,rows-1]:=stringgrid2.Cells[2,rows-1]; stringgrid3.Cells[3,rows-1]:=stringgrid2.Cells[3,rows-1]; stringgrid3.Cells[4,rows-1]:=stringgrid2.Cells[4,rows-1]; stringgrid3.Cells[5,rows-1]:=stringgrid2.Cells[5,rows-1]; stringgrid3.Cells[6,rows-1]:=stringgrid2.Cells[6,rows-1];

stringgrid3.Cells[7,rows-1]:=stringgrid2.Cells[7,rows-1]; stringgrid3.Cells[8,rows-1]:=stringgrid2.Cells[8,rows-1]; stringgrid3.Cells[9,rows-1]:=stringgrid2.Cells[9,rows-1]; stringgrid3.Cells[10,rows-1]:=stringgrid2.Cells[10,rows-1]; stringgrid3.Cells[11,rows-1]:=stringgrid2.Cells[11,rows-1];

begin

if strtofloat(stringgrid3.Cells[6,rows-1])>3 then begin

//End of Printing detailed Statistic for the selected date

//If No.1 Starts

inc(gaprows2); //gaprows2:=gaprows2+1;

if strtoint(stringgrid1.Cells[10,rows])-strtoint(stringgrid1.Cells[10,rows1])0 then goto stop2;

if strtofloat(stringgrid3.Cells[6,rows])>3 then begin inc(gaprows2); //gaprows2:=gaprows2+1;

end;//End of For Loop 1 end else begin

//If No.2 Starts

if strtofloat(stringgrid3.Cells[6,rows+1])>3 then begin

stringgrid3.Cells[14,(rows-1)-gaprows]:=stringgrid3.Cells[3,rows+1]; stringgrid3.Cells[15,(rows-1)-gaprows]:=stringgrid3.Cells[4,rows+1]; end else begin inc(gaprows); //gaprows2:=gaprows2+1; gaprows2:=gaprows2-1; //Correcting gaprows2

dayrows:=0; //variable for making StringGrid3 start from first row rows:=0; //reset rows for rows:=2 to stringgrid1.RowCount-1 do //For Loop 2 begin progressbar1.StepBy(1);

end;

end;

if combobox1.ItemIndex=comboindex then begin inc(dayrows); //dayrows:=dayrows+1; //variable for making StringGrid3 start from first row stringgrid3.RowCount:=dayrows+1; //Setting Row Numbers of Stringgrid3

end; end else begin if combobox1.ItemIndex=comboindex then begin inc(dayrows); //dayrows:=dayrows+1; //variable for making StringGrid3 start from first row stringgrid3.RowCount:=dayrows+1; //Setting Row Numbers of Stringgrid3

//If No.3 Ends

end else begin inc(gaprows); //gaprows2:=gaprows2+1;

if strtoint(stringgrid1.Cells[10,rows])-strtoint(stringgrid1.Cells[10,rows1])0 then begin inc(comboindex); //comboindex:=comboindex+1 ;

//Printing detailed Statistic for the selected date stringgrid3.Cells[0,dayrows]:=stringgrid2.Cells[0,rows]; stringgrid3.Cells[1,dayrows]:=stringgrid2.Cells[1,rows]; stringgrid3.Cells[2,dayrows]:=stringgrid2.Cells[2,rows]; stringgrid3.Cells[3,dayrows]:=stringgrid2.Cells[3,rows]; stringgrid3.Cells[4,dayrows]:=stringgrid2.Cells[4,rows]; stringgrid3.Cells[5,dayrows]:=stringgrid2.Cells[5,rows]; stringgrid3.Cells[6,dayrows]:=stringgrid2.Cells[6,rows]; stringgrid3.Cells[7,dayrows]:=stringgrid2.Cells[7,rows]; stringgrid3.Cells[8,dayrows]:=stringgrid2.Cells[8,rows]; stringgrid3.Cells[9,dayrows]:=stringgrid2.Cells[9,rows]; stringgrid3.Cells[10,dayrows]:=stringgrid2.Cells[10,rows]; stringgrid3.Cells[11,dayrows]:=stringgrid2.Cells[11,rows]; //End of Printing detailed Statistic for the selected date

//If No.3 Starts

inc(gaprows2); //gaprows2:=gaprows2+1;

// initialization progress bar progressbar1.MAX:=StringGrid1.RowCount; progressbar1.StepBy(-progressbar1.Position); progressbar1.Min:=1; progressbar1.Step:=1; progressbar1.Update; label28.Caption:='Processing data...'; label28.Update; form1.Update;

//If No.2 Ends

end else begin inc(gaprows); //gaprows:=gaprows+1; //straight points stringgrid3.Cells[16,(rows)-gaprows2]:=stringgrid3.Cells[3,rows-1]; stringgrid3.Cells[17,(rows)-gaprows2]:=stringgrid3.Cells[4,rows-1]; end; //If No.1 Ends end; //End For statement //////*********************END OF Calculating turning time**************************////// { //Turning time algorithm for Dr.Ehsani project for rows:=2 to stringgrid3.RowCount-4 do begin progressbar1.StepBy(1); if strtofloat(stringgrid3.Cells[6,rows-1])>3 then begin inc(gaprows2); //gaprows2:=gaprows2+1; if strtofloat(stringgrid3.Cells[6,rows])>3 then begin inc(gaprows2); //gaprows2:=gaprows2+1; if strtofloat(stringgrid3.Cells[6,rows+1])>3 then begin inc(gaprows2); //gaprows2:=gaprows2+1; stringgrid3.Cells[14,(rows-1)-gaprows]:=stringgrid3.Cells[3,rows+1]; stringgrid3.Cells[15,(rows-1)-gaprows]:=stringgrid3.Cells[4,rows+1];

//Printing detailed Statistic for the selected date stringgrid3.Cells[0,dayrows]:=stringgrid2.Cells[0,rows]; stringgrid3.Cells[1,dayrows]:=stringgrid2.Cells[1,rows]; stringgrid3.Cells[2,dayrows]:=stringgrid2.Cells[2,rows]; stringgrid3.Cells[3,dayrows]:=stringgrid2.Cells[3,rows]; stringgrid3.Cells[4,dayrows]:=stringgrid2.Cells[4,rows]; stringgrid3.Cells[5,dayrows]:=stringgrid2.Cells[5,rows]; stringgrid3.Cells[6,dayrows]:=stringgrid2.Cells[6,rows]; stringgrid3.Cells[7,dayrows]:=stringgrid2.Cells[7,rows]; stringgrid3.Cells[8,dayrows]:=stringgrid2.Cells[8,rows]; stringgrid3.Cells[9,dayrows]:=stringgrid2.Cells[9,rows]; stringgrid3.Cells[10,dayrows]:=stringgrid2.Cells[10,rows]; stringgrid3.Cells[11,dayrows]:=stringgrid2.Cells[11,rows]; //End of Printing detailed Statistic for the selected date

end else begin inc(gaprows); //gaprows2:=gaprows2+1; end; end else begin inc(gaprows); //gaprows2:=gaprows2+1; end; end else begin inc(gaprows); //gaprows:=gaprows+1; //straight points stringgrid3.Cells[16,(rows)-gaprows2]:=stringgrid3.Cells[3,rows-1]; stringgrid3.Cells[17,(rows)-gaprows2]:=stringgrid3.Cells[4,rows-1]; end; end;

end; end; end;

stringgrid3.Cells[19,(rows-1)-gaprows2]:=stringgrid3.Cells[4,rows-1]; end;

progressbar1.StepBy(1);

//End of For Loop 2

end; stop2:

//End of Turning tima Calculation for the selected date////

progressbar1.Max:=progressbar1.Position; progressbar1.Update; combobox1.Enabled:=true; /////////////////DAYYYYYYYYYYYYY///////////////

}

end else begin showmessage('No $GPRMC data found.'); end; //End of If loop 1 ///////////////////////Calculating turning time for selected day////////////////////////// ///////////////////////////////////////////////////////////////////// ///////////////////// // initialization progress bar 1 progressbar1.StepBy(-progressbar1.Position); progressbar1.Min:=1; progressbar1.MAX:=stringgrid3.RowCount-4; progressbar1.Step:=1; progressbar1.Update; label28.Caption:='Processing Turning time...'; label28.Update; form1.Update; // End of initialization progress bar 1 rows:=0; gaprows:=0; gaprows2:=0; for rows:=2 to stringgrid3.RowCount-4 do

//Start For statement

////Caclulating stop time for the selected date//// rows:=0; gaprows:=0; gaprows2:=0; // initialization progress bar 1 progressbar1.StepBy(-progressbar1.Position); progressbar1.Min:=1; progressbar1.MAX:=stringgrid3.RowCount-1; progressbar1.Step:=1; progressbar1.Update; label28.Caption:='Processing Stop time...'; label28.Update; form1.Update; // End of initialization progress bar 2 for rows:=2 to stringgrid3.RowCount-1 do begin progressbar1.StepBy(1); if strtofloat(stringgrid3.Cells[5,rows-1])strtofloat(edit26.Text) then edit26.Text:=stringgrid3.Cells[10,rows]; //Max Yield if strtofloat(stringgrid3.Cells[10,rows])

Suggest Documents