Esempio n. 1
0
        public void IsRunningTestMethod()
        {
            var result = PythonVisionQueries.IsRunning().Result;

            Assert.IsNotNull(result);
            Assert.IsTrue(result);
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            var isRunningResult = PythonVisionQueries.IsRunning().Result;

            var settingsResult = PythonVisionQueries.GetSettings().Result;

            Console.WriteLine("Running..." + ": " + isRunningResult);
            Console.WriteLine("*****************************************************");

            /* foreach (KeyValuePair<string, object> setting in settingsResult)
             * {
             *  Console.WriteLine("Key :{0}, Value: {1}", setting.Key, setting.Value);
             * } */


            IDictionary <string, object> results = new Dictionary <string, object>();

            results.Add("hard", false);

            var resetSettingsResult = PythonVisionQueries.ResetSettings(results).Result;

            Console.WriteLine("Reset Result: " + resetSettingsResult);
            Console.WriteLine("*****************************************************");



            IDictionary <string, object> savesettingsresults = new Dictionary <string, object>();

            savesettingsresults.Add("filename", null);

            var saveSettingsResult = PythonVisionQueries.SaveSettings(savesettingsresults).Result;

            foreach (KeyValuePair <string, object> setting in saveSettingsResult)
            {
                Console.WriteLine("Key :{0}, Value: {1}", setting.Key, setting.Value);
            }

            Console.WriteLine("*****************************************************");

            IDictionary <string, object> loadsettingsresults = new Dictionary <string, object>();

            loadsettingsresults.Add("filename", null);

            var loadSettingsResult = PythonVisionQueries.LoadSettings(loadsettingsresults).Result;

            foreach (KeyValuePair <string, object> setting in loadSettingsResult)
            {
                Console.WriteLine("Key :{0}, Value: {1}", setting.Key, setting.Value);
            }

            Console.WriteLine("*****************************************************");

            var getStatus = PythonVisionQueries.GetStatus().Result;

            foreach (KeyValuePair <string, object> stats in getStatus)
            {
                Console.WriteLine("Key :{0}, Value: {1}", stats.Key, stats.Value);
            }


            Console.WriteLine("*****************************************************");
            var getIndexerRunningResult = PythonVisionQueries.GetIndexerRunning().Result;

            Console.WriteLine("Get Indexer Running: " + getIndexerRunningResult);


            Console.WriteLine("*****************************************************");
            var indexerLiveStreamResult = PythonVisionQueries.IndexerLiveStream(1).Result;

            Console.WriteLine("HTML" + indexerLiveStreamResult);

            Console.WriteLine("*****************************************************");

            var indexerLivestreamEnabledResults = PythonVisionQueries.IndexerLivestreamEnabled().Result;

            foreach (KeyValuePair <string, object> stats in indexerLivestreamEnabledResults)
            {
                Console.WriteLine("Key :{0}, Value: {1}", stats.Key, stats.Value);
            }

            Console.WriteLine("*****************************************************");

            IDictionary <string, object> livestreamEnableObj = new Dictionary <string, object>();

            livestreamEnableObj.Add("enable", false);
            var indexerLivestreamEnabledPostResults = PythonVisionQueries.IndexerLivestreamEnabledPost(livestreamEnableObj).Result;

            foreach (KeyValuePair <string, object> stats in indexerLivestreamEnabledPostResults)
            {
                Console.WriteLine("Key :{0}, Value: {1}", stats.Key, stats.Value);
            }


            Console.WriteLine("*****************************************************");
            IDictionary <string, object> resetCameraIndexerResults = new Dictionary <string, object>();

            resetCameraIndexerResults.Add("hard", false);
            var resetCameraIndexerResult = PythonVisionQueries.ResetCameraIndexer(resetCameraIndexerResults).Result;

            Console.WriteLine("Reset Camera Result: " + resetCameraIndexerResult);

            Console.WriteLine("*****************************************************");
            /*******************/

            var getDetectProfileRunningStatus = PythonVisionQueries.DetectProfileRunning().Result;

            Console.WriteLine("Get Detect Profile Running: " + getDetectProfileRunningStatus);
            Console.WriteLine("*****************************************************");

            var omronLiveStreamResult = PythonVisionQueries.OmronLiveStream(2).Result;

            Console.WriteLine("HTML" + omronLiveStreamResult);

            Console.WriteLine("*****************************************************");
            var omronLivestreamEnabledResults = PythonVisionQueries.OmronLivestreamEnabled().Result;

            foreach (KeyValuePair <string, object> stats in omronLivestreamEnabledResults)
            {
                Console.WriteLine("Key :{0}, Value: {1}", stats.Key, stats.Value);
            }
            Console.WriteLine("*****************************************************");

            IDictionary <string, object> livestreamEnableObjOmron = new Dictionary <string, object>();

            livestreamEnableObjOmron.Add("enable", false);
            var omronLivestreamEnabledPostResults = PythonVisionQueries.OmronLivestreamEnabledPost(livestreamEnableObjOmron).Result;

            foreach (KeyValuePair <string, object> stats in omronLivestreamEnabledPostResults)
            {
                Console.WriteLine("Key :{0}, Value: {1}", stats.Key, stats.Value);
            }
            Console.WriteLine("*****************************************************");

            IDictionary <string, object> resetCameraOmronResults = new Dictionary <string, object>();

            resetCameraOmronResults.Add("hard", false);
            var resetCameraOmronResult = PythonVisionQueries.ResetCameraOmron(resetCameraOmronResults).Result;

            Console.WriteLine("Reset Camera Result: " + resetCameraOmronResult);

            /*******************/

            Console.WriteLine("*****************************************************");
            var getOmronRunningStatus = PythonVisionQueries.OmronIsRunning().Result;

            Console.WriteLine("Get Omron Running: " + getOmronRunningStatus);
            Console.WriteLine("*****************************************************");

            var roboteoatLiveStreamResult = PythonVisionQueries.RobotEOATLiveStream(3).Result;

            Console.WriteLine("HTML" + roboteoatLiveStreamResult);
            Console.WriteLine("*****************************************************");

            var roboteoatLivestreamEnabledResults = PythonVisionQueries.RobotEoatLivestreamEnabled().Result;

            foreach (KeyValuePair <string, object> stats in roboteoatLivestreamEnabledResults)
            {
                Console.WriteLine("Key :{0}, Value: {1}", stats.Key, stats.Value);
            }
            Console.WriteLine("*****************************************************");

            IDictionary <string, object> livestreamEnableObjRobotEoat = new Dictionary <string, object>();

            livestreamEnableObjRobotEoat.Add("enable", true);
            var roboteoatLivestreamEnabledPostResults = PythonVisionQueries.RobotEOATLivestreamEnabledPost(livestreamEnableObjRobotEoat).Result;

            foreach (KeyValuePair <string, object> stats in roboteoatLivestreamEnabledPostResults)
            {
                Console.WriteLine("Key :{0}, Value: {1}", stats.Key, stats.Value);
            }
            Console.WriteLine("*****************************************************");

            IDictionary <string, object> resetCameraRobotEoatResults = new Dictionary <string, object>();

            resetCameraRobotEoatResults.Add("hard", false);
            var resetCameraRobotEOATResult = PythonVisionQueries.ResetCameraRobotEoat(resetCameraRobotEoatResults).Result;

            Console.WriteLine("Reset Camera Result: " + resetCameraRobotEOATResult);
            Console.WriteLine("*****************************************************");
            /***************************/

            var getDetectDrawerBottlesnRunningStatus = PythonVisionQueries.DetectDrawerBottlesIsRunning().Result;

            Console.WriteLine("Get Detect Drawer Bottles Running: " + getDetectDrawerBottlesnRunningStatus);
            Console.WriteLine("*****************************************************");

            Console.ReadKey();
        }