public void NextMission() { index++; if (index < mission_List.Count) { //txIndex.text = (index + 1).ToString(); txLog.text = mission_List[index].Log; //print(CommandScripts.MissionDo(mission_List[index], AccelerationRate, SpeedRate)); if (mission_List[index].IOindex == -1) { URController.Send_command(CommandScripts.MissionDo(mission_List[index], AccelerationRate, SpeedRate)); } else if (mission_List[index].IOindex == -2)//直线运动命令 { URController.Send_command(CommandScripts.MissionDodirect(mission_List[index], AccelerationRate, SpeedRate)); } else if (mission_List[index].IOindex == 2) { StartCoroutine(Ning()); } else { StartCoroutine(IOProcess(mission_List[index].IOindex)); } } else { txLog.text = "任务执行完毕"; btnNext.interactable = false; } }
IEnumerator FollowProcess() { URController.Send_command(CommandScripts.MoveTCP("X", -1, AccelerationRate, 0.001056)); for (int i = 100; i > 0; i--) { txCutTips.text = "剥线中\n"; txCutTips.text += i.ToString() + "s"; TipsColorChange(i); yield return(new WaitForSeconds(1)); } //for (int i = 6; i > 0; i--) //{ // URController.Send_command(CommandScripts.MissionDo(mission_List[index], AccelerationRate, 0.0025)); // for (int j = 0; j < 17; j++) // { // txCutTips.text = "剥线中\n"; // txCutTips.text += (i*17-j).ToString() + "s"; // TipsColorChange(i * 17 - j); // yield return new WaitForSeconds(1); // } // index++; //} URController.Send_command(CommandScripts.MoveStop()); index++; StartCoroutine(ReleaseProcess()); }
// Update is called once per frame void Update() { if (!leftIO.Monitor()) { if (!flag_IOClose) { //print(CommandScripts.IO(leftIO.chosenIndex,false)); URController.Send_command(CommandScripts.IO(leftIO.chosenIndex, false)); flag_IOClose = true; } } else { flag_IOClose = false; } //rightIO.Monitor(); for (int i = 0; i < 6; i++) { axises[i].PosSet = temp_Pos[i]; } Button btnConnect = GameObject.Find("btnConnect").GetComponent <Button>(); if (URController.isConnect) { btnConnect.interactable = false; } }
IEnumerator IOProcess(int IO_index) { URController.Send_command(CommandScripts.IO(IO_index, true)); yield return(new WaitForSeconds(1)); URController.Send_command(CommandScripts.IO(IO_index, false)); }
public void btnAxisMove(int index) { if (index % 10 == 0) { URController.Send_command(CommandScripts.MoveAxis(index / 10 - 1, -1, AccelerationRate, SpeedRate, current_Pos)); } else { URController.Send_command(CommandScripts.MoveAxis(index / 10 - 1, 1, AccelerationRate, SpeedRate, current_Pos)); } }
IEnumerator FollowProcess() { URController.Send_command(CommandScripts.MoveTCP("X", 1, AccelerationRate, 0.001167)); for (int i = 90; i > 0; i--) { txCutTips.text = "剥线中\n"; txCutTips.text += i.ToString() + "s"; TipsColorChange(i); yield return(new WaitForSeconds(1)); } URController.Send_command(CommandScripts.MoveStop()); StartCoroutine(ReleaseProcess()); }
IEnumerator Ning() { URController.Send_command(CommandScripts.IO(2, true)); yield return(new WaitForSeconds(1)); URController.Send_command(CommandScripts.IO(2, false)); yield return(new WaitForSeconds(3)); URController.Send_command(CommandScripts.IO(3, true)); yield return(new WaitForSeconds(1)); URController.Send_command(CommandScripts.IO(3, false)); }
//下一步任务按钮 public void NextMission() { index++; if (index < mission_List.Count) { //显示任务细节文本 //txIndex.text = (index + 1).ToString(); txLog.text = mission_List[index].Log; //print(CommandScripts.MissionDo(mission_List[index], AccelerationRate, SpeedRate)); if (mission_List[index].IOindex == -1)//运动命令 { URController.Send_command(CommandScripts.MissionDo(mission_List[index], AccelerationRate, SpeedRate)); } else if (mission_List[index].IOindex == -2)//直线运动命令 { URController.Send_command(CommandScripts.MissionDodirect(mission_List[index], AccelerationRate, SpeedRate)); } else if (mission_List[index].IOindex == 100)//剥线任务 { BoMission = mission_List[index]; StartCoroutine(GetReady()); } else if (mission_List[index].IOindex == 2)//拧螺栓任务 { StartCoroutine(Ning()); } else//其余都是普通IO开/关 { StartCoroutine(IOProcess(mission_List[index].IOindex)); //if (fileName == "ningluoshuan.xml")//抓取工具 // ShowTool(mission_List[index].IOindex, 1); //else // ShowTool(mission_List[index].IOindex, 0); } } else { txLog.text = "任务执行完毕"; btnNext.interactable = false; } }
public void NextMission() { index++; if (index < mission_List.Count) { txIndex.text = (index + 1).ToString(); txLog.text = mission_List[index].Log; //print(CommandScripts.MissionDo(mission_List[index], AccelerationRate, SpeedRate)); if (mission_List[index].IOindex == -1) { URController.Send_command(CommandScripts.MissionDo(mission_List[index], AccelerationRate, SpeedRate)); } else if (mission_List[index].IOindex == 100) { BoMission = mission_List[index]; StartCoroutine(GetReady()); } else if (mission_List[index].IOindex == 2) { StartCoroutine(Ning()); } else { StartCoroutine(IOProcess(mission_List[index].IOindex)); if (fileName == "fangxianjia.xml") { ShowTool(mission_List[index].IOindex, 0); } else { ShowTool(mission_List[index].IOindex, 1); } } } else { txLog.text = "任务执行完毕"; btnNext.interactable = false; } }
public void btnNextMission() { index++; if (index < mission_List.Count) { txIndex.text = (index + 1).ToString(); txLog.text = mission_List[index].Log; //print(CommandScripts.MissionDo(mission_List[index], AccelerationRate, SpeedRate)); if (mission_List[index].IOindex == -1) { URController.Send_command(CommandScripts.MissionDo(mission_List[index], AccelerationRate, SpeedRate)); } else { toggleIO(mission_List[index].IOindex); } } else { txLog.text = "任务执行完毕"; Button btnNext = URMissionList.transform.Find("btnNextMission").GetComponent <Button>(); btnNext.interactable = false; } }
public static void Initialize() { var entryDirectory = GetEntryDirectory() + "\\"; // スクリプト読み込み System.IO.Directory.CreateDirectory(entryDirectory + "scripts"); System.IO.Directory.CreateDirectory(entryDirectory + "scripts/import"); System.IO.Directory.CreateDirectory(entryDirectory + "scripts/export"); System.IO.Directory.CreateDirectory(entryDirectory + "scripts/command"); System.IO.Directory.CreateDirectory(entryDirectory + "scripts/selected"); Script.Compiler.Initialize(); { var files = System.IO.Directory.GetFiles(entryDirectory + "scripts/command", "*.*", System.IO.SearchOption.AllDirectories); foreach (var file in files) { var ext = System.IO.Path.GetExtension(file); if (ext == ".cs" || ext == ".py") { Script.CommandScript script = null; string error = string.Empty; if (Script.Compiler.CompileScript <Script.CommandScript>(file, out script, out error)) { CommandScripts.Add(script); } else { if (OnOutputMessage != null) { OnOutputMessage(error); } } } } } { var files = System.IO.Directory.GetFiles(entryDirectory + "scripts/selected", "*.*", System.IO.SearchOption.AllDirectories); foreach (var file in files) { var ext = System.IO.Path.GetExtension(file); if (ext == ".cs" || ext == ".py") { Script.SelectedScript script = null; string error = string.Empty; if (Script.Compiler.CompileScript <Script.SelectedScript>(file, out script, out error)) { SelectedScripts.Add(script); } else { if (OnOutputMessage != null) { OnOutputMessage(error); } } } } } { var files = System.IO.Directory.GetFiles(entryDirectory + "scripts/export", "*.*", System.IO.SearchOption.AllDirectories); foreach (var file in files) { var ext = System.IO.Path.GetExtension(file); if (ext == ".cs" || ext == ".py") { Script.ExportScript script = null; string error = string.Empty; if (Script.Compiler.CompileScript <Script.ExportScript>(file, out script, out error)) { ExportScripts.Add(script); } else { if (OnOutputMessage != null) { OnOutputMessage(error); } } } } } { var files = System.IO.Directory.GetFiles(entryDirectory + "scripts/import", "*.*", System.IO.SearchOption.AllDirectories); foreach (var file in files) { var ext = System.IO.Path.GetExtension(file); if (ext == ".cs" || ext == ".py") { Script.ImportScript script = null; string error = string.Empty; if (Script.Compiler.CompileScript <Script.ImportScript>(file, out script, out error)) { ImportScripts.Add(script); } else { if (OnOutputMessage != null) { OnOutputMessage(error); } } } } } LoadOption(); }
public void EndTcpMoveFu(string Axis) { URController.Send_Command(CommandScripts.MoveTCP(Axis, -1, AccelerationRate, SpeedRate)); }
public static void Initialize(Language?language = null) { var entryDirectory = GetEntryDirectory() + "/"; Command.CommandManager.Changed += new EventHandler(CommandManager_Changed); FullPath = string.Empty; option = LoadOption(language); // Switch the language according to the loaded settings Language = Option.GuiLanguage; // Switch the culture according to the set language switch (Language) { case Effekseer.Language.English: Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US"); break; case Effekseer.Language.Japanese: Thread.CurrentThread.CurrentUICulture = new CultureInfo("ja-JP"); break; } New(); // Load scripts System.IO.Directory.CreateDirectory(entryDirectory + "scripts"); System.IO.Directory.CreateDirectory(entryDirectory + "scripts/import"); System.IO.Directory.CreateDirectory(entryDirectory + "scripts/export"); System.IO.Directory.CreateDirectory(entryDirectory + "scripts/command"); System.IO.Directory.CreateDirectory(entryDirectory + "scripts/selected"); Script.Compiler.Initialize(); { var files = System.IO.Directory.GetFiles(entryDirectory + "scripts/command", "*.*", System.IO.SearchOption.AllDirectories); foreach (var file in files) { var ext = System.IO.Path.GetExtension(file); if (ext == ".cs" || ext == ".py") { Script.CommandScript script = null; string error = string.Empty; if (Script.Compiler.CompileScript <Script.CommandScript>(file, out script, out error)) { CommandScripts.Add(script); } else { if (OnOutputMessage != null) { OnOutputMessage(error); } } } } } { var files = System.IO.Directory.GetFiles(entryDirectory + "scripts/selected", "*.*", System.IO.SearchOption.AllDirectories); foreach (var file in files) { var ext = System.IO.Path.GetExtension(file); if (ext == ".cs" || ext == ".py") { Script.SelectedScript script = null; string error = string.Empty; if (Script.Compiler.CompileScript <Script.SelectedScript>(file, out script, out error)) { SelectedScripts.Add(script); } else { if (OnOutputMessage != null) { OnOutputMessage(error); } } } } } { var files = System.IO.Directory.GetFiles(entryDirectory + "scripts/export", "*.*", System.IO.SearchOption.AllDirectories); foreach (var file in files) { var ext = System.IO.Path.GetExtension(file); if (ext == ".cs" || ext == ".py") { Script.ExportScript script = null; string error = string.Empty; if (Script.Compiler.CompileScript <Script.ExportScript>(file, out script, out error)) { ExportScripts.Add(script); } else { if (OnOutputMessage != null) { OnOutputMessage(error); } } Console.WriteLine(error); } } } { var files = System.IO.Directory.GetFiles(entryDirectory + "scripts/import", "*.*", System.IO.SearchOption.AllDirectories); foreach (var file in files) { var ext = System.IO.Path.GetExtension(file); if (ext == ".cs" || ext == ".py") { Script.ImportScript script = null; string error = string.Empty; if (Script.Compiler.CompileScript <Script.ImportScript>(file, out script, out error)) { ImportScripts.Add(script); } else { if (OnOutputMessage != null) { OnOutputMessage(error); } } } } } }
public void btnHome() { //print(CommandScripts.Home(AccelerationRate, SpeedRate)); URController.Send_command(CommandScripts.Home(AccelerationRate, SpeedRate)); }
public void toggleIO(int index) { //print(CommandScripts.IO(index,true)); URController.Send_command(CommandScripts.IO(index, true)); }
public void btnAxisStop() { URController.Send_command(CommandScripts.MoveStop()); }
static void InitializeScripts(string entryDirectory) { #if SCRIPT_ENABLED // Load scripts System.IO.Directory.CreateDirectory(entryDirectory + "scripts"); System.IO.Directory.CreateDirectory(entryDirectory + "scripts/import"); System.IO.Directory.CreateDirectory(entryDirectory + "scripts/export"); System.IO.Directory.CreateDirectory(entryDirectory + "scripts/command"); System.IO.Directory.CreateDirectory(entryDirectory + "scripts/selected"); Script.Compiler.Initialize(); { var files = System.IO.Directory.GetFiles(entryDirectory + "scripts/command", "*.*", System.IO.SearchOption.AllDirectories); foreach (var file in files) { var ext = System.IO.Path.GetExtension(file); if (ext == ".cs" || ext == ".py") { Script.CommandScript script = null; string error = string.Empty; if (Script.Compiler.CompileScript <Script.CommandScript>(file, out script, out error)) { CommandScripts.Add(script); } else { if (OnOutputMessage != null) { OnOutputMessage(error); } } } } } { var files = System.IO.Directory.GetFiles(entryDirectory + "scripts/selected", "*.*", System.IO.SearchOption.AllDirectories); foreach (var file in files) { var ext = System.IO.Path.GetExtension(file); if (ext == ".cs" || ext == ".py") { Script.SelectedScript script = null; string error = string.Empty; if (Script.Compiler.CompileScript <Script.SelectedScript>(file, out script, out error)) { SelectedScripts.Add(script); } else { if (OnOutputMessage != null) { OnOutputMessage(error); } } } } } { var files = System.IO.Directory.GetFiles(entryDirectory + "scripts/export", "*.*", System.IO.SearchOption.AllDirectories); foreach (var file in files) { var ext = System.IO.Path.GetExtension(file); if (ext == ".cs" || ext == ".py") { Script.ExportScript script = null; string error = string.Empty; if (Script.Compiler.CompileScript <Script.ExportScript>(file, out script, out error)) { ExportScripts.Add(script); } else { if (OnOutputMessage != null) { OnOutputMessage(error); } } Console.WriteLine(error); } } } { var files = System.IO.Directory.GetFiles(entryDirectory + "scripts/import", "*.*", System.IO.SearchOption.AllDirectories); foreach (var file in files) { var ext = System.IO.Path.GetExtension(file); if (ext == ".cs" || ext == ".py") { Script.ImportScript script = null; string error = string.Empty; if (Script.Compiler.CompileScript <Script.ImportScript>(file, out script, out error)) { ImportScripts.Add(script); } else { if (OnOutputMessage != null) { OnOutputMessage(error); } } } } } #endif }
public void SingleAxisJogFu(int index) { URController.Send_Command(CommandScripts.MoveAxis(index, -1, AccelerationRate, SpeedRate, Axis_Pos)); }
public void JinTing() { URController.Send_command(CommandScripts.MoveStop()); }