ReadXMLWaiXiang.cs 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class ReadXMLWaiXiang : MonoBehaviour
  5. {
  6. public GameObject inspectListObj;
  7. // 保存所有的从XML读取的数据
  8. public ArrayList m_enemylist;
  9. // 存储敌人出场顺序的XML
  10. public TextAsset xmldata;
  11. public InspectList inspecyList;
  12. public InspectListPanel inspectListPanel;
  13. protected int m_index = 0;
  14. protected Transform startPos;
  15. public GameObject objParent;
  16. public GameObject excel_buttom;
  17. public int idtype;
  18. void Awake()
  19. {
  20. // 读取XML
  21. ReadMyXML();
  22. inspectListObj = Instantiate(excel_buttom);// Resources.Load("excel_buttom") as GameObject;
  23. }
  24. public virtual void Start()
  25. {
  26. LoadInspectList();
  27. }
  28. public virtual void ReadMyXML()
  29. {
  30. m_enemylist = new ArrayList();
  31. switch (idtype)
  32. {
  33. case 0:
  34. setDATA("1", "检查USB3.0接口线", "0", "excel_dikuang_1", "请检查USB3.0接口线是否插入主板又部的USB3.0针脚上。", "外箱", "ResultView1", "1", "1S20QEZ4KYUSPF1P4Q21");
  35. setDATA("2", "检查F_PANEL接口线", "0", "excel_dikuang_2", "请检查主板右下方的JFP1接口,即F_PANEL接口是否与控制前置面板开关及指示灯的线连接。", "外箱", "ResultView2", "1", "SPF1P4Q21");
  36. setDATA("3", "检查风扇运转情况", "0", "excel_dikuang_3", "请检查机箱上的二维码是否破损。", "外箱", "ResultView3", "2", "0");
  37. setDATA("4", "外箱", "0", "excel_dikuang_4", "请将主机通电,是否并按下开机键,查看风扇是否正常转动并发光", "外箱", "ResultView4", "1", "193386983477");
  38. setDATA("5", "检查主板供电发光线", "0", "excel_dikuang_5", "请检查24pin主板供电线是否插入主板右侧的24pin供电插槽内,并发出炫彩光效", "外箱", "ResultView5", "1", "015184006299197");
  39. break;
  40. case 1:
  41. setDATA("6", "打开设备包装", "0", "excel_dikuang_1", "开箱前检测,请带上手套,做好防尘措施.扫描设备配置单ModelS/N二维码,确认设备机型开始检测流程", "附件", "ResultView1", "1", "1S20QEZ4KYUSPF1P4Q21");
  42. setDATA("7", "清点相关配件", "0", "excel_dikuang_2", "扫描Serial Number,确认二维码与系统数据一致", "附件", "ResultView2", "1", "SPF1P4Q21");
  43. setDATA("8", "扫描电源线二维码", "0", "excel_dikuang_3", "请人工对比ES LOGO是否有图改,表面有无损毁", "附件", "ResultView3", "2", "0");
  44. setDATA("9", "扫描扫描适配器二维码 code", "0", "excel_dikuang_4", "扫描UPC code,确认二维码与系统数据一致", "附件", "ResultView4", "1", "193386983477");
  45. setDATA("10", "扫描VGA CABLE二维码", "0", "excel_dikuang_5", "扫描IMEI,确认二维码与系统数据一致,", "附件", "ResultView5", "1", "015184006299197");
  46. setDATA("11", "扫描产品手册二维码", "0", "excel_dikuang_6", "请人工对比FCC logo是否有图改,表面有无损毁,", "附件", "ResultView6", "2", "0");
  47. setDATA("12", "扫描IJ45 二维码", "0", "excel_dikuang_7", "请人工对比是否与图片一致,正面X1 logo和ThinkPad logo,反面防火logo是否有图改,表面有无损毁", "附件", "ResultView7", "2", "0");
  48. break;
  49. case 2:
  50. setDATA("13", "进行产品配置检查", "0", "excel_dikuang_1", "检查产品正面是否有X1图片和产品logo,是否有图改,表面有无损毁", "配置", "ResultView1", "1", "1S20QEZ4KYUSPF1P4Q21");
  51. setDATA("14", "请检查屏幕及双摄像头", "0", "excel_dikuang_2", "请检查设备内部显示屏幕是否有划痕与指纹印记,检查双摄像头是否有划痕", "配置", "ResultView2", "1", "SPF1P4Q21");
  52. setDATA("15", "请检查掌托面-UPPER", "0", "excel_dikuang_3", "请检查设备掌托面-UPPER,确认触控板有弹性", "配置", "ResultView3", "2", "0");
  53. setDATA("16", "请检查掌托右侧指纹识别 code", "0", "excel_dikuang_4", "请检查掌托右侧指纹识别,是否有划痕与指纹印记", "配置", "ResultView4", "1", "193386983477");
  54. setDATA("17", "请检查掌托左侧Inter标签", "0", "excel_dikuang_5", "请检查掌托左侧Inter标签,是否有图改或者表面损毁", "配置", "ResultView5", "1", "015184006299197");
  55. setDATA("18", "请检查SN码与IMEI", "0", "excel_dikuang_6", "请翻转到底部,检查底座-SN码与IMEI标志是否有图改,表面有无损毁", "配置", "ResultView6", "2", "0");
  56. setDATA("19", "请检查底部windows标签", "0", "excel_dikuang_7", "请检查底部windows标签,是否有划痕与指纹印记", "配置", "ResultView7", "2", "0");
  57. break;
  58. } }
  59. public void setDATA(string id, string subtasks, string taskStatus, string pos, string content, string mainSubtasks, string endResultViewPos, string tag,string code)
  60. {
  61. SpawnData mData = new SpawnData();
  62. mData.id = int.Parse(id);
  63. mData.subtasks = subtasks;
  64. mData.taskStatus = int.Parse(taskStatus);
  65. mData.pos = pos;
  66. mData.content = content;
  67. mData.mainSubtasks = mainSubtasks;
  68. mData.endResultViewPos = endResultViewPos;
  69. mData.tag = int.Parse(tag);
  70. mData.code = code;
  71. m_enemylist.Add(mData);
  72. }
  73. //public virtual void Update()
  74. //{
  75. // if (m_index >= m_enemylist.Count)
  76. // return;
  77. // //LoadInspectList();
  78. //}
  79. private void LoadInspectList()
  80. {
  81. if (m_index >= m_enemylist.Count)
  82. return;
  83. for (int i = 0; i < m_enemylist.Count; i++)
  84. {
  85. SpawnData data = (SpawnData)m_enemylist[m_index];
  86. startPos = inspecyList.listParent.transform.Find(data.pos).gameObject.transform;
  87. GameObject obj = Instantiate(inspectListObj, new Vector3(startPos.position.x, startPos.position.y, startPos.position.z), Quaternion.Euler(0, startPos.eulerAngles.y, -90));
  88. obj.transform.parent = objParent.transform;
  89. // obj.transform.localScale = new Vector3(0.6086614f, 3.158592f, 8778199f);
  90. obj.name = "excel_buttom" + data.id.ToString();
  91. InspectList_Button inB = obj.GetComponent<InspectList_Button>();
  92. inB.text_num.text = data.id.ToString();
  93. inB.text_name.text = data.subtasks.ToString();
  94. inB.status = data.taskStatus;
  95. inB.content = data.content;
  96. inB.mainSubtasks = data.mainSubtasks;
  97. inB.endResultViewPos = data.endResultViewPos;
  98. inB.viewTag = data.tag;
  99. inB.code = data.code;
  100. inspectListPanel.taskList.Add(obj);
  101. m_index++;
  102. }
  103. }
  104. public class SpawnData
  105. {
  106. //id
  107. public int id;
  108. //子任务
  109. public string subtasks;
  110. //子任务状态
  111. public int taskStatus;
  112. //子任务位置
  113. public string pos;
  114. //子任务的具体内容
  115. public string content;
  116. //子任务的标题
  117. public string mainSubtasks;
  118. //结算列表的view的位置
  119. public string endResultViewPos;
  120. //子任务属于 什么判断 1 扫码 2 语音
  121. public int tag;
  122. //子任务的根号
  123. public string code;
  124. }
  125. }