3.3.3.4. Step 4 -Import ETMS flight file
Considering that the ETMS application provides data with format almost identical with AERO2K data for the flight legs, the fligh_chord text file importing is one-step operation:
'--------------------------------------------------------------------------------
DoCmd.TransferText acImportDelim, "ETMS Flight Import Specification", "ETMS_ImportedFlight", FileName, False, ""
'--------------------------------------------------------------------------------
The "ETMS Flight Import Specification" is a predefined mode to import the ETMS flight text file, which’s path\name is stored in the FileName variable. This specification
selects from the text file only the fields that the AERO2K needs and also defines each one’s date type (cf. Table 56).
The state of the flight table after this step is not final. Some modification will take place after executing the following steps, like modifying the TrafficId for each leg to link the legs with their corresponding heads, updating the flight legs that belong to the same flight but they have the same event time, converting the date/time fields' values to GMT time, inserting new legs for the flights that pass the midnight or even calculating the average speed and climb/descent rate for each two consecutive flight legs that belong to the same flight.
3.3.3.5. Step 5 - Link the two imported tables
This step is the most important step of the importing procedure. It links the flight heads with the flight legs. Table 61 shows how ETMSTraffic and ETMSFlight tables are linked:
The linking procedure consists of 8 sub steps:
3.3.3.5.1. Sub step 5.1 - Delete inconsistent records from traffic table For each importing procedure, the user must select a certain date for importing, because ETMS application exports data for one or several days. To select the date, the user will update a textbox on the importing interface (date/time format: yyyy-mm-dd). This date will be used after in the linking step or in some other steps. The inconsistent data in the traffic file are data that do not belong to the selected date. If a flight ends before the selected date or begins after this date, then that flight will be deleted (only the flight head because the flight legs are not linked yet and they can not be found to be deleted) without saving it into the inconsistent flight table (ETMS_InconsistentTraffic). The deletion query SQL code is:
'------------------------------------------------------------------------------
DELETE * FROM ETMSTraffic WHERE ((([ETMSTraffic].[MaxStopTime])<CDate([Forms]![ImportETMS]![txImportDate]))) Or ((([ETMSTraffic].[DepartureTime])>=DateAdd('d',1,[Forms]![ImportETMS]![txImpo rtDate])));
'------------------------------------------------------------------------------
After executing this sub step, the traffic table will have only flights that belong to the same date (the departure date or the arrival date is the same as the selected date). 中国航空网 www.aero.cn 航空翻译 www.aviation.cn 本文链接地址:AERO2K Flight Movement Inventory Project Report(60)