public override void Read(PackFileDeserializer des, BinaryReaderEx br) { base.Read(des, br); m_bitsPerIndex = br.ReadInt32(); m_bitsPerWIndex = br.ReadInt32(); m_wIndexMask = br.ReadInt32(); m_indexMask = br.ReadInt32(); m_radius = br.ReadSingle(); m_weldingType = (WeldingType)br.ReadByte(); m_materialType = (MaterialType)br.ReadByte(); br.ReadUInt16(); m_materials = des.ReadUInt32Array(br); m_materials16 = des.ReadUInt16Array(br); m_materials8 = des.ReadByteArray(br); m_transforms = des.ReadQSTransformArray(br); m_bigVertices = des.ReadVector4Array(br); m_bigTriangles = des.ReadClassArray <hkpCompressedMeshShapeBigTriangle>(br); m_chunks = des.ReadClassArray <hkpCompressedMeshShapeChunk>(br); m_convexPieces = des.ReadClassArray <hkpCompressedMeshShapeConvexPiece>(br); m_error = br.ReadSingle(); br.ReadUInt32(); m_bounds = new hkAabb(); m_bounds.Read(des, br); m_defaultCollisionFilterInfo = br.ReadUInt32(); br.ReadUInt64(); br.ReadUInt32(); m_materialStriding = br.ReadUInt16(); m_numMaterials = br.ReadUInt16(); br.ReadUInt32(); m_namedMaterials = des.ReadClassArray <hkpNamedMeshMaterial>(br); br.ReadUInt64(); }
/// <summary> /// 计算关开关成绩 /// </summary> /// <param name="weldingType"></param> /// <param name="state"></param> /// <returns></returns> public static decimal CalcSwitchOffResult(WeldingType weldingType, DeviceState state) { var score = DeviceStateConfig.CalcSwitchOffResult(WeldingSteps, weldingType, state); WeldingPart.TitleScore += score; return(score); }
/// <summary> /// 计算穿戴成绩 /// </summary> /// <param name="dressReport"></param> /// <param name="weldingType"></param> /// <param name="selectedUtensilList"></param> /// <returns></returns> public static decimal CalcDressResult( WeldingType weldingType, IEnumerable <Utensil> selectedUtensilList) { var userDress = selectedUtensilList == null ? new Utensil[0] : (selectedUtensilList as Utensil[] ?? selectedUtensilList.ToArray()); return(DeviceStateConfig.CalcDressResult(DressPart, weldingType, userDress)); }
/// <summary> /// 获取虚拟焊接成绩百分比 /// </summary> /// <param name="weldingType"></param> /// <returns></returns> public static decimal GetVirtualWeldingScorePercent(WeldingType weldingType) { var total = CheckConfigs[weldingType].WeldingCheckConfig.VirtualWeldingTotal; if (weldingType == WeldingType.ArgonArcWelding) { return(total / 90); } return(total / 100); }
public override void Read(PackFileDeserializer des, BinaryReaderEx br) { base.Read(des, br); m_vertices = des.ReadVector4Array(br); m_triangles = des.ReadClassArray <hkpSimpleMeshShapeTriangle>(br); m_materialIndices = des.ReadByteArray(br); m_radius = br.ReadSingle(); m_weldingType = (WeldingType)br.ReadByte(); br.ReadUInt16(); br.ReadByte(); }
/// <summary> /// 计算检查隐患成绩 /// </summary> /// <param name="weldingType"></param> /// <param name="state"></param> /// <returns></returns> public static decimal CalcCheckTroubleResult(WeldingType weldingType, DeviceState state) { var steps = new Steps(); CheckTroublePart.StepList.Add(steps); var score = DeviceStateConfig.CalcCheckTroubleResult(steps, weldingType, state); CheckTroublePart.TitleScore += score; return(score); }
/// <summary> /// 计算虚拟焊接成绩 /// </summary> /// <param name="weldingType"></param> /// <param name="iniPath"></param> /// <returns></returns> public static decimal CalcVirtualWeldingResult(WeldingType weldingType, string iniPath) { var percent = DeviceStateConfig.GetVirtualWeldingScorePercent(weldingType); var score = weldingType == WeldingType.ArgonArcWelding ? ArgonArcWeldingScoreParser.CalcScore(WeldingSteps, iniPath, percent) : WeldingScoreParser.CalcScore(WeldingSteps, iniPath, percent); WeldingPart.TitleScore += score; return(score); }
/// <summary> /// 计算穿戴成绩 /// </summary> /// <returns></returns> //public static decimal CalcDressResult( // Dictionary<WeldingType, IEnumerable<Utensil>> utensilDictionary, // WeldingType currentWeldingType, // IEnumerable<Utensil> selectedUtensilList, decimal weight) //{ // var answer = utensilDictionary[currentWeldingType]; // var answerArray = answer as Utensil[] ?? answer.ToArray(); // var userAnswerArray = selectedUtensilList == null ? new Utensil[0]: // (selectedUtensilList as Utensil[] ?? selectedUtensilList.ToArray()); // //求正确答案和用户答案的交集:得分项 // var intersect = answerArray.Intersect(userAnswerArray); // //求用户答案和正确答案的差集:扣分项 // var except = userAnswerArray.Except(answerArray); // var intersectArray = intersect as Utensil[] ?? intersect.ToArray(); // var exceptArray = except as Utensil[] ?? except.ToArray(); // DressPart.TitleScore = Math.Max(0, intersectArray.Length - exceptArray.Length)*weight; // //记录分步信息 // Steps steps = new Steps(); // DressPart.StepList.Add(steps); // foreach (var utensil in intersectArray) // { // steps.StepList.Add(new Step // { // StepName = EnumHelper.GetEnumDescription(utensil), // StepScore = weight // }); // } // foreach (var utensil in exceptArray) // { // steps.StepList.Add(new Step // { // StepName = EnumHelper.GetEnumDescription(utensil), // StepScore = -weight // }); // } // return DressPart.TitleScore; //} /// <summary> /// 计算焊前检查结果 /// </summary> /// <returns></returns> public static decimal CalcInspectionBeforeWeldingResult(WeldingType weldingType, DeviceState state) { WeldingSteps = new Steps(); WeldingPart.StepList.Add(WeldingSteps); var score = DeviceStateConfig.CalcInspectionBeforeWeldingResult(WeldingSteps, weldingType, state); WeldingPart.TitleScore += score; return(score); }
public override void Read(PackFileDeserializer des, BinaryReaderEx br) { base.Read(des, br); m_weldingInfo = br.ReadUInt16(); m_weldingType = (WeldingType)br.ReadByte(); m_isExtruded = br.ReadByte(); br.ReadUInt32(); m_vertexA = des.ReadVector4(br); m_vertexB = des.ReadVector4(br); m_vertexC = des.ReadVector4(br); m_extrusion = des.ReadVector4(br); }
public override void Read(PackFileDeserializer des, BinaryReaderEx br) { base.Read(des, br); br.ReadUInt64(); m_convexRadius = br.ReadSingle(); m_weldingType = (WeldingType)br.ReadByte(); m_hasPerPrimitiveCollisionFilterInfo = br.ReadBoolean(); m_hasPerPrimitiveUserData = br.ReadBoolean(); br.ReadByte(); m_collisionFilterInfoPalette = des.ReadUInt32Array(br); m_userDataPalette = des.ReadUInt32Array(br); m_userStringPalette = des.ReadStringPointerArray(br); br.ReadUInt64(); m_tree = new hkpBvCompressedMeshShapeTree(); m_tree.Read(des, br); }
/// <summary> /// 计算穿戴成绩 /// </summary> /// <returns></returns> public static decimal CalcDressResult( Title dressReport, WeldingType weldingType, IEnumerable <Utensil> selectedUtensilList) { var config = CheckConfigs[weldingType].DressConfig; decimal total = 0; var configArray = config as DressItem[] ?? config.ToArray(); //空间换时间 Steps steps = new Steps(); //加入计分报表 dressReport.StepList.Add(steps); foreach (var utensil in selectedUtensilList) { var score = false; decimal stepScore = 0; foreach (var dressItem in configArray.Where(dressItem => dressItem.Utensil == utensil)) { score = true;//用具选择正确 stepScore = dressItem.Score; break; } if (!score)//用具选择错误 { stepScore = -3; } //计分报表 steps.StepList.Add(new Step { StepName = EnumHelper.GetEnumDescription(utensil), StepScore = stepScore }); total += stepScore; } total = Math.Max(0, total);//不允许扣成负分 dressReport.TitleScore = total; return(total); }
public override void Read(PackFileDeserializer des, BinaryReaderEx br) { base.Read(des, br); m_scaling = des.ReadVector4(br); m_numBitsForSubpartIndex = br.ReadInt32(); br.ReadUInt32(); m_subparts = des.ReadClassArray <hkpMeshShapeSubpart>(br); m_weldingInfo = des.ReadUInt16Array(br); m_weldingType = (WeldingType)br.ReadByte(); br.ReadUInt16(); br.ReadByte(); m_radius = br.ReadSingle(); m_pad_0 = br.ReadInt32(); m_pad_1 = br.ReadInt32(); m_pad_2 = br.ReadInt32(); br.ReadUInt32(); }
public override void Read(PackFileDeserializer des, BinaryReaderEx br) { base.Read(des, br); m_embeddedTrianglesSubpart = new hkpExtendedMeshShapeTrianglesSubpart(); m_embeddedTrianglesSubpart.Read(des, br); m_aabbHalfExtents = des.ReadVector4(br); m_aabbCenter = des.ReadVector4(br); br.ReadUInt64(); m_numBitsForSubpartIndex = br.ReadInt32(); br.ReadUInt32(); m_trianglesSubparts = des.ReadClassArray <hkpExtendedMeshShapeTrianglesSubpart>(br); m_shapesSubparts = des.ReadClassArray <hkpExtendedMeshShapeShapesSubpart>(br); m_weldingInfo = des.ReadUInt16Array(br); m_weldingType = (WeldingType)br.ReadByte(); br.ReadUInt16(); br.ReadByte(); m_defaultCollisionFilterInfo = br.ReadUInt32(); m_cachedNumChildShapes = br.ReadInt32(); m_triangleRadius = br.ReadSingle(); br.ReadUInt64(); br.ReadUInt64(); }
/// <summary> /// 计算检查隐患成绩 /// </summary> /// <param name="steps"></param> /// <param name="weldingType"></param> /// <param name="state"></param> /// <returns></returns> public static decimal CalcCheckTroubleResult(Steps steps, WeldingType weldingType, DeviceState state) { var config = CheckConfigs[weldingType]; return(CalcWeldingResultHelper(steps, state, config.WeldingCheckConfig.CheckTrouble)); }
/// <summary> /// 计算焊前检查成绩 /// </summary> /// <param name="steps"></param> /// <param name="weldingType"></param> /// <param name="state"></param> /// <returns></returns> public static decimal CalcInspectionBeforeWeldingResult(Steps steps, WeldingType weldingType, DeviceState state) { var config = CheckConfigs[weldingType]; return(CalcWeldingResultHelper(steps, state, config.WeldingCheckConfig.InspectionBeforeWelding)); }