private void UpdQSInfo() { try { try { var tinfo = _ct.Request.Form["tinfo"]; if (string.IsNullOrEmpty(tinfo)) { string jsonstrlist = JsonHelper.GetJsonString(new jsonResult { code = "没有竞猜值", result = "", count = 0 }); _ct.Response.Write(jsonstrlist); } else { var tlist = tinfo.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries); string tsd = _ct.Request.UrlReferrer.Host; var std1 = _ct.Request.UserHostAddress; foreach (var item in tlist) { var tdetal = item.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); var txmid = Convert.ToInt32(tdetal[1]); var str = 0; ProcSection proc = DbSession.Default.FromProc("p_UpdateQSJg") .AddInParameter("cid", DbType.Int32, txmid) .AddInParameter("jg", DbType.String, tdetal[2]) .AddInParameter("jf", DbType.Int32, Convert.ToInt32(WebConfigurationManager.AppSettings["curjf"])) .AddOutParameter("return", DbType.Int32); int tid = proc.ExecuteNonQuery(); Dictionary <string, object> returnValue = proc.GetReturnValues(); foreach (KeyValuePair <string, object> kv in returnValue) { object creturn = kv.Value; } } string jsonstrlist = JsonHelper.GetJsonString(new jsonResult { code = "数据更新成功", result = "", count = 1 }); _ct.Response.Write(jsonstrlist); } } catch (Exception ex) { string st = ex.Message; } finally { } } catch (Exception ex) { string jsonstrlist = JsonHelper.GetJsonString(new jsonResult { code = ex.Message, result = "", count = 0 }); _ct.Response.Write(jsonstrlist); } }
private void addCursorTransform(Vector3 up, Vector3 forward, Vector3 right) { knotNormals.Add(up); knotBinormals.Add(forward); knotTangents.Add(right); knotLengths.Add(spline.Length()); ProcSection ps = cursorTransform.GetComponent <ProcSection>(); knotHeight.Add(ps.m_Height); knotWidth.Add(ps.m_Width); knotThickness.Add(ps.m_Thickness); }
public void StartDrawing(Vector3 position, Quaternion rotation) { startPosition = position; GameObject go = Instantiate(objectCursor, Vector3.zero, Quaternion.identity) as GameObject; objectCursor.SetActive(false); if (objectType == ObjectType.Shape) { shape = go.GetComponent <ProcShape>(); shape.ResetPoint(GridSnapTool.Snap(position), transform.rotation.eulerAngles.x); // checks if there is a mirror -> make a copy if (ms.gameObject.activeSelf) { ms.CreateReflection(go, scene.transform); ms.reflection.transform.position = go.transform.position; ms.reflection.GetComponent <ProcShape>().startPoint = ms.ReflectPoint(GridSnapTool.Snap(position)); } } if (objectType == ObjectType.Section) { section = go.GetComponent <ProcSection>(); section.ResetPoint(GridSnapTool.Snap(position), transform.rotation.eulerAngles.x); // checks if there is a mirror -> make a copy if (ms.gameObject.activeSelf) { ms.CreateReflection(go, scene.transform); ms.reflection.transform.position = go.transform.position; ms.reflection.GetComponent <ProcSection>().startPoint = ms.ReflectPoint(GridSnapTool.Snap(position)); } } if (objectType == ObjectType.Hair) { go = Instantiate(Resources.Load("HairSplineTrail"), new Vector3(0, 0, 0), Quaternion.identity) as GameObject; go.GetComponent <HairSplineTrail>().Init(hairObject); hair = go.GetComponent <ProcHair>(); hair.ResetPoint(GridSnapTool.Snap(position), transform.rotation.eulerAngles.x); // checks if there is a mirror -> make a copy if (ms.gameObject.activeSelf) { ms.CreateReflection(go, scene.transform); ms.reflection.transform.position = go.transform.position; ms.reflection.GetComponent <ProcHair>().startPoint = ms.ReflectPoint(GridSnapTool.Snap(position)); } } }
/// <summary> /// 初始化流程开始、结束节点 /// </summary> /// <param name="FlowCode"></param> /// <returns></returns> public int LoadingNode(string FlowCode) { try { ProcSection proc = Db.Context.FromProc("proc_loadingFlowNode") .AddInParameter("@FlowCode", DbType.String, FlowCode) .AddOutParameter("@result", DbType.Int32); proc.ExecuteNonQuery(); int result = Convert.ToInt32(proc.GetReturnValues().First().Value); return(result); } catch (Exception) { return(0); } }
void ChangeShape(ObjectType typeObject, int index) { if (typeObject == ObjectType.Shape) { SetToObjectType(LineTool.ObjectType.Shape); ProcShape shape = shapeObject.GetComponent <ProcShape>(); shape.radialSegmentCount = index; } if (typeObject == ObjectType.Section) { SetToObjectType(LineTool.ObjectType.Section); ProcSection sect = sectionObject.GetComponent <ProcSection>(); sect.shapeType = ShapeTypes[index]; } if (typeObject == ObjectType.Hair) { SetToObjectType(LineTool.ObjectType.Hair); ProcHair hair = hairObject.GetComponent <ProcHair>(); hair.radialSegmentCount = index; } }
void ChangeShape(ObjectType typeObject, int index) { controller.DeviceController.TriggerHapticPulse(pulseLength); if (typeObject == ObjectType.Shape) { SetToObjectType(SplineTool.ObjectType.Shape); ProcShape shape = shapeObject.GetComponent <ProcShape>(); shape.radialSegmentCount = index; } if (typeObject == ObjectType.Section) { SetToObjectType(SplineTool.ObjectType.Section); ProcSection sect = sectionObject.GetComponent <ProcSection>(); sect.shapeType = ShapeTypes[index]; } if (typeObject == ObjectType.Hair) { SetToObjectType(SplineTool.ObjectType.Hair); ProcHair hair = hairObject.GetComponent <ProcHair>(); hair.radialSegmentCount = index; } }
/// <summary> /// 下达计划 /// </summary> /// <param name="obj"></param> /// <returns></returns> public bool GenerateWorkOrder(Mes_Plan_WorkOrder obj) { int result = -1; ProcSection proc = this.CurDbSession.FromProc("") .AddInParameter("@WorkOrderType", System.Data.DbType.String, 50, obj.WorkOrderType) .AddInParameter("@WorkOrderNumber", System.Data.DbType.String, 50, obj.WorkOrderNumber) .AddInParameter("@MaterialProNo", System.Data.DbType.String, 50, obj.MaterialProNo) .AddInParameter("@MaterialCode", System.Data.DbType.String, 50, obj.MaterialCode) .AddInParameter("@Version", System.Data.DbType.String, 20, obj.Version) .AddInParameter("@WorkNum", System.Data.DbType.Int32, obj.WorkNum) .AddOutParameter("@ErrMsg", System.Data.DbType.String, 100) .AddOutParameter("@OptionResult", System.Data.DbType.Int32, 1); proc.ExecuteNonQuery(); Dictionary <string, object> returnValue = proc.GetReturnValues(); Int32 recout = -1; string sMsg = string.Empty; foreach (KeyValuePair <string, object> kv in returnValue) { if (kv.Key == "OptionResult") { recout = Convert.ToInt32(kv.Value); } if (kv.Key == "ErrMsg") { sMsg = Convert.ToString(kv.Value); } } if (recout < 0) { return(false); } return(true); }
public void EndDrawing() { // set the collider and the mesh if (objectType == ObjectType.Shape) { shape.SetMeshCollider(); ObjectManager.instance.AddObject(shape.gameObject); shape.gameObject.AddComponent <MeshEditor>().StartGroupGeneration(); shape = null; // add reflection if (ms.gameObject.activeSelf) { ms.reflection.GetComponent <ProcShape>().SetMeshCollider(); ObjectManager.instance.AddObject(ms.reflection); } } else if (objectType == ObjectType.Section) { section.SetMeshCollider(); ObjectManager.instance.AddObject(section.gameObject); section.gameObject.GetComponent <MeshEditor>().StartGroupGeneration(); section = null; // add reflection if (ms.gameObject.activeSelf) { ms.reflection.GetComponent <ProcSection>().SetMeshCollider(); ObjectManager.instance.AddObject(ms.reflection); } } else if (objectType == ObjectType.Hair) { hair.SetMeshCollider(); hair.gameObject.GetComponent <MeshEditor>().StartGroupGeneration(); // add reflection if (ms.gameObject.activeSelf) { ms.reflection.GetComponent <ProcHair>().SetMeshCollider(); ObjectManager.instance.AddObject(ms.reflection); } var refTrail = hair.GetComponent <HairSplineTrail>(); GameObject trail = Instantiate(Resources.Load("NURBSTrail"), new Vector3(0, 0, 0), Quaternion.identity) as GameObject; trail.GetComponent <NURBSTrail>().InitNURBS(refTrail.spline, refTrail.trackLength, new Vector3(0.005f, 0, 0)); trail.GetComponent <MeshRenderer>().material.color = hair.GetComponent <MeshRenderer>().material.color; hair = null; Destroy(hair.GetComponent <HairSplineTrail>()); Destroy(hair); refTrail.Init(hairObject); ObjectManager.instance.AddObject(trail); Destroy(go.GetComponent <HairSplineTrail>()); } if (ms.gameObject.activeSelf) { ms.reflection.GetComponent <MeshEditor>().StartGroupGeneration(); } // set object cursor back objectCursor.SetActive(true); GameObject.Find("Tracker").GetComponent <TrackerScript>().numMesh++; }
public void UpdateDrawing(Vector3 pos, Vector3 up, Vector3 forward, Vector3 right) { // set the collider and the mesh if (objectType == ObjectType.Shape) { shape = shapeObject.GetComponent <ProcShape>(); Vector3 actualPosition = pos; if (ConstrainX) { actualPosition.x = StartPoint.x; } if (ConstrainY) { actualPosition.y = StartPoint.y; } if (ConstrainZ) { actualPosition.z = StartPoint.z; } //shape.SetEndPoint(actualPosition); go.GetComponent <ShapeSplineTrail>().BuildMeshTrail(GridSnapTool.Snap(actualPosition), up, forward, right); // update reflection if (ms.gameObject.activeSelf) { ms.reflection.GetComponent <ShapeSplineTrail>().BuildMeshTrail(ms.ReflectPoint(GridSnapTool.Snap(actualPosition)), ms.ReflectVector(up), ms.ReflectVector(forward), ms.ReflectVector(right)); } ToolTracker.net[1] = 1; ToolTracker.net[2] = 2; ToolTracker.net[3] = 1; //ToolTracker.net[4] = (int)shapeObject.GetComponent<ProcShape>().m_Radius; } else if (objectType == ObjectType.Section) { Vector3 actualPosition = pos; section = sectionObject.GetComponent <ProcSection>(); if (ConstrainX) { actualPosition.x = StartPoint.x; } if (ConstrainY) { actualPosition.y = StartPoint.y; } if (ConstrainZ) { actualPosition.z = StartPoint.z; } //section.SetEndPoint(actualPosition); go.GetComponent <SectionSplineTrail>().BuildMeshTrail(GridSnapTool.Snap(actualPosition), up, forward, right); // update reflection if (ms.gameObject.activeSelf) { ms.reflection.GetComponent <SectionSplineTrail>().BuildMeshTrail(ms.ReflectPoint(GridSnapTool.Snap(actualPosition)), -ms.ReflectVector(up), -ms.ReflectVector(forward), -ms.ReflectVector(right)); } ToolTracker.net[1] = 2; ToolTracker.net[2] = 2; ToolTracker.net[3] = 1; //ToolTracker.net[4] = (int)sectionObject.GetComponent<ProcShape>().m_Radius; } else if (objectType == ObjectType.Hair) { Vector3 actualPosition = pos; hair = sectionObject.GetComponent <ProcHair>(); if (ConstrainX) { actualPosition.x = StartPoint.x; } if (ConstrainY) { actualPosition.y = StartPoint.y; } if (ConstrainZ) { actualPosition.z = StartPoint.z; } go.GetComponent <HairSplineTrail>().BuildMeshTrail(GridSnapTool.Snap(actualPosition), up, forward, right, false); // update reflection if (ms.gameObject.activeSelf) { ms.reflection.GetComponent <HairSplineTrail>().BuildMeshTrail(ms.ReflectPoint(GridSnapTool.Snap(actualPosition)), -ms.ReflectVector(up), -ms.ReflectVector(forward), -ms.ReflectVector(right), false); } } }
public void Init(GameObject Cursor) { Debug.Log("Initiated!"); if (Cursor == null) { Debug.Log("GameObject 'Shape' is not assigned!"); Application.Quit(); } // setups the script to track input cursor in 3D space cursorTransform = Cursor.transform; transform.position = new Vector3(0, 0, 0); // gets radial segment and radius ProcSection ps = Cursor.GetComponent <ProcSection>(); shapeType = ps.shapeType; //Get MeshRenderer and set to color of the cursor MeshRenderer mr = GetComponent <MeshRenderer>(); mr.material.color = ps.m_RGB; //Create a new mesh builder: meshBuilder = new MeshBuilder(); //Look for a MeshFilter component attached to this GameObject: filter = GetComponent <MeshFilter>(); //Look for a MeshCollider component attached to this GameObject: meshCollider = GetComponent <MeshCollider>(); // creates the spline if (spline == null) { spline = new CatmullRomSpline(); // add knots via position List <Knot> knots = spline.knots; Vector3 point = cursorTransform.position; // initiate normals at the starting knot knotNormals = new List <Vector3>(); knotBinormals = new List <Vector3>(); knotTangents = new List <Vector3>(); knotLengths = new List <float>(); knotWidth = new List <float>(); knotHeight = new List <float>(); knotThickness = new List <float>(); for (int i = 0; i < 3; ++i) { addCursorTransform(); } knots.Add(new Knot(point)); knots.Add(new Knot(point)); knots.Add(new Knot(point)); knots.Add(new Knot(point)); knots.Add(new Knot(point)); startKnot = 0; } //Build the mesh: StartTracking(); }