- LocalizationManager: 新增翻译表(SetFormatted/SetDuration/LocalizeOperateMsg) - LoginPanel: InputField placeholder本地化、字体颜色保持 - HistoryPanel: 用时数据本地化、placeholder本地化 - RecordDetailPanel: 操作详情消息本地化(LanguageChanged重建) - AppraiseWindowBase: 评价等级本地化、操作消息重建 - EditorAppraiser: 所有评估消息改用InjectOperateMsgLocalized - StudentOperateRecorder: 新增InjectOperateMsgLocalized方法 - LocalizationLanguageTestBar: 单例模式、ScreenSpaceOverlay筛选 - 字体切换时保留颜色和verticalOverflow
188 lines
13 KiB
C#
188 lines
13 KiB
C#
using System.Collections;
|
||
using System.Collections.Generic;
|
||
using UnityEngine;
|
||
using System.IO;
|
||
|
||
//案例文件加载类
|
||
public static class FixLinkFileCreater
|
||
{
|
||
//读取本地文件 转换为维修环节集合
|
||
public static List<FixLink> LoadFixFile(string path)
|
||
{
|
||
if (!File.Exists(path)) return null;
|
||
List<FixLink> linkDatas = new List<FixLink>();
|
||
string[] allLines = File.ReadAllLines(path);
|
||
int currentReadIndex=0;
|
||
int fixIndex = 1;//开始节点为第一个节点 与枚举对应
|
||
while (currentReadIndex < allLines.Length - 1)
|
||
{
|
||
FixLink oneLink = GetOnLink(fixIndex,allLines, ref currentReadIndex);
|
||
if (oneLink != null&&oneLink.steps.Count!=0)
|
||
linkDatas.Add(oneLink);
|
||
fixIndex++;
|
||
}
|
||
return linkDatas;
|
||
}
|
||
|
||
|
||
//从执行索引开始分析每一行的数据 直到遇到分割线 或到达结尾 返回一个阶段 并为索引赋值 避免死循环
|
||
static FixLink GetOnLink(int index,string[] allLines ,ref int startIndex)
|
||
{
|
||
FixLink fixLink = new FixLink();
|
||
fixLink.steps = new List<StepData>();
|
||
fixLink.questions = new List<Question>();
|
||
fixLink.fixLinkEnum = (FixLinkEnum)index;
|
||
string line = null;
|
||
string preIDStr = null;
|
||
for (int i = startIndex; i < allLines.Length; i++)
|
||
{
|
||
line = allLines[i];
|
||
line.Trim();
|
||
if (string.IsNullOrEmpty(line))
|
||
continue;
|
||
if (line.StartsWith("--------"))//遇到分割线返回一个节点 并为下次分析的起始索引赋值
|
||
{
|
||
startIndex = i+1;
|
||
return fixLink;
|
||
}
|
||
else if(line.StartsWith("("))//步骤
|
||
{
|
||
StepData oneStep = new StepData();
|
||
//oneStep.id =
|
||
if (line.Contains("Q"))//存在前置步骤
|
||
{
|
||
//oneStep.preIDs = new List<string>();
|
||
string[] lineMsg = line.Split('Q');
|
||
oneStep.describe = lineMsg[0];
|
||
for (int j = 1; j < lineMsg.Length; j++)
|
||
{
|
||
preIDStr = lineMsg[j].Trim();
|
||
if (string.IsNullOrEmpty(preIDStr))
|
||
{
|
||
//oneStep.preIDs.Add(preIDStr);
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
startIndex = allLines.Length - 1;//遍历完成
|
||
return fixLink;
|
||
}
|
||
|
||
|
||
//创建案例1 的流程熟悉xml文件
|
||
public static void CreatFixCase1Xml(string path)
|
||
{
|
||
List<FixLink> 一体化装置维修 = new List<FixLink>();
|
||
FixLink 拆卸 = new FixLink();
|
||
拆卸.steps = new List<StepData>();
|
||
拆卸.steps.Add(new StepData(1, "用三角木将左右各两个车轮固定,防止车辆移动;",null));
|
||
拆卸.steps.Add(new StepData(2, "将二、三、四车桥的驻车制动缸中心螺栓拧出,彻底解除驻车制动;", new int[] { 1}));
|
||
拆卸.steps.Add(new StepData(3, "将二桥或三桥的任意一个下悬架顶起,使车轮离开地面,为拆卸变速器与分动器之间的传动轴做好准备;", new int[] { 2 }));
|
||
拆卸.steps.Add(new StepData(4, "打开锁扣,向右侧掀起动力舱前部进、排气百叶窗盖板;", new int[] { 3 }));
|
||
拆卸.steps.Add(new StepData(5, "打开锁扣,吊下后部盖板;", null));
|
||
拆卸.steps.Add(new StepData(6, "拧下横梁两侧水平方向固定四个螺栓,向上拆出动力舱中部的横梁;", null));
|
||
拆卸.steps.Add(new StepData(7, "拆下各个方向位置的动力舱隔板;", null));
|
||
拆卸.steps.Add(new StepData(8, "在动力舱后部右侧距底甲板 417mm 处,解脱发动机燃油供油管快速接头(在一体化动力装置侧具有较长的连接胶管);", null));
|
||
拆卸.steps.Add(new StepData(9, "在动力舱后部右侧顶部,解脱发动机燃油回油管快速接头;", null));
|
||
拆卸.steps.Add(new StepData(10, "在动力舱前隔板侧壁上,解脱离合器工作缸与离合器主缸连接油管的快速接头;", null));
|
||
拆卸.questions = new List<Question>();
|
||
拆卸.fixLinkEnum = FixLinkEnum.拆卸;
|
||
一体化装置维修.Add(拆卸);
|
||
FixLink 安装 = new FixLink();
|
||
安装.steps = new List<StepData>();
|
||
安装.steps.Add(new StepData(1, "将变速操纵器钢丝软轴顺平固定,将变速操纵器盒插入变速器顶部;", null));
|
||
安装.steps.Add(new StepData(2, "将在车体侧面的风扇冷却变量泵的吸油管用细铁丝困扎便于拖拽穿行;", new int[] { 1 }));
|
||
安装.steps.Add(new StepData(3, "使用专用吊具起吊一体化动力装置,检查吊绳的平衡性和一体化动力装置扭转偏斜情况,必要时做调整;", new int[] { 1, 2 }));
|
||
安装.steps.Add(new StepData(4, "向动力舱内吊入一体化动力装置,在一体化动力装置下落过程中,在适当位置将风扇冷却变量泵的吸油管从空气压缩机出气管下方穿过,到达变速器上表面;", new int[] { 3 }));
|
||
安装.steps.Add(new StepData(5, "在一体化动力装置落座前 10mm 处,插入右前方固定螺栓,用手适当拧紧,同时连接主变量泵进油管接头。然后一体化动力装置落座;", null));
|
||
安装.steps.Add(new StepData(6, "连接电路线束:动力舱前端采集控制器信号电缆插头;发动机右侧中间顶部电控装置电控执行器电缆插头;变速器温度传感器插头;", new int[] { 4}));
|
||
安装.steps.Add(new StepData(7, "连接油管:风扇变量泵吸油管快速接头;风扇变量泵高压管快速接头;风扇变量泵温控阀泄油管螺套:风扇变量泵回油管快速接头;风扇马达出油管与滤清器螺套;转向油泵吸油管快速接头:转向油泵高压油管快速接头:离合器主缸与工作缸连接油管快速接头;分动器回油管快速接头;柴油回油管快速接头;", null));
|
||
安装.steps.Add(new StepData(8, "连接气管:离合器及其换挡工作缸供气管连接螺套;发动机断油工作缸气管连接螺套;一体化动力装置中部发动机排气管与消音器连接卡套;动力舱右前角空气压缩机与干燥器连接螺套;", null));
|
||
安装.steps.Add(new StepData(9, "连接水管:加温器进水管快速接头;", null));
|
||
安装.steps.Add(new StepData(10, "机械连接:车体内侧右前方一体化动力装置螺栓;", null));
|
||
安装.questions = new List<Question>();
|
||
安装.questions.Add(new Question("问题1:具体实施安装按照工位可划分几个工位点?",new XDictionary<string, string>() { { "A", "2个"}, { "B", "3个" }, { "C", "4个" }, { "D", "5个" } }, "C"));
|
||
安装.questions.Add(new Question("问题2:油路、水路、电气和机械连接时,快速接头、连接螺套、电气信号与控制插头、变速操纵器盒、传动轴及一体化动力装置底座等螺栓连接分别有几处?"
|
||
, new XDictionary<string, string>() {
|
||
{ "A", "快速接头13处、螺套5处、信号与控制插头8处、螺栓连接12处" },
|
||
{ "B", "快速接头10处、螺套6处、信号与控制插头11处、螺栓连接11处" },
|
||
{ "C", "快速接头12处、螺套5处、信号与控制插头6处、螺栓连接15处" },
|
||
{ "D", "快速接头11处、螺套7处、信号与控制插头10处、螺栓连接10处" }
|
||
}
|
||
, "A"));
|
||
安装.questions.Add(new Question("问题3:安装时技术条件有哪些?"
|
||
, new XDictionary<string, string>() {
|
||
{ "A", "活动件与管路的间隙大于3mm,活动件和活动件的间隙大于5mm" },
|
||
{ "B", "活动件与管路的间隙大于3mm,活动件和活动件的间隙大于4mm" },
|
||
{ "C", "活动件与管路的间隙大于2mm,活动件和活动件的间隙大于5mm" }, }
|
||
, "B"));
|
||
安装.fixLinkEnum = FixLinkEnum.安装;
|
||
一体化装置维修.Add(安装);
|
||
XmlHelper.SerializeObjectXML(一体化装置维修, typeof(List<FixLink>), path);
|
||
}
|
||
|
||
|
||
//创建案例2 的流程熟悉xml文件
|
||
public static void CreatFixCase2Xml(string path)
|
||
{
|
||
List<FixLink> 轮边维修 = new List<FixLink>();
|
||
FixLink 拆卸 = new FixLink();
|
||
拆卸.steps = new List<StepData>();
|
||
拆卸.steps.Add(new StepData(1, "拧松轮胎螺母,顶起车轮,使被拆卸的车轮离开地面;", null));
|
||
拆卸.steps.Add(new StepData(2, "拆下轮胎护罩及车轮;", new int[] { 1 }));
|
||
拆卸.steps.Add(new StepData(3, "用三颗M12x1.5 的螺栓顶出制动鼓;", new int[] { 2 }));
|
||
拆卸.steps.Add(new StepData(4, "拆下轮边减速器上的放油螺塞及注油螺塞,放净齿轮油;", new int[] { 3 }));
|
||
拆卸.steps.Add(new StepData(5, "拆下端盖固定螺栓,取下端盖;", new int[] { 4 }));
|
||
拆卸.steps.Add(new StepData(6, "拆下卡环、取出调整垫,承推垫圈;", new int[] { 5 }));
|
||
拆卸.steps.Add(new StepData(7, "从外半轴上拆下卡环,取出隔环,取下太阳轮;", new int[] { 6 }));
|
||
拆卸.steps.Add(new StepData(8, "拆下轮边减速器固定螺栓,从拆卸螺孔用三颗固定螺栓均匀顶出行星架-减速器罩,从行星架内侧取出承推滑块;", new int[] { 7 }));
|
||
拆卸.steps.Add(new StepData(9, "拆下锁紧及调整花螺母,取下齿圈;", new int[] { 8 }));
|
||
拆卸.questions = new List<Question>();
|
||
拆卸.fixLinkEnum = FixLinkEnum.拆卸;
|
||
轮边维修.Add(拆卸);
|
||
|
||
FixLink 安装 = new FixLink();
|
||
安装.steps = new List<StepData>();
|
||
安装.steps.Add(new StepData(1, "将齿圈总成装到转向节上;", null));
|
||
安装.steps.Add(new StepData(2, "用专用套筒拧紧轮毂内螺母,以使轮毂完全到位,然后将螺母松回 1/4-1/2圈,装上锁片及外螺母并拧紧;", new int[] { 1 }));
|
||
安装.steps.Add(new StepData(3, "合格后翻起锁片,锁住内外螺母;", new int[] { 2 }));
|
||
安装.steps.Add(new StepData(4, "将承推滑块安置在行星架内侧,然后将行星架装于轮毂上;", new int[] { 3 }));
|
||
安装.steps.Add(new StepData(5, "用扭力扳手按规定力矩拧紧框架与轮毂的结合螺栓;", null));
|
||
安装.steps.Add(new StepData(6, "将太阳轮套装与外半轴上;", new int[] { 4 }));
|
||
安装.steps.Add(new StepData(7, "将隔环和卡环装与外半轴上;", null));
|
||
安装.steps.Add(new StepData(8, "将承推垫圈、调整垫圈及卡环装入框架响应的槽内;", null));
|
||
安装.steps.Add(new StepData(9, "将千分表装于框架上,使千分表触头抵紧承推垫圈,扳动轮毂左右摆动,以检查太阳轮轴向间隙;", null));
|
||
安装.steps.Add(new StepData(10, "在端盖的接合面上涂一薄层密封胶 FN-303,放上密封纸垫,装于框架上后,按规定力矩拧紧螺栓;", null));
|
||
安装.steps.Add(new StepData(11, "拧上并拧紧放油螺塞,从注油孔注入 1.5L清洁合格的 18 号双曲线齿轮油,拧上注油螺塞;", null));
|
||
|
||
安装.questions = new List<Question>();
|
||
安装.questions.Add(new Question("问题1:轮毂内外螺母安装技术条件?",
|
||
new XDictionary<string, string>() {
|
||
{ "A", "内螺母拧紧力矩不小于300N.m,外螺母拧紧力矩不小于500-550N.m,轮毂轴向间隙为0.1-0.3mm" },
|
||
{ "B", "内螺母拧紧力矩不小于200N.m,外螺母拧紧力矩不小于400-450N.m,轮毂轴向间隙为0.2-0.5mm" },
|
||
{ "C", "内螺母拧紧力矩不小于250N.m,外螺母拧紧力矩不小于450-500N.m,轮毂轴向间隙为0.1-0.2mm" },
|
||
{ "D", "内螺母拧紧力矩不小于300N.m,外螺母拧紧力矩不小于400-450N.m,轮毂轴向间隙为0.2-0.4mm" } }
|
||
, "A"));
|
||
安装.questions.Add(new Question("问题2:行星框架与轮毂的结合螺栓安装技术条件?"
|
||
, new XDictionary<string, string>() {
|
||
{ "A", "拧紧力矩50-70N.m" },
|
||
{ "B", "拧紧力矩70-90N.m" },
|
||
{ "C", "拧紧力矩60-80N.m" },
|
||
{ "D", "拧紧力矩90-110N.m" }
|
||
}
|
||
, "B"));
|
||
安装.questions.Add(new Question("问题3:太阳轮安装技术条件?"
|
||
, new XDictionary<string, string>() {
|
||
{ "A", "轴向、端面间隙0.1-0.5mm" },
|
||
{ "B", "轴向、端面间隙0.1-0.3mm" },
|
||
{ "C", "轴向、端面间隙0.2-0.4mm" }, }
|
||
, "B"));
|
||
安装.fixLinkEnum = FixLinkEnum.安装;
|
||
|
||
轮边维修.Add(安装);
|
||
|
||
XmlHelper.SerializeObjectXML(轮边维修, typeof(List<FixLink>), path);
|
||
}
|
||
}
|