示例#1
0
        public void Run()
        {
            Console.WriteLine($"\nDeleting all favorites");
            DeleteAllFavorites();
            Console.WriteLine($"\nNumber of favorite IDs (should be 0): {GetFavoriteIds().Count}");

            var settings = api.GetCurrentSettings();

            settings["id"]       = 5;
            settings["duration"] = 2;
            settings["notes"]    = "Favorite settings stored in ID slot 5";

            SaveFavorite(settings);
            Console.WriteLine("\nSaved settings in ID slot 5");

            settings = api.GetCurrentSettings();

            settings["id"]       = 3;
            settings["duration"] = 4;
            settings["notes"]    = "Favorite settings stored in ID slot 3";

            SaveFavorite(settings);
            Console.WriteLine("\nSaved settings in ID slot 3");

            Console.WriteLine($"\nSaved favorite ID list: {string.Join(", ", GetFavoriteIds())}");

            settings = GetFavorite("5");
            var allowedSettings = api.ConfigureCamera(settings);

            api.Run(allowedSettings);
            Console.WriteLine("\nRetreived favorite settings 5 and configured the camera using those settings");

            DeleteFavorite("3");
            Console.WriteLine("\nDeleted previously save favorite in ID slot 3");
            Console.WriteLine($"\nSaved favorite ID list: {string.Join(", ", GetFavoriteIds())}");
        }
示例#2
0
        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);
        }