78 lines
2.3 KiB
C#
78 lines
2.3 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using System.Xml;
|
|
using System.IO;
|
|
using System.Linq;
|
|
|
|
public class FaultManager : BaseManager<FaultManager>
|
|
{
|
|
public List<string> Faults = new List<string>();
|
|
public FaultOptions originalFaultOptions = new FaultOptions();
|
|
public FaultOptions selectedFaultOptions = new FaultOptions();
|
|
|
|
public List<string> selectedFaultsInReg = new List<string>();
|
|
|
|
|
|
/// <summary>
|
|
/// 选中的故障
|
|
/// </summary>
|
|
/// <param name="SelectedFaults"></param>
|
|
public void InitFaults(List<string> SelectedFaults)
|
|
{
|
|
//设置所有故障
|
|
StepStateControl.instance.GetStepstate(GameManager.RunModelMgr.schemeID).SetOrigonFaultOption();
|
|
|
|
if (Faults.Count > 0) Faults.Clear();
|
|
Faults = new List<string>(SelectedFaults);
|
|
|
|
selectedFaultOptions = originalFaultOptions.GetSelectedFaultOptions(Faults);
|
|
|
|
}
|
|
|
|
public List<string> FaultOptionsToStringList(FaultOptions faultOptions)
|
|
{
|
|
List<string> faultList = new List<string>();
|
|
string dev = faultOptions.FaultDeviceShow?faultOptions.FaultDevice:"";
|
|
|
|
string fauTy = "";
|
|
foreach (var item in faultOptions.dataFaultType)
|
|
{
|
|
fauTy = faultOptions.FaultTypeShow?item.name:"";
|
|
string fauL1 = "";
|
|
foreach (var item1 in item.dataFaultSituationL1)
|
|
{
|
|
fauL1 = faultOptions.FaultSituationL1Show?item1.name:"";
|
|
string fauL2 = "";
|
|
foreach (var item2 in item1.dataFaultSituationL2)
|
|
{
|
|
fauL2 = faultOptions.FaultSituationL2Show?item2.L2name:"";
|
|
string genInfo = dev;
|
|
if(!genInfo.Equals("")) genInfo += "_";
|
|
genInfo += fauTy;
|
|
if (!genInfo.Equals("")) genInfo += "_";
|
|
genInfo += fauL1;
|
|
if (!genInfo.Equals("")) genInfo += "_";
|
|
genInfo += fauL2;
|
|
faultList.Add(genInfo);
|
|
}
|
|
}
|
|
}
|
|
|
|
return faultList;
|
|
|
|
}
|
|
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
}
|