static bool LoadZonesFromProfile(string profile) { try { _jaco.ConfigurationsManager.DeserializeZoneConfiguration(profile); Console.WriteLine(_info + "Loaded zone configuration from profile \"" + profile + "\"."); Console.WriteLine(_info + "You will need to reboot the robot for changes to take effect."); _zones = _jaco.ConfigurationsManager.GetProtectionZones(); PrintZones(); return(true); } catch (Exception) { Console.WriteLine(_error + "Could not load zone configuration from profile \"" + profile + "\"."); } return(false); }
static void Main(string[] args) { bool dll = args.Length > 0 && String.Compare(args[0], "dll") == 0; if (dll) { _error = "#ERROR [JACO]: "; _info = "#INFO [JACO]: "; _warning = "#WARNING [JACO]: "; } try { _jaco = new CJacoArm(Crypto.GetInstance().Encrypt("C6H12O6h2so4")); Console.WriteLine(_info + "Successfully connected to Jaco."); } catch (CAccessDeniedException) { Console.WriteLine(_error + "Access to Jaco denied. Please check password and USB connection."); return; } catch (Exception) { Console.WriteLine(_error + "Could not connect to Jaco."); return; } _cmd = new CJoystickValue(); _zones = _jaco.ConfigurationsManager.GetProtectionZones(); _jaco.ControlManager.StartControlAPI(); _api = true; _data = new float[37]; for (int i = 0; i < 37; i++) { _data[i] = 0f; } if (dll) { Console.WriteLine(_info + "Active protection zones: " + _zones.NbZoneActive); return; } TerminalCommand(args); Deinit(); }
static void Main (string[] args) { bool dll = args.Length > 0 && String.Compare(args[0], "dll") == 0; if (dll) { _error = "#ERROR [JACO]: "; _info = "#INFO [JACO]: "; _warning = "#WARNING [JACO]: "; } try { _jaco = new CJacoArm(Crypto.GetInstance().Encrypt("C6H12O6h2so4")); Console.WriteLine(_info + "Successfully connected to Jaco."); } catch (CAccessDeniedException) { Console.WriteLine(_error + "Access to Jaco denied. Please check password and USB connection."); return; } catch (Exception) { Console.WriteLine(_error + "Could not connect to Jaco."); return; } _cmd = new CJoystickValue(); _zones = _jaco.ConfigurationsManager.GetProtectionZones(); _jaco.ControlManager.StartControlAPI(); _api = true; _data = new float[37]; for (int i=0; i<37; i++) _data[i] = 0f; if (dll) { Console.WriteLine(_info + "Active protection zones: " + _zones.NbZoneActive); return; } TerminalCommand(args); Deinit(); }
static bool LoadZonesFromProfile (string profile) { try { _jaco.ConfigurationsManager.DeserializeZoneConfiguration(profile); Console.WriteLine(_info + "Loaded zone configuration from profile \"" + profile + "\"."); Console.WriteLine(_info + "You will need to reboot the robot for changes to take effect."); _zones = _jaco.ConfigurationsManager.GetProtectionZones(); PrintZones(); return true; } catch (Exception) { Console.WriteLine(_error + "Could not load zone configuration from profile \"" + profile + "\"."); } return false; }