/[gr2lib]/trunk/gr2lib_UnitTest/Program.cs
ViewVC logotype

Diff of /trunk/gr2lib_UnitTest/Program.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 69 by william, Thu Jul 15 09:29:25 2010 UTC revision 70 by william, Thu Jul 15 12:55:21 2010 UTC
# Line 3  using System.Collections.Generic; Line 3  using System.Collections.Generic;
3  using System.Text;  using System.Text;
4    
5  using gr2lib.core;  using gr2lib.core;
6    //using gr2lib.core.coretypes;
7  using gr2lib.core.apiversion;  using gr2lib.core.apiversion;
8  using gr2lib.core.exceptions;  using gr2lib.core.exceptions;
9  using gr2lib.core.helpers;  using gr2lib.core.helpers;
10    using gr2lib.core.coretypes.implementation;
11    
12  namespace gr2lib_UnitTest  namespace gr2lib_UnitTest
13  {  {
# Line 17  namespace gr2lib_UnitTest Line 19  namespace gr2lib_UnitTest
19              string GrannyFilename = shared.GRANNY_TEST_FILE;              string GrannyFilename = shared.GRANNY_TEST_FILE;
20              try              try
21              {              {
22                    #region Check Granny2 API Version
23                  // Setup access to check loaded Granny2 API Version                  // Setup access to check loaded Granny2 API Version
24                  granny2apiversion apiversion = new granny2apiversion(shared.EXPECTED_API_VERSION);                  granny2apiversion apiversion = new granny2apiversion(shared.EXPECTED_API_VERSION);
25    
# Line 35  namespace gr2lib_UnitTest Line 38  namespace gr2lib_UnitTest
38                      // the loaded version matches                      // the loaded version matches
39                      Console.WriteLine("Loaded granny2.dll: " + apiversion.apiversion.version);                      Console.WriteLine("Loaded granny2.dll: " + apiversion.apiversion.version);
40                  }                  }
41                                    #endregion
42                  // parse commandline  
43                    #region Parse Commandline
44                  if (args.Length == 1)                  if (args.Length == 1)
45                  {                  {
46                      GrannyFilename = args[0];                      GrannyFilename = args[0];
# Line 54  namespace gr2lib_UnitTest Line 58  namespace gr2lib_UnitTest
58                  {                  {
59                      throw new System.IO.FileNotFoundException("Unable to find: " + GrannyFilename);                      throw new System.IO.FileNotFoundException("Unable to find: " + GrannyFilename);
60                  }                  }
61                    #endregion
62    
63                    #region test
64                    unsafe
65                    {
66    
67    
68                                        grnfileinfo info = grnfileinfo.ReadFromFile(GrannyFilename);
69    
70                        Console.WriteLine();
71                        Console.WriteLine("Art Tool Data:");
72                        Console.WriteLine("\tTool Name: " + info.ArtToolInfo.FromArtToolName);
73                        Console.WriteLine("\tTool Version: " + string.Format("{0}.{1}", info.ArtToolInfo.ArtToolMajorRevision, info.ArtToolInfo.ArtToolMinorRevision));
74                        Console.WriteLine("\tTool Units Per Meter: " + info.ArtToolInfo.UnitsPerMeter);
75    
76                        Console.WriteLine("\tTool Origin: " + string.Format("[{0},{1},{2}]", info.ArtToolInfo.Origin.X, info.ArtToolInfo.Origin.Y, info.ArtToolInfo.Origin.Z));
77                        Console.WriteLine("\tTool Right: " + string.Format("[{0},{1},{2}]", info.ArtToolInfo.Right.X, info.ArtToolInfo.Right.Y, info.ArtToolInfo.Right.Z));
78                        Console.WriteLine("\tTool Up: " + string.Format("[{0},{1},{2}]", info.ArtToolInfo.Up.X, info.ArtToolInfo.Up.Y, info.ArtToolInfo.Up.Z));
79                        Console.WriteLine("\tTool Back: " + string.Format("[{0},{1},{2}]", info.ArtToolInfo.Back.X, info.ArtToolInfo.Back.Y, info.ArtToolInfo.Back.Z));
80    
81                        Console.WriteLine("\tTool ExtendedData: " + info.ArtToolInfo.ExtendedData);
82                    }
83                    #endregion
84    
85              }              }
86              catch (granny2apiloadexception ex)              catch (granny2apiloadexception ex)
# Line 70  namespace gr2lib_UnitTest Line 94  namespace gr2lib_UnitTest
94          }          }
95      }      }
96  }  }
97    

Legend:
Removed from v.69  
changed lines
  Added in v.70

  ViewVC Help
Powered by ViewVC 1.1.22