<= Back to ecpSE
#   ecpSE 0.3a application file [ecpSEa]
#   generated by ecpSE Fri Nov 17 14:33:50 2000
#   (C) ecp 2000
#   written by douglas savitsky <dsavitsk@e-coli.net>
#   for help/documentation please visit: -> http://www.e-coli.net
    
#   ecpSE is distributed under the GNU General Public License, Version 2, 6/91.
#   This program is distributed without any warranty; without even the implied
#   warranty of merchantability or fitness for a particular purpose.  For a copy
#   of the GNU General Public License, visit: -> http://www.gnu.org
#   or write:
#        Free Software Foundation, Inc.
#        675 Mass Ave.
#        Cambridge, MA 02139

#   [Many of this program's functions require NCS ScanTools 2.x for Windows and or
#   SFWLink 1.2.  These must be licensed independently from NCS, Inc.
#   for information visit: -> http://www.ncs.com]

from ecpSE import ecpSEi
from Tkinter import mainloop

if __name__ == '__main__':
    
    a_info = {}
    a_info['title'] = '<- ecpSEa 0.3a ->'
    a_info['db_obj'] = 'ADO25'                  # Sets which database object to use. Options are 'ADO25', 'DAO36', and DAO35'.
    a_info['db_name'] = 'F:/ecpsea_test.mdb'    # Name & directory for the Database [notice the syntax!]
    a_info['rs_name'] = '[Field Types]'         # Name of recordset (ADO needs [] around it, DAO does not)
    a_info['dsn'] = 'PROVIDER=Microsoft.Jet.OLEDB.4.0;Data SOURCE=F:/ecpsea_test.mdb;' # edit for different dsn-less or dsn options, blank ('') for DAO

    # Parameters to be passed to sfwlnk32.dll via ecp_lnk.dll
    # Edit these to change the scanner's configuration.
    a_info['sfw_sds'] = '701'                   # sfw .sds application number
    a_info['sfw_path'] = 'C:\SFW'               # path to SFW
    a_info['sfw_sn'] = '000001'                 # serial number
    a_info['sfw_bn'] = '001'                    # batch number
    a_info['sfw_run'] = '1'                     # run number
    a_info['sfw_nmt'] = 'N'                     # normal mark threshold
    a_info['sfw_mmt'] = 'M'                     # medium mark threshold
    a_info['sfw_pn'] = 'N'                      # print serial and date option
    a_info['sfw_pp'] = '1'                      # start print position
    a_info['sfw_epr'] = ''                      # edit profile -> not used by ecpSEa
    a_info['sfw_spr'] = ''                      # scoring profile -> not used by ecpSEa
    a_info['sfw_cpr'] = ''                      # conversion profile -> not used by ecpSEa

    input = open('ParamList.txt', 'r')          # Gathering data from ParamList.txt, and ...
    strFile = input.read()  
    input.close()
    y = ecpSEi.ResolveFields()                  # ... sending it to be resolved by ecpSEi.
    db_fields = y.fields(strFile)
    
    x = ecpSEi.StartUp()                        # Shows StartUp information
    x = ecpSEi.CreateVariables()                # Creates Variables/Entry Widgets etc.
    flds = x.vars(db_fields)                    # 
    ecpSEi.Interface(flds, a_info)              # __init__s the interface 
    mainloop()