|
|
|
|
[Home][26 ImageFinder for DOS][26.8 Implementation]
|
|
26.8 Implementation the ProjectThe implementation is fairly straightforward. The first thing to do is to read the argument, which determines which batch file is to be used. This argument can be 1, 2, 3, 4, or 5. Then it will call the run function in the Dos object. The algorithm is: Step 1. Object d70 The project first creates an object, d70. If this object cannot be created, the program terminates. Step 2. Argument The project will then find the argument, which determines the batch file to be used. If there is any error, it will use the default 1. Step 3. Data Files. If you use the command: C:\>�\chap26 1 You will need the following files: Abm70.txt Bf70.txt Bf270.txt Nf70.txt Nf270.txt Tp70.txt These text files are used by the ImageFinder for Dos and are stored in the �.\data\� folder. If you did not change the installation folder, it is: �c:\transapplet70\ transapplet70.chap26\bin\Debug\data�. Before you can run the Dos version, you must prepare these files using the Windows version for your application.
Step 4. Code class Class1 { static string sCode = "0"; static void Main(string[] args) { Attrasoft.TransApplet70.Dos70.Dos70 d70; try { d70 = new Attrasoft.TransApplet70.Dos70.Dos70 (); } catch (Exception ee) { Console.Write (ee.ToString () ); return; }
int theCode = 0; if (args.Length == 0 ) theCode = 0; else { sCode = args[0]; theCode = getCode (); } Console.WriteLine ("Batch Option " + theCode );
try { bool b = d70.ImageFinderForDos (theCode ) ; Console.Write ( d70.toString () ); if ( !b ) Console.Write ( "ImageFinder for Dos fails!" ); } catch (Exception ee) { Console.Write (ee.ToString () ); } }
static int getCode ( ) { int i = 0; try { i = int.Parse (sCode); } catch { Console.WriteLine ("Invalid args!"); return 0; } if ( (i>=0 ) && (i <= 5 ) ) return i; return 0; } } The first section, d70 = new Attrasoft.TransApplet70.Dos70.Dos70 (); creates a Dos object. The second section, sCode = args[0]; theCode = getCode (); (which calls int.Parse (sCode) ) gets the �Command Line Arguments�. The last section, bool b = d70.ImageFinderForDos (theCode ) ; calls the dos command.
[Home][About][1 Introduction][2 Image Recognition][3 TransApplet][4 API][5 Interface][6 Input][7 Image Display][8 Preprocessing][9 Processing][10 Normalization][11 Parameter Class][12 Image Signatures][13 Unsupervised Filters][14 BioFilters][15 NeuralFilters][16 Dynamic Library][17 NeuralNet Filter][18 Parameters][19 Input Options][20 Database Input][21 Video Input][22 Live Video Input][23 Counting & Tracking][24 Counting ][25 Batch Job][26 ImageFinder for DOS][27 ImageHunt ][28 Support Packages]
Copyright (c) 2006 - 2007 Attrasoft. All rights reserved. |