コード例 #1
0
ファイル: CamAplExample.cs プロジェクト: gharley/CamApi
        public CamApiExample(IConfiguration configuration)
        {
            DoCaptureTest      = configuration["CaptureTest"] == "1";
            DoFavoritesTest    = configuration["FavoritesTest"] == "1";
            DoMultiCaptureTest = configuration["MultiCaptureTest"] == "1";

            api = new CamApiLib(configuration["Address"], configuration["Debug"] == "1");
        }
コード例 #2
0
ファイル: Extensions.cs プロジェクト: gharley/CamApi
        private static void DoTriggerCamera(CamApiLib api, string message, string baseFilename = null)
        {
            Console.WriteLine("    Triggering camera");

            var status = api.Trigger(baseFilename);

            if (status == CAMAPI_STATUS.OKAY)
            {
                Console.WriteLine($"    {message}");
            }
            else
            {
                Console.WriteLine("    Error: Trigger() returned {status}");
                Environment.Exit(1);
            }

            Thread.Sleep(1000); // takes camera time to process the trigger request
            api.ExpectState(CAMERA_STATE.TRIGGERED);
        }
コード例 #3
0
ファイル: Extensions.cs プロジェクト: gharley/CamApi
        private static void DoRunCamera(CamApiLib api, CamDictionary allowedSettings, string message)
        {
            api.ExpectRunningState();

            if (!string.IsNullOrEmpty(message))
            {
                Console.WriteLine(message);
            }
            Console.WriteLine("    Calibrating camera using allowed settings");

            CAMAPI_STATUS status = api.Run(allowedSettings);

            if (status == CAMAPI_STATUS.OKAY)
            {
                Console.WriteLine("    Run started");
            }
            else
            {
                Console.WriteLine("    Error: Run() returned {status}");
                Environment.Exit(1);
            }

            api.ExpectState(CAMERA_STATE.RUNNING);
        }
コード例 #4
0
ファイル: CaptureTests.cs プロジェクト: gharley/CamApi
 public CaptureTests(CamApiLib api)
 {
     this.api = api;
 }
コード例 #5
0
ファイル: FavoritesTests.cs プロジェクト: gharley/CamApi
 public FavoritesTests(CamApiLib api)
 {
     this.api = api;
 }
コード例 #6
0
ファイル: Extensions.cs プロジェクト: gharley/CamApi
 public static void TriggerCamera(this MultiCaptureTests _this, CamApiLib api, string message, string baseFilename = null)
 {
     DoTriggerCamera(api, message, baseFilename);
 }
コード例 #7
0
ファイル: Extensions.cs プロジェクト: gharley/CamApi
 public static void RunCamera(this MultiCaptureTests _this, CamApiLib api, CamDictionary allowedSettings, string message)
 {
     DoRunCamera(api, allowedSettings, message);
 }