unityzgy/.svn/pristine/25/25d5daebb623c7a574fed9ee348e812620c8192c.svn-base
ayuan9957 bf12e02276 feat: 多语言本地化系统 - 支持中/英/法/俄实时切换
- LocalizationManager: 新增翻译表(SetFormatted/SetDuration/LocalizeOperateMsg)
- LoginPanel: InputField placeholder本地化、字体颜色保持
- HistoryPanel: 用时数据本地化、placeholder本地化
- RecordDetailPanel: 操作详情消息本地化(LanguageChanged重建)
- AppraiseWindowBase: 评价等级本地化、操作消息重建
- EditorAppraiser: 所有评估消息改用InjectOperateMsgLocalized
- StudentOperateRecorder: 新增InjectOperateMsgLocalized方法
- LocalizationLanguageTestBar: 单例模式、ScreenSpaceOverlay筛选
- 字体切换时保留颜色和verticalOverflow
2026-07-16 10:05:59 +08:00

130 lines
8.1 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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 CreatFixCaseOneXml(string path)
{
List<FixLink> fixLinks = 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[] { 1, 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.安装;
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.拆卸;
fixLinks.Add(安装);
fixLinks.Add(拆卸);
XmlHelper.SerializeObjectXML(fixLinks, typeof(List<FixLink>), path);
}
}