private void FrmChooseUnits_Load(object sender, EventArgs e) { Action act = () => { if (this.Tag != null) { cModel = this.Tag as ChooseModel; typeName = cModel.TypeCode; uName = cModel.UName; } if (string.IsNullOrEmpty(uName)) { btnAdd.Enabled = false; } //选择页面标题 if (typeName.Contains("Supplier")) { this.Text = "选择供应商"; } else if (typeName.Contains("Customer")) { this.Text = "选择客户"; } else if (typeName.Contains("Unit")) { this.Text = "选择往来单位"; } LoadTvUTypes(); LoadUnitList(); }; act.TryCatch("加载单位信息出现异常"); }
void SetTxtBox(ChooseModel IIM) { TxtBox_PurchaseReceiptID.Text = IIM.PurchaseReceiptID; TxtBox_PurchaseNo.Text = IIM.PurchaseNo; TxtBox_SupplierName.Text = IIM.SupplierName; TxtBox_BatchNo.Text = IIM.BatchNo; TxtBox_MaterialCode.Text = IIM.MaterialCode; TxtBox_MaterialName.Text = IIM.MaterialName; TxtBox_MaterialSpecifications.Text = IIM.MaterialSpecifications; ip_ProductQuantity.Text = IIM.ProductQuantity1.ToString(); }
void Awake() { Choose = transform.Find("Choose").gameObject; Load = transform.Find("Load").gameObject; Sd_Progress = Load.transform.Find("Sd_Progress").gameObject.GetComponent <Slider> (); IF_Input = Choose.transform.Find("IF_Input").gameObject.GetComponent <InputField> (); Btn_Choose = Choose.transform.Find("Btn_Choose").gameObject.GetComponent <Button> (); Btn_Quit = Choose.transform.Find("Btn_Quit").gameObject.GetComponent <Button> (); this.m_Model = gameObject.GetComponent <ChooseModel> (); this.m_Model.Init(); }
private void FrmChooseGoods_Load(object sender, EventArgs e) { Action act = () => { if (this.Tag != null) { cModel = this.Tag as ChooseModel; typeName = cModel.TypeCode; uName = cModel.UName; } LoadTvGTypes(); LoadGoodsList(); }; act.TryCatch("加载商品信息出现异常"); }
private void FrmChooseTypes_Load(object sender, EventArgs e) { Action act = () => { if (this.Tag != null) { cModel = this.Tag as ChooseModel; if (cModel == null) { MsgBoxHelper.MsgErrorShow("类别信息初始化失败!"); return; } } LoadTypeInfos(); }; act.TryCatch("类别信息初始化加载异常!"); }
ChooseModel cModel = null;//信息页面到选择仓库页面的实体 private void FrmChooseStores_Load(object sender, EventArgs e) { Action act = () => { if (this.Tag != null) { cModel = this.Tag as ChooseModel; typeName = cModel.TypeCode; uName = cModel.UName; } if (string.IsNullOrEmpty(uName)) { btnAdd.Enabled = false; } LoadTvSTypes(); //仓库类别信息 treeView LoadStoreList(); //条件查询仓库列表 }; act.TryCatch("加载仓库信息出现异常"); }
// Update is called once per frame void Update() { if (PublicClass.app.app_type != "sign_acu") { return; } #if UNITY_DEBUG if (Input.GetKeyDown(KeyCode.T)) { MakeStaticDBTable <AcupointInfo> .SetTextureDataToDB(PublicClass.filePath + "StartStop", db_path); } if (Input.GetKeyDown(KeyCode.F1)) { //http://118.24.119.234:8083/vesal-jiepao-test/v1/app/xml/getTempAcupoint // MakeStaticDBTable<AcupointInfo>.sign_UpdateTable(PublicClass.server_ip + "v1/app/xml/getTempAcupoint", db_path); // http://118.24.119.234:8083/vesal-jiepao-test/v1/app/xml/getTempAcupoint?type=acu // http://118.24.119.234:8083/vesal-jiepao-test/v1/app/xml/getTempAcupoint?type=noun // MakeStaticDBTable<AcupointInfo>.sign_UpdateTable(PublicClass.server_ip + "v1/app/xml/getTempAcupoint?type=acu", db_path,true); // MakeStaticDBTable<AcuListInfo>.sign_UpdateTable(PublicClass.server_ip + "v1/app/xml/getTempAcupoint?type=noun", db_path,true); string db_path = PublicClass.filePath + "sign_ssp_path/StartStop_1.db"; MakeStaticDBTable <StartStopInfo> .opera_condition(db_path, (list) => { //list startstopinfo List <string> opera_list = new List <string>(); foreach (var item in list) { if (item.qr == "0") { opera_list.Add(item.mod_name); print(item.mod_name + " info missing "); } } }); } if (Input.GetKeyDown(KeyCode.R)) { Debug.Log("r已被按下"); for (int i = 0; i < acuEleList.Count; i++) { Debug.Log("进入循环,查找目前记录的物体"); if (acuEleList[i].gameObject.GetComponent <Image>().color == new Color(33 / 255.0f, 167 / 255.0f, 212 / 255.0f, 85 / 255.0f)) { camera_params str = new camera_params(); str.camera_pos = new vector3(); str.camera_pos.x = Camera.main.transform.position.x; str.camera_pos.y = Camera.main.transform.position.y; str.camera_pos.z = Camera.main.transform.position.z; str.camera_parent_rot = new vector3(); str.camera_parent_rot.x = Camera.main.transform.parent.transform.eulerAngles.x; str.camera_parent_rot.y = Camera.main.transform.parent.transform.eulerAngles.y; str.camera_parent_rot.z = Camera.main.transform.parent.transform.eulerAngles.z; str.camera_parent_pos = new vector3(); str.camera_parent_pos.x = Camera.main.transform.parent.transform.position.x; str.camera_parent_pos.y = Camera.main.transform.parent.transform.position.y; str.camera_parent_pos.z = Camera.main.transform.parent.transform.position.z; acuInfoList[i].camera_params = JsonConvert.SerializeObject(str); // sspInfoList[i].app_id="SA0C01001"; Debug.Log("记录摄像机数据成功"); } } } if (Input.GetKeyDown(KeyCode.W)) { // local_db.DataService("StartStop.db"); local_db.CreateDb(db_path); UpdateSSPTable(); Debug.Log("写入摄像机数据成功"); local_db.Close(); } #endif //将显示框的位置设置为物体位置的屏幕坐标 //Debug.Log(objPos); //showinfoBG.transform.position = Camera.main.WorldToScreenPoint(objPos); txtPos = Camera.main.WorldToScreenPoint(objPos); showinfoBG.rectTransform.anchoredPosition = new Vector2(txtPos.x / Screen.width * ScreenData.instance.high, txtPos.y / Screen.height * ScreenData.instance.width) + new Vector2(100, 50); //Debug.Log(showinfoBG.rectTransform.localPosition); // Debug.Log(showinfoBG.rectTransform.anchoredPosition); //Debug.Log(txtPos); //showinfoBG.rectTransform.pivot = new Vector2(0.5f, 0.5f); //Debug.Log(showinfoBG.transform.position); if (ChooseModel.CheckGuiRaycastObjects()) { return; } if (Input.GetMouseButtonDown(0)) { Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit hit; if (Physics.Raycast(ray, out hit)) { if (acpoint_dic.ContainsKey(hit.transform.position)) { ExpPanel.SetActive(true); MenuPanel.SetActive(false); isListOpen = false; //for (int i = 0; i < acuInfoList.Count; i++) // { // if(GameObject.Find(acuInfoList[i].sm_name)!=null) // ToNormalState(GameObject.Find(acuInfoList[i].sm_name).GetComponentInChildren<MeshRenderer>().material); // } if (lastSphere != null) { ToNormalState(lastSphere.GetComponentInChildren <MeshRenderer>().material); //test.lastMuscle.SetActive(false); } //lastTrans = currentTrans; //currentTrans = hit.transform; objPos = hit.transform.position; showinfoBG.gameObject.SetActive(true); showTxt.text = acpoint_dic[hit.transform.position]; //ToSelectState(currentTrans.GetComponent<MeshRenderer>().material); currentSphere = hit.transform.gameObject; ToSelectState(hit.transform.GetComponent <MeshRenderer>().material); lastSphere = currentSphere; //if(lastTrans!=null) //ToNormalState (lastTrans.GetComponent<MeshRenderer>().material); for (int i = 0; i < acuInfoList.Count; i++) { if (acuInfoList[i].sm_ch_name == acpoint_dic[hit.transform.position]) { //print(acuInfoList[i].sm_ch_name); acuChName.text = acuInfoList[i].sm_ch_name; acuCode.text = acuInfoList[i].iso_code; acuDes.text = string.Format("<size=48><color=#00FFFF>定位</color></size>:\r\n{0}\r\n<size=48><color=#00FFFF>主治</color></size>:\r\n{1}\r\n<size=48><color=#00FFFF>操作</color></size>:\r\n{2}", acuInfoList[i].position, acuInfoList[i].cure, acuInfoList[i].handle); } } } } else { for (int i = 0; i < acuInfoList.Count; i++) { if (GameObject.Find(acuInfoList[i].sm_name) != null) { ToNormalState(GameObject.Find(acuInfoList[i].sm_name).GetComponentInChildren <MeshRenderer>().material); } } showinfoBG.gameObject.SetActive(false); } } }
private void Awake() { instance = this; }
// Update is called once per frame void Update() { if (PublicClass.app != null && PublicClass.app.app_type != "sign_new") { return; } #if UNITY_EDITOR if (Input.GetKeyDown(KeyCode.R)) { Debug.Log("r已被按下"); for (int i = 0; i < sgnEleList.Count; i++) { Debug.Log("进入循环,查找目前记录的物体"); if (sgnEleList[i].gameObject.GetComponent <Image>().color == new Color(33 / 255.0f, 167 / 255.0f, 212 / 255.0f, 85 / 255.0f)) { camera_params str = new camera_params(); str.camera_pos = new vector3(); str.camera_pos.x = Camera.main.transform.position.x; str.camera_pos.y = Camera.main.transform.position.y; str.camera_pos.z = Camera.main.transform.position.z; str.camera_parent_rot = new vector3(); str.camera_parent_rot.x = Camera.main.transform.parent.transform.eulerAngles.x; str.camera_parent_rot.y = Camera.main.transform.parent.transform.eulerAngles.y; str.camera_parent_rot.z = Camera.main.transform.parent.transform.eulerAngles.z; str.camera_parent_pos = new vector3(); str.camera_parent_pos.x = Camera.main.transform.parent.transform.position.x; str.camera_parent_pos.y = Camera.main.transform.parent.transform.position.y; str.camera_parent_pos.z = Camera.main.transform.parent.transform.position.z; sgnInfoList[i].camera_params = JsonConvert.SerializeObject(str); Debug.Log(sgnInfoList[i].camera_params); Debug.Log("记录摄像机数据成功"); } } } if (Input.GetKeyDown(KeyCode.P)) { local_db.DataService("vesali.db"); for (int i = 0; i < sgnInfoList.Count; i++) { Debug.Log(sgnInfoList[i].sm_ch_name); } Debug.Log("打印表数据成功"); local_db.Close(); } if (Input.GetKeyDown(KeyCode.W)) { // local_db.DataService("StartStop.db"); local_db.DataService("vesali.db"); UpdateSSPTable(); Debug.Log("写入摄像机数据成功"); local_db.Close(); } #endif if (ChooseModel.CheckGuiRaycastObjects()) { return; } if (Input.GetMouseButtonDown(0)) { Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit hit; if (Physics.Raycast(ray, out hit)) { string model_name = hit.transform.gameObject.GetComponent <Model>().name; if (model_tex_dic.ContainsKey(model_name)) { string str = model_tex_dic[model_name]; if (main_mask_dic.ContainsKey(str)) { string str_2 = main_mask_dic[str]; maskTexPNG = loaded_channal_list[str_2]; } } Vector2 pixelUV = hit.textureCoord2; pixelUV.x *= maskTexPNG.width; pixelUV.y *= maskTexPNG.height; chosCol = maskTexPNG.GetPixel((int)pixelUV.x, (int)pixelUV.y); Debug.Log(chosCol); if (chosCol == Color.black) { return; } for (int i = 0; i < sgnInfoList.Count; i++) { if (chosCol == sgnColList[i]) { sgnExpPanel.SetActive(true); sgnMenuPanel.SetActive(false); isListOpen = false; sgnChName.text = sgnInfoList[i].sm_ch_name; sgnEnName.text = sgnInfoList[i].sm_en_name; sgnDes.text = string.Format("<size=48><color=#00FFFF>相关介绍</color></size>:\r\n{0}", sgnInfoList[i].description); objPa.BroadcastMessage("ChangeChoseColor", chosCol); objPa.BroadcastMessage("ChangeHightColor", new Color(float.Parse(sgnInfoList[i].high_r) / 255.0f, float.Parse(sgnInfoList[i].high_g) / 255.0f, float.Parse(sgnInfoList[i].high_b) / 255.0f, 1)); } } } } }
void Update() { if (PublicClass.app.app_type != "sign_ssp") { return; } if (Input.GetKeyDown(KeyCode.T)) { MakeStaticDBTable <StartStopInfo> .SetTextureDataToDB(PublicClass.filePath + "StartStop", db_path); } #if UNITY_DEBUG if (Input.GetKeyDown(KeyCode.F1)) { MakeStaticDBTable <StartStopInfo> .sign_UpdateTable(PublicClass.server_ip + "v1/app/xml/getAllStartStop", db_path, true); } if (Input.GetKeyDown(KeyCode.R)) { Debug.Log("r已被按下"); for (int i = 0; i < sspEleList.Count; i++) { Debug.Log("进入循环,查找目前记录的物体"); if (sspEleList[i].gameObject.GetComponent <Image>().color == new Color(33 / 255.0f, 167 / 255.0f, 212 / 255.0f, 85 / 255.0f)) { camera_params str = new camera_params(); str.camera_pos = new vector3(); str.camera_pos.x = Camera.main.transform.position.x; str.camera_pos.y = Camera.main.transform.position.y; str.camera_pos.z = Camera.main.transform.position.z; str.camera_parent_rot = new vector3(); str.camera_parent_rot.x = Camera.main.transform.parent.transform.eulerAngles.x; str.camera_parent_rot.y = Camera.main.transform.parent.transform.eulerAngles.y; str.camera_parent_rot.z = Camera.main.transform.parent.transform.eulerAngles.z; str.camera_parent_pos = new vector3(); str.camera_parent_pos.x = Camera.main.transform.parent.transform.position.x; str.camera_parent_pos.y = Camera.main.transform.parent.transform.position.y; str.camera_parent_pos.z = Camera.main.transform.parent.transform.position.z; sspInfoList[i].camera_params = JsonConvert.SerializeObject(str); // sspInfoList[i].app_id="SA0C01001"; Debug.Log("记录摄像机数据成功"); } } } if (Input.GetKeyDown(KeyCode.W)) { // local_db.DataService("StartStop.db"); local_db.CreateDb(db_path); UpdateSSPTable(); Debug.Log("写入摄像机数据成功"); local_db.Close(); } #endif if (ChooseModel.CheckGuiRaycastObjects()) { return; } if (Input.GetMouseButtonDown(0)) { List <Ray> ray_list = new List <Ray>(); List <RaycastHit> hit_list = new List <RaycastHit>(); Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); ray_list.Add(ray); Ray ray1 = Camera.main.ScreenPointToRay(Input.mousePosition + new Vector3(0, 2, 0)); ray_list.Add(ray1); Ray ray2 = Camera.main.ScreenPointToRay(Input.mousePosition + new Vector3(0, -2, 0)); ray_list.Add(ray2); Ray ray3 = Camera.main.ScreenPointToRay(Input.mousePosition + new Vector3(2, 0, 0)); ray_list.Add(ray3); Ray ray4 = Camera.main.ScreenPointToRay(Input.mousePosition + new Vector3(-2, 0, 0)); ray_list.Add(ray4); for (int k = 0; k < ray_list.Count; k++) { RaycastHit hit; if (Physics.Raycast(ray_list[k], out hit)) { hit_list.Add(hit); //for (int i = 0; i < sspInfoList.Count; i++) //{ //dic[sspInfoList[i].mod_name].gameObject.SetActive(false); //} if (model_maskTex_dic.ContainsKey(hit.transform.gameObject.GetComponent <Model>())) { maskTexPNG = model_maskTex_dic[hit.transform.gameObject.GetComponent <Model>()]; } Vector2 pixelUV = hit.textureCoord2; pixelUV.x *= maskTexPNG.width; pixelUV.y *= maskTexPNG.height; chosCol = maskTexPNG.GetPixel((int)pixelUV.x, (int)pixelUV.y); if (chosCol == Color.black) { continue; } clickTimes++; for (int i = 0; i < sspList.Count; i++) { ExpPanel.SetActive(true); MenuPanel.SetActive(false); isListOpen = false; if (sspList[i].startCol == new Vector3(chosCol.r, chosCol.g, chosCol.b)) { ShowInfo(sspInfoList[i]); objPa.BroadcastMessage("ChangeChoseColor", chosCol); if (new Color(sspList[i].stopCol.x, sspList[i].stopCol.y, sspList[i].stopCol.z, 1) != Color.black) { objPa.BroadcastMessage("ChangeResColor", new Color(sspList[i].stopCol.x, sspList[i].stopCol.y, sspList[i].stopCol.z, 1)); } else { objPa.BroadcastMessage("ChangeResColor", Color.magenta); } ShowMuscle(sspInfoList[i]); return; } else if (sspList[i].stopCol == new Vector3(chosCol.r, chosCol.g, chosCol.b)) { ShowInfo(sspInfoList[i]); objPa.BroadcastMessage("ChangeResColor", chosCol); if (new Color(sspList[i].startCol.x, sspList[i].startCol.y, sspList[i].startCol.z, 1) != Color.black) { objPa.BroadcastMessage("ChangeChoseColor", new Color(sspList[i].startCol.x, sspList[i].startCol.y, sspList[i].startCol.z, 1)); } else { objPa.BroadcastMessage("ChangeChoseColor", Color.magenta); } ShowMuscle(sspInfoList[i]); return; } } } else { ExpPanel.SetActive(false); MenuPanel.SetActive(false); } } } }