public void TestConnect(SimuTestMode mode = null)
 {
     TestConfig.TestMode = mode;
     isEnter             = mode != null;
     thread = new Thread(new ThreadStart(RunConnect));
     thread.Start();
 }
示例#2
0
        public void SetModeButton(string modeName, string mapName, DateTime dateTime, SimuTestMode testmode)
        {
            if (text_modeName == null)
            {
                text_modeName = transform.GetChild(0).GetComponent <Text>();
            }
            text_modeName.text = modeName;
            if (text_MapName == null)
            {
                text_MapName = transform.GetChild(1).GetComponent <Text>();
            }
            text_MapName.text = mapName;
            if (text_LastTime == null)
            {
                text_LastTime = transform.GetChild(2).GetComponent <Text>();
            }
            text_LastTime.text = dateTime.ToString();
            mode = testmode;
            if (btn_edit == null)
            {
                btn_edit = transform.GetChild(3).GetComponent <Button>();
            }
            btn_edit.onClick.AddListener(() =>
            {
                TestConfig.TestMode   = mode;
                TestConfig.isEditMode = true;
                LunchUI.Instance.EnterSimu(true);
            });
            if (btn_delete == null)
            {
                btn_delete = transform.GetChild(4).GetComponent <Button>();
            }
            btn_delete.onClick.AddListener(() =>
            {
                TestConfig.DeleteData(mode);
                gameObject.SetActive(false);
            });

            onClick.RemoveAllListeners();
            onClick.AddListener(() =>
            {
                TestConfig.TestMode   = mode;
                TestConfig.isEditMode = true;
                if (ROS_Config.ROS2)
                {
                    LunchUI.Instance.EnterSimu(false);
                }
                else
                {
                    LunchUI.Instance.TestConnect(mode);
                }
            });
        }
 private void SetModeGroup()
 {
     for (int i = 0; i < groupMode.transform.childCount; i++)
     {
         Destroy(groupMode.transform.GetChild(i).gameObject);
     }
     for (int i = 0; i < TestConfig.TestModes.Count; i++)
     {
         SimuTestMode mode    = TestConfig.TestModes[i];
         GameObject   ModeObj = Instantiate(objModeToggle, groupMode.transform);
         ModeObj.GetComponent <ModeButton>().SetModeButton(mode.TestModeName, mode.MapName, mode.LastTime, mode);
     }
 }