public void Initialization(object obj) { System.Windows.Forms.Panel pp = (System.Windows.Forms.Panel)obj; remote = new RemoteInterface(true, true); iPhysicsDoc = new ExternalAppDock(); pp.Controls.Add(iPhysicsDoc); iPhysicsDoc.Dock = DockStyle.Fill; if (!remote.IsStarted) { remote.StartIPhysics(6001); } int timeout = 30000; int sleepTime = 500; while (!remote.IsConnected && timeout > 0) { System.Threading.Thread.Sleep(sleepTime); timeout -= sleepTime; if (!remote.IsConnected) { remote.Connect("localhost", 6001); } } iPhysicsDoc.DockExternalApp(remote.ExeProcess, iPhysicsDoc.Parent); //if (!(timeout > 0)) // throw new Exception("Error, cannot connect to industrialPhysics"); //Default File Load //RegistryKey key = RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, RegistryView.Default); //String Path = key.GetValue( // "Software\\machineering\\industrialPhysics\\InstallDir(x64)" // , "c:\\Program Files\\machineering\\industrialPhysics(x64)").ToString(); }
//初始化 public void Initialization() { remote = new RemoteInterface(true, true); iPhysicsDoc = new ExternalAppDock(); this.panel1.Controls.Add(iPhysicsDoc); iPhysicsDoc.Dock = DockStyle.Fill; if (!remote.IsStarted) { remote.StartIPhysics(6001); } int timeout = 30000; int sleepTime = 500; while (!remote.IsConnected && timeout > 0) { System.Threading.Thread.Sleep(sleepTime); timeout -= sleepTime; if (!remote.IsConnected) { remote.Connect("localhost", 6001); } } iPhysicsDoc.DockExternalApp(remote.ExeProcess, iPhysicsDoc.Parent); if (!(timeout > 0)) { throw new Exception("Error, cannot connect to industrialPhysics"); } //Default File Load RegistryKey key = RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, RegistryView.Default); // = new Microsoft.Win32.RegistryKey(); String Path = key.GetValue( "Software\\machineering\\industrialPhysics\\InstallDir(x64)" , "c:\\Program Files\\machineering\\industrialPhysics(x64)").ToString(); //IPhysics_Command command = new LoadDocument(Environment.CurrentDirectory + "../../../../AGV_Path.iphz"); //textBox1.Text = Environment.CurrentDirectory + "/AGV_Path.iphz"; IPhysics_Command command = new LoadDocument(Environment.CurrentDirectory + "/cgk_csharp.iphz"); remote.execute(command); remote.lookFromIsometry(); //remote.switchModePresentation(true); remote.zoomOut(0); //remote.sendPlay(); loading_done = true; //remote.sendReset(); //remote.sendPlay(); }
public void Initialization(object obj) { System.Windows.Forms.Panel pp = (System.Windows.Forms.Panel)obj; remote = new RemoteInterface(false, true); iPhysicsDoc = new ExternalAppDock(); pp.Controls.Add(iPhysicsDoc); iPhysicsDoc.Dock = DockStyle.Fill; if (!remote.IsStarted) { remote.StartIPhysics(decimal.Parse(System.Configuration.ConfigurationManager.AppSettings["modeport"].ToString())); } int timeout = 30000; int sleepTime = 500; while (!remote.IsConnected && timeout > 0) { System.Threading.Thread.Sleep(sleepTime); timeout -= sleepTime; if (!remote.IsConnected) { remote.Connect("localhost", int.Parse(System.Configuration.ConfigurationManager.AppSettings["modeport"].ToString())); } } iPhysicsDoc.DockExternalApp(remote.ExeProcess, iPhysicsDoc.Parent); if (!(timeout > 0)) { throw new Exception("Error, cannot connect to industrialPhysics"); } //Default File Load RegistryKey key = RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, RegistryView.Default); String Path = key.GetValue( "Software\\machineering\\industrialPhysics\\InstallDir(x64)" , "c:\\Program Files\\machineering\\industrialPhysics(x64)").ToString(); //IPhysics_Command command = new LoadDocument(Environment.CurrentDirectory + "/light.iphz"); //remote.execute(command); //remote.lookFromIsometry(); //remote.switchModePresentation(true); //remote.zoomOut(0); //remote.sendPlay(); //loading_done = true; //remote.sendReset(); //remote.sendPlay(); initializ_done = true; }
public void Initialization(object obj) { System.Windows.Forms.Panel pp = (System.Windows.Forms.Panel)obj; remote = new RemoteInterface(false, false); iPhysicsDoc = new ExternalAppDock(); pp.Controls.Add(iPhysicsDoc); iPhysicsDoc.Dock = DockStyle.Fill; if (!remote.IsStarted) { remote.StartIPhysics(decimal.Parse(System.Configuration.ConfigurationManager.AppSettings["modeport_browser"].ToString())); } int timeout = 30000; int sleepTime = 500; while (!remote.IsConnected && timeout > 0) { System.Threading.Thread.Sleep(sleepTime); timeout -= sleepTime; if (!remote.IsConnected) { remote.Connect("localhost", int.Parse(System.Configuration.ConfigurationManager.AppSettings["modeport_browser"].ToString())); } } iPhysicsDoc.DockExternalApp(remote.ExeProcess, iPhysicsDoc.Parent); if (!(timeout > 0)) { throw new Exception("Error, cannot connect to industrialPhysics"); } //Default File Load RegistryKey key = RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, RegistryView.Default); String Path = key.GetValue( "Software\\machineering\\industrialPhysics\\InstallDir(x64)" , "c:\\Program Files\\machineering\\industrialPhysics(x64)").ToString(); }