Day1Day2重构基本完成
This commit is contained in:
@@ -69,6 +69,11 @@ namespace AibisDream.FixSystem
|
||||
_bodyModuleSystem.oscilloscopeSystem.ShowScreenMessage("发热,无法检查", Color.red);
|
||||
_bodyModuleSystem.oscilloscopeSystem.PlayWave(WaveformType.HotNoise, false);
|
||||
}
|
||||
else if(data.cantStopRunning)
|
||||
{
|
||||
_bodyModuleSystem.oscilloscopeSystem.ShowScreenMessage("持续运行中,无法进入", Color.red);
|
||||
//_bodyModuleSystem.oscilloscopeSystem.ChangeDeepInButtonState(true);
|
||||
}
|
||||
else if(data.ignoreWaveCheck)
|
||||
{
|
||||
_bodyModuleSystem.oscilloscopeSystem.ShowScreenMessage("无需检查,允许进入", Color.yellow);
|
||||
@@ -123,7 +128,8 @@ namespace AibisDream.FixSystem
|
||||
SocketPos = socketPos.localPosition,
|
||||
waveformType = data.waveformType,
|
||||
waveHasError = data.waveHasError,
|
||||
ignoreWaveCheck = data.ignoreWaveCheck
|
||||
ignoreWaveCheck = data.ignoreWaveCheck,
|
||||
cantStopRunning=data.cantStopRunning
|
||||
};
|
||||
}
|
||||
|
||||
@@ -150,6 +156,8 @@ namespace AibisDream.FixSystem
|
||||
|
||||
public bool ignoreWaveCheck;
|
||||
|
||||
public bool cantStopRunning;
|
||||
|
||||
// 只读
|
||||
[JsonIgnore] public string PlugInNodeName => string.Format(PlugInNodeTemplate, moduleName);
|
||||
[JsonIgnore] public string DeepInNodeName => string.Format(DeepInTemplate, moduleName);
|
||||
|
||||
@@ -17,6 +17,7 @@ namespace AibisDream.FixSystem
|
||||
public GameObject bodyModulePrefab;
|
||||
[HideInInspector]public Transform bodyModuleGroup;
|
||||
[HideInInspector]public OscilloscopeSystem oscilloscopeSystem;
|
||||
[HideInInspector]public HeatMapController heatMapController;
|
||||
|
||||
|
||||
#endregion
|
||||
@@ -38,6 +39,16 @@ namespace AibisDream.FixSystem
|
||||
#region 系统状态
|
||||
|
||||
public bool inHotErr;
|
||||
private int heatValue;
|
||||
public int HeatValue
|
||||
{
|
||||
get => heatValue;
|
||||
set
|
||||
{
|
||||
heatValue = value;
|
||||
inHotErr = heatValue > 0;
|
||||
}
|
||||
}
|
||||
[HideInInspector]public BodyModule curBodyModule;
|
||||
|
||||
#endregion
|
||||
@@ -56,7 +67,7 @@ namespace AibisDream.FixSystem
|
||||
CableSystem = transform.Find("Cable System").GetComponent<CableSystem>();
|
||||
bodyModuleGroup = transform.Find("Body Module Group");
|
||||
oscilloscopeSystem = transform.Find("Oscilloscope System").GetComponent<OscilloscopeSystem>();
|
||||
|
||||
heatMapController=transform.Find("HeatMapController").GetComponent<HeatMapController>();
|
||||
FixSystemCenter.SystemDic.Register(this);
|
||||
}
|
||||
|
||||
@@ -95,6 +106,15 @@ namespace AibisDream.FixSystem
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 寻找指定名称的BodyModule
|
||||
/// </summary>
|
||||
/// <param name="modulename">模块名称</param>
|
||||
/// <returns>对应名称的BodyModule</returns>
|
||||
public BodyModule FindBodyModuleByName(string modulename)
|
||||
{
|
||||
return BodyModules?.FirstOrDefault(module => module.data.moduleName == modulename);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 深入检查
|
||||
@@ -106,16 +126,50 @@ namespace AibisDream.FixSystem
|
||||
CableSystem.curBodyModule.DeepIn();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 设置死循环状态
|
||||
/// </summary>
|
||||
public void SetModuleState_CantStopRunning(string moduleName,bool state)
|
||||
{
|
||||
BodyModule result = FindBodyModuleByName(moduleName);
|
||||
if (result != null)
|
||||
{
|
||||
Debug.Log("Found module: " + moduleName);
|
||||
result.data.cantStopRunning=state;
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log("Module not found.");
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 设置发热
|
||||
/// </summary>
|
||||
|
||||
public void SetHeat(int targetHeatValue)
|
||||
{
|
||||
|
||||
HeatValue=targetHeatValue;
|
||||
|
||||
heatMapController.SetTemptureDirect(HeatValue);
|
||||
}
|
||||
public void ShowHeatMap()
|
||||
{
|
||||
heatMapController.ShowHeatMap();
|
||||
ResetPlug();
|
||||
}
|
||||
public void HideHeatMap()
|
||||
{
|
||||
heatMapController.HideHeatMap();
|
||||
}
|
||||
/// <summary>
|
||||
/// 冷却后处理
|
||||
/// </summary>
|
||||
public void OnCooling()
|
||||
{
|
||||
if (!inHotErr) return;
|
||||
|
||||
if (!inHotErr) return;
|
||||
// 系统冷却
|
||||
inHotErr = false;
|
||||
heatValue = 0;
|
||||
curBodyModule?.ShowWave();
|
||||
}
|
||||
/// <summary>
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
using System.Collections;
|
||||
using AibisDream.FixSystem;
|
||||
using Yarn.Unity;
|
||||
|
||||
namespace AibisDream
|
||||
{
|
||||
public static class BodyModuleYarnCommand
|
||||
{
|
||||
private static BodyModuleSystem BodyModuleSystem => FixSystemCenter.SystemDic.Get<BodyModuleSystem>();
|
||||
|
||||
|
||||
[YarnCommand("SetModuleState_CantStopRunning")]
|
||||
public static void SetModuleState_CantStopRunning(string ModuleName,bool state)
|
||||
{
|
||||
BodyModuleSystem.SetModuleState_CantStopRunning(ModuleName,state);
|
||||
}
|
||||
[YarnCommand("ShowHeatMap")]
|
||||
public static void ShowHeatMap()
|
||||
{
|
||||
BodyModuleSystem.ShowHeatMap();
|
||||
}
|
||||
[YarnCommand("HideHeatMap")]
|
||||
public static void HideHeatMap()
|
||||
{
|
||||
BodyModuleSystem.HideHeatMap();
|
||||
}
|
||||
[YarnCommand("SetHeat")]
|
||||
public static void SetHeat(int heatValue)
|
||||
{
|
||||
BodyModuleSystem.SetHeat(heatValue);
|
||||
}
|
||||
[YarnCommand("Temp_RemoveUF")]
|
||||
public static void Temp_RemoveUF()
|
||||
{
|
||||
var _UFModule = BodyModuleSystem.FindBodyModuleByName("UF").gameObject;
|
||||
if(_UFModule.activeInHierarchy)
|
||||
{
|
||||
_UFModule.SetActive(false);
|
||||
}
|
||||
}
|
||||
[YarnCommand("Temp_RemoveUFCover")]
|
||||
public static void Temp_RemoveUFCover()
|
||||
{
|
||||
var _UFCover = BodyModuleSystem.FindBodyModuleByName("UF").transform.Find("Cover").gameObject;
|
||||
if(_UFCover.activeInHierarchy)
|
||||
{
|
||||
_UFCover.SetActive(false);
|
||||
}
|
||||
}
|
||||
[YarnCommand("Temp_InstallUF")]
|
||||
public static void Temp_InstallUF()
|
||||
{
|
||||
var _UFModule = BodyModuleSystem.FindBodyModuleByName("UF").gameObject;
|
||||
if(!_UFModule.activeInHierarchy)
|
||||
{
|
||||
_UFModule.SetActive(true);
|
||||
}
|
||||
}
|
||||
[YarnCommand("Temp_InstallUFCover")]
|
||||
public static void Temp_InstallUFCover()
|
||||
{
|
||||
var _UFCover = BodyModuleSystem.FindBodyModuleByName("UF").transform.Find("Cover").gameObject;
|
||||
if(!_UFCover.activeInHierarchy)
|
||||
{
|
||||
_UFCover.SetActive(true);
|
||||
}
|
||||
}
|
||||
[YarnCommand("Temp_InstallChip")]
|
||||
public static void Temp_InstallChip()
|
||||
{
|
||||
var _UFCover = BodyModuleSystem.FindBodyModuleByName("Color").transform.Find("Module Pic").gameObject;
|
||||
if(!_UFCover.activeInHierarchy)
|
||||
{
|
||||
_UFCover.SetActive(true);
|
||||
}
|
||||
}
|
||||
[YarnCommand("Temp_RemoveChip")]
|
||||
public static void Temp_RemoveChip()
|
||||
{
|
||||
var _UFCover = BodyModuleSystem.FindBodyModuleByName("Color").transform.Find("Module Pic").gameObject;
|
||||
if(_UFCover.activeInHierarchy)
|
||||
{
|
||||
_UFCover.SetActive(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4a19fd5f7adfab842bc41061a41d9dc0
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -126,8 +126,7 @@ namespace AibisDream.FixSystem
|
||||
else
|
||||
{
|
||||
StartScan();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user