示例#1
0
        private void loadModel(int type)
        {
            string name = "";

            if (type > 0 && type < 6)
            {
                switch (type)
                {
                case 1:
                    name = "/pcc_car.iphz";
                    break;

                case 2:
                    name = "/pcc_car.iphz";
                    break;

                case 3:
                    name = "/pcc_car.iphz";
                    break;

                case 4:
                    name = "/pcc_car.iphz";
                    break;

                case 5:
                    name = "/pcc_car.iphz";
                    break;

                case 6:
                    name = "/pcc_car.iphz";
                    break;

                case 7:
                    name = "/pcc_car.iphz";
                    break;
                }
            }
            else
            {
                //int origionWidth = splitContainer1.Panel1.Width;
                //splitContainer1.SplitterDistance = splitContainer1.Width;
                this.splitContainer1.SplitterDistance = 1;
                this.splitContainer1.Panel1.Hide();
                return;
            }

            if (!remote.IsStarted)
            {
                return;
            }
            System.Threading.Thread.Sleep(400);
            IPhysics_Command command = new LoadDocument(Environment.CurrentDirectory + name);

            remote.execute(command);
            if (System.Configuration.ConfigurationManager.AppSettings["isDebug"].ToString() == "0")
            {
                remote.switchModePresentation(true);
            }
        }
示例#2
0
        public void loadDemo()
        {
            IPhysics_Command command = new LoadDocument(Environment.CurrentDirectory + System.Configuration.ConfigurationManager.AppSettings["modefile"].ToString());

            remote.execute(command);

            loading_done = true;
        }
示例#3
0
        public void loadDemo()
        {
            IPhysics_Command command = new LoadDocument(Environment.CurrentDirectory + "/PCC0904.iphz");

            //IPhysics_Command command = new LoadDocument(Environment.CurrentDirectory + "/light.iphz");
            remote.execute(command);
            //remote.switchModePresentation(true);
            loading_done = true;
        }
示例#4
0
        public void loadDemo()
        {
            IPhysics_Command command = new LoadDocument(Environment.CurrentDirectory + System.Configuration.ConfigurationManager.AppSettings["modefile"].ToString());

            remote.execute(command);
            if (System.Configuration.ConfigurationManager.AppSettings["isDebug"].ToString() == "0")
            {
                remote.switchModePresentation(true);
            }
            loading_done = true;
        }
示例#5
0
        //初始化
        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();
        }
        private void btnLoadMapDocument_Click(object sender, RoutedEventArgs e)
        {
            if (_mapDocument == null)
            {
                return;
            }

            HideBackstageMenu();

            LoadDocument tool = new LoadDocument();

            tool.OnCreate(_mapDocument);

            tool.OnEvent(new MapEvent(_mapDocument.FocusMap));
        }
示例#7
0
        //加载模型 线程
        private void loadMode()
        {
            IPhysics_Command command = new LoadDocument(Environment.CurrentDirectory + modelName);

            remote.execute(command);
            //remote.lookFromIsometry();
            if (System.Configuration.ConfigurationManager.AppSettings["isDebug"].ToString() == "0")
            {
                remote.switchModePresentation(true);
            }

            //remote.zoomOut(0);
            loading_done = true;
            remote.sendReset();
        }
示例#8
0
        public void loadDemo()
        {
            while (true)
            {
                if (initializ_done)
                {
                    //IPhysics_Command command = new LoadDocument(Environment.CurrentDirectory + "/pcc_car.iphz");

                    IPhysics_Command command = new LoadDocument(Environment.CurrentDirectory + System.Configuration.ConfigurationManager.AppSettings["modefile"].ToString());
                    remote.execute(command);
                    if (System.Configuration.ConfigurationManager.AppSettings["isDebug"].ToString() == "0")
                    {
                        remote.switchModePresentation(true);
                    }
                    loading_done = true;
                    break;
                }
            }
        }