Merge branch 'main' of http://172.16.1.12/WangWeiZhi/YanCheng_Metrology
This commit is contained in:
commit
07c2e0321e
Binary file not shown.
|
@ -12,7 +12,7 @@ public class Device_Base : PermanentTriggerBase
|
|||
/// <summary>
|
||||
/// trigger触发事件
|
||||
/// </summary>
|
||||
private Action<string,bool> triggerAction;
|
||||
public Func<string,bool,int> triggerAction;
|
||||
|
||||
protected override void OnStart()
|
||||
{
|
||||
|
@ -39,7 +39,7 @@ public class Device_Base : PermanentTriggerBase
|
|||
}
|
||||
}
|
||||
|
||||
public void AddTriggerAction(Action<string,bool> action)
|
||||
public void AddTriggerAction(Func<string, bool, int> action)
|
||||
{
|
||||
this.triggerAction = action;
|
||||
}
|
||||
|
|
|
@ -35,16 +35,6 @@ public class Device_3Phase4WireMeter : Device_Base
|
|||
|
||||
private BoxCollider boxCollider;
|
||||
|
||||
//protected override void OnAwake()
|
||||
//{
|
||||
// base.OnAwake();
|
||||
// boxCollider = GetComponent<BoxCollider>();
|
||||
// if(UnityEngine.SceneManagement.SceneManager.GetActiveScene().name== "05_LiveScene")
|
||||
// {
|
||||
// boxCollider.enabled = false;
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 初始化电能表状态(默认是装好的状态不用设置)
|
||||
|
@ -55,69 +45,104 @@ public class Device_3Phase4WireMeter : Device_Base
|
|||
if(isIntsalledState)
|
||||
{
|
||||
Debug.Log("电能表设置为初始状态");
|
||||
//盖子盖上
|
||||
cover.isOpen = false;
|
||||
cover.transform.localPosition = new Vector3(0.0001220703f, 0.01112366f, -0.09854126f);
|
||||
//左螺丝拧上
|
||||
cover.cover_screw_Left.isInstall = true;
|
||||
cover.cover_screw_Left.transform.localPosition = new Vector3(cover.cover_screw_Left.transform.localPosition.x, cover.cover_screw_Left.initPostionY, cover.cover_screw_Left.transform.localPosition.z);
|
||||
//右螺丝拧上
|
||||
cover.cover_screw_Right.isInstall = true;
|
||||
cover.cover_screw_Right.transform.localPosition = new Vector3(cover.cover_screw_Right.transform.localPosition.x, cover.cover_screw_Right.initPostionY, cover.cover_screw_Right.transform.localPosition.z);
|
||||
//左封印安装
|
||||
cover.cover_seal_Left.isCut = false;
|
||||
cover.cover_seal_Left.gameObject.SetActive(true);
|
||||
//右封印安装
|
||||
cover.cover_seal_Right.isCut = false;
|
||||
cover.cover_seal_Right.gameObject.SetActive(true);
|
||||
//左固定螺丝拧上
|
||||
fix_screw_left.isInstall = true;
|
||||
fix_screw_left.transform.localPosition = new Vector3(fix_screw_left.transform.localPosition.x, fix_screw_left.initPostionY , fix_screw_left.transform.localPosition.z);
|
||||
//右固定螺丝拧上
|
||||
fix_screw_right.isInstall = true;
|
||||
fix_screw_right.transform.localPosition = new Vector3(fix_screw_right.transform.localPosition.x, fix_screw_right.initPostionY , fix_screw_right.transform.localPosition.z);
|
||||
//接线螺丝全部拧上
|
||||
jieXian_screws.ForEach(a =>
|
||||
{
|
||||
a.isInstall = true;
|
||||
a.transform.localPosition = new Vector3(a.transform.localPosition.x, a.initPostionY, a.transform.localPosition.z);
|
||||
});
|
||||
//盖子装上的状态
|
||||
CoverInstallState();
|
||||
//接线螺丝全部拧上状态
|
||||
JieXianScrewInstallState();
|
||||
//铭牌
|
||||
namePlate.isChecked = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log("电能表设置为拆下状态");
|
||||
//盖子拆除
|
||||
cover.isOpen = true;
|
||||
cover.transform.localPosition = new Vector3(0.0001220703f, -0.1388763f, -0.2485413f);
|
||||
//左螺丝拧下
|
||||
cover.cover_screw_Left.isInstall = false;
|
||||
cover.cover_screw_Left.transform.localPosition = new Vector3(cover.cover_screw_Left.transform.localPosition.x, cover.cover_screw_Left.initPostionY-0.03f, cover.cover_screw_Left.transform.localPosition.z);
|
||||
//右螺丝拧下
|
||||
cover.cover_screw_Right.isInstall = false;
|
||||
cover.cover_screw_Right.transform.localPosition = new Vector3(cover.cover_screw_Right.transform.localPosition.x, cover.cover_screw_Right.initPostionY-0.03f, cover.cover_screw_Right.transform.localPosition.z);
|
||||
//左封印被剪开
|
||||
cover.cover_seal_Left.isCut = true;
|
||||
cover.cover_seal_Left.gameObject.SetActive(false);
|
||||
//右封印被剪开
|
||||
cover.cover_seal_Right.isCut = true;
|
||||
cover.cover_seal_Right.gameObject.SetActive(false);
|
||||
//左固定螺丝拧下
|
||||
fix_screw_left.isInstall = false;
|
||||
fix_screw_left.transform.localPosition = new Vector3(fix_screw_left.transform.localPosition.x, fix_screw_left.initPostionY-0.03f, fix_screw_left.transform.localPosition.z);
|
||||
//右固定螺丝拧下
|
||||
fix_screw_right.isInstall = false;
|
||||
fix_screw_right.transform.localPosition = new Vector3(fix_screw_right.transform.localPosition.x, fix_screw_right.initPostionY-0.03f, fix_screw_right.transform.localPosition.z);
|
||||
//接线螺丝全部拧下
|
||||
jieXian_screws.ForEach(a =>
|
||||
{
|
||||
a.isInstall = false;
|
||||
a.transform.localPosition = new Vector3(a.transform.localPosition.x, a.initPostionY-0.03f, a.transform.localPosition.z);
|
||||
});
|
||||
//盖子拆下状态
|
||||
CoverUnstallState();
|
||||
//接线螺丝拧下状态
|
||||
JieXianScrewUninstallState();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 盖子取下的状态
|
||||
/// </summary>
|
||||
public void CoverUnstallState()
|
||||
{
|
||||
//盖子拆除
|
||||
cover.isOpen = true;
|
||||
cover.transform.localPosition = new Vector3(0.0001220703f, -0.1388763f, -0.2485413f);
|
||||
//左螺丝拧下
|
||||
cover.cover_screw_Left.isInstall = false;
|
||||
cover.cover_screw_Left.transform.localPosition = new Vector3(cover.cover_screw_Left.transform.localPosition.x, cover.cover_screw_Left.initPostionY - 0.03f, cover.cover_screw_Left.transform.localPosition.z);
|
||||
//右螺丝拧下
|
||||
cover.cover_screw_Right.isInstall = false;
|
||||
cover.cover_screw_Right.transform.localPosition = new Vector3(cover.cover_screw_Right.transform.localPosition.x, cover.cover_screw_Right.initPostionY - 0.03f, cover.cover_screw_Right.transform.localPosition.z);
|
||||
//左封印被剪开
|
||||
cover.cover_seal_Left.isCut = true;
|
||||
cover.cover_seal_Left.gameObject.SetActive(false);
|
||||
//右封印被剪开
|
||||
cover.cover_seal_Right.isCut = true;
|
||||
cover.cover_seal_Right.gameObject.SetActive(false);
|
||||
//左固定螺丝拧下
|
||||
fix_screw_left.isInstall = false;
|
||||
fix_screw_left.transform.localPosition = new Vector3(fix_screw_left.transform.localPosition.x, fix_screw_left.initPostionY - 0.03f, fix_screw_left.transform.localPosition.z);
|
||||
//右固定螺丝拧下
|
||||
fix_screw_right.isInstall = false;
|
||||
fix_screw_right.transform.localPosition = new Vector3(fix_screw_right.transform.localPosition.x, fix_screw_right.initPostionY - 0.03f, fix_screw_right.transform.localPosition.z);
|
||||
//接线螺丝全部拧下
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 盖子装上的状态
|
||||
/// </summary>
|
||||
public void CoverInstallState()
|
||||
{
|
||||
//盖子盖上
|
||||
cover.isOpen = false;
|
||||
cover.transform.localPosition = new Vector3(0.0001220703f, 0.01112366f, -0.09854126f);
|
||||
//左螺丝拧上
|
||||
cover.cover_screw_Left.isInstall = true;
|
||||
cover.cover_screw_Left.transform.localPosition = new Vector3(cover.cover_screw_Left.transform.localPosition.x, cover.cover_screw_Left.initPostionY, cover.cover_screw_Left.transform.localPosition.z);
|
||||
//右螺丝拧上
|
||||
cover.cover_screw_Right.isInstall = true;
|
||||
cover.cover_screw_Right.transform.localPosition = new Vector3(cover.cover_screw_Right.transform.localPosition.x, cover.cover_screw_Right.initPostionY, cover.cover_screw_Right.transform.localPosition.z);
|
||||
//左封印安装
|
||||
cover.cover_seal_Left.isCut = false;
|
||||
cover.cover_seal_Left.gameObject.SetActive(true);
|
||||
//右封印安装
|
||||
cover.cover_seal_Right.isCut = false;
|
||||
cover.cover_seal_Right.gameObject.SetActive(true);
|
||||
//左固定螺丝拧上
|
||||
fix_screw_left.isInstall = true;
|
||||
fix_screw_left.transform.localPosition = new Vector3(fix_screw_left.transform.localPosition.x, fix_screw_left.initPostionY, fix_screw_left.transform.localPosition.z);
|
||||
//右固定螺丝拧上
|
||||
fix_screw_right.isInstall = true;
|
||||
fix_screw_right.transform.localPosition = new Vector3(fix_screw_right.transform.localPosition.x, fix_screw_right.initPostionY, fix_screw_right.transform.localPosition.z);
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 接线螺丝拧上状态
|
||||
/// </summary>
|
||||
public void JieXianScrewInstallState()
|
||||
{
|
||||
//接线螺丝全部拧上
|
||||
jieXian_screws.ForEach(a =>
|
||||
{
|
||||
a.isInstall = true;
|
||||
a.transform.localPosition = new Vector3(a.transform.localPosition.x, a.initPostionY, a.transform.localPosition.z);
|
||||
});
|
||||
}
|
||||
/// <summary>
|
||||
/// 接线螺丝拧下状态
|
||||
/// </summary>
|
||||
public void JieXianScrewUninstallState()
|
||||
{
|
||||
jieXian_screws.ForEach(a =>
|
||||
{
|
||||
a.isInstall = false;
|
||||
a.transform.localPosition = new Vector3(a.transform.localPosition.x, a.initPostionY - 0.03f, a.transform.localPosition.z);
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 拆下电能表
|
||||
/// </summary>
|
||||
|
|
|
@ -40,4 +40,24 @@ public class Device_Switch : Device_Base
|
|||
actionBack.Invoke(isOpen);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 开关打开状态
|
||||
/// </summary>
|
||||
public void OpenState()
|
||||
{
|
||||
isOpen = true;
|
||||
transform.localEulerAngles = new Vector3(0, 0, 0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 开关关闭状态
|
||||
/// </summary>
|
||||
public void CloseState()
|
||||
{
|
||||
isOpen = false;
|
||||
transform.localEulerAngles = new Vector3(45, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -50,6 +50,7 @@ public class Device_CabinetDoor : Device_Base
|
|||
{
|
||||
if (LiveSceneManager.Instance.currentTool != null && LiveSceneManager.Instance.currentTool.name == "Ñéµç±Ê")
|
||||
return;
|
||||
|
||||
if (GameManager.ProcessMgr.IsRightSubProcessStepsTriggerID(triggerName, true) == 0)
|
||||
{
|
||||
base.OnMDown();
|
||||
|
|
|
@ -114,7 +114,7 @@ public class Device_MeasuringCabinet : Device_Base
|
|||
/// <summary>
|
||||
/// 刷新电能表螺丝带电状态
|
||||
/// </summary>
|
||||
private void CheckHasElectricity()
|
||||
public void CheckHasElectricity()
|
||||
{
|
||||
Debug.Log("带电状态刷新");
|
||||
//进线螺丝是否带电
|
||||
|
|
|
@ -122,22 +122,57 @@ public class StepState_1002 : StepState
|
|||
else if(num == 3010)
|
||||
{
|
||||
//断开电源并验电
|
||||
|
||||
//门开着
|
||||
SiteManager.instance.measuringCabinet.cabinetDoor.isOpen = true;
|
||||
SiteManager.instance.measuringCabinet.cabinetDoor.transform.localEulerAngles = new Vector3(0,0,180);
|
||||
SiteManager.instance.measuringCabinet.cabinetDoor.transform.Find("计量柜锁2/计量柜锁3").localEulerAngles =new Vector3(-45f,0,0);
|
||||
//盖子拆下来
|
||||
SiteManager.instance.measuringCabinet.meteringDevice.CoverUnstallState();
|
||||
|
||||
}
|
||||
else if (num == 3011)
|
||||
{
|
||||
//核对和抄录计量设备信息
|
||||
|
||||
//电源断开了
|
||||
SiteManager.instance.measuringCabinet.inSwitch.CloseState();
|
||||
}
|
||||
else if(num== 3012)
|
||||
{
|
||||
//拆除电能计量装置
|
||||
//铭牌已读取
|
||||
SiteManager.instance.measuringCabinet.meteringDevice.namePlate.isChecked = true;
|
||||
}
|
||||
else if( num == 3013)
|
||||
{
|
||||
//安装电能表
|
||||
|
||||
//接线螺丝拧下了
|
||||
SiteManager.instance.measuringCabinet.meteringDevice.JieXianScrewUninstallState();
|
||||
//电能表接线取下了
|
||||
SiteManager.instance.measuringCabinet.jieXian_screws.ForEach(screw =>
|
||||
{
|
||||
screw.isConnected = false;
|
||||
screw.transform.localPosition = new Vector3(screw.transform.localPosition.x, screw.InstallPosY-2, screw.transform.localPosition.z);
|
||||
});
|
||||
//刷新带电状态
|
||||
SiteManager.instance.measuringCabinet.CheckHasElectricity();
|
||||
}
|
||||
else if (num == 3014)
|
||||
{
|
||||
//安装检查
|
||||
|
||||
//电能表接线连上了
|
||||
SiteManager.instance.measuringCabinet.jieXian_screws.ForEach(screw =>
|
||||
{
|
||||
screw.isConnected = true;
|
||||
screw.transform.localPosition = new Vector3(screw.transform.localPosition.x, screw.InstallPosY, screw.transform.localPosition.z);
|
||||
});
|
||||
//接线螺丝拧上了
|
||||
SiteManager.instance.measuringCabinet.meteringDevice.JieXianScrewInstallState();
|
||||
//刷新带电状态
|
||||
SiteManager.instance.measuringCabinet.CheckHasElectricity();
|
||||
}
|
||||
else if(num== 3015)
|
||||
{
|
||||
|
@ -146,10 +181,17 @@ public class StepState_1002 : StepState
|
|||
else if(num== 3016)
|
||||
{
|
||||
//实施封印
|
||||
|
||||
//开关打开了
|
||||
SiteManager.instance.measuringCabinet.inSwitch.OpenState();
|
||||
//盖子盖上
|
||||
SiteManager.instance.measuringCabinet.meteringDevice.CoverInstallState();
|
||||
}
|
||||
else if(num== 3017)
|
||||
{
|
||||
//填写告知单
|
||||
SiteManager.instance.measuringCabinet.meteringDevice.cover.cover_seal_Left.Install();
|
||||
SiteManager.instance.measuringCabinet.meteringDevice.cover.cover_seal_Right.Install();
|
||||
}
|
||||
else if(num== 3018)
|
||||
{
|
||||
|
|
|
@ -16,7 +16,7 @@ public class Tool_Base : PermanentTriggerBase
|
|||
/// <summary>
|
||||
/// trigger触发事件
|
||||
/// </summary>
|
||||
private Action<string,bool> triggerAction;
|
||||
public Func<string, bool, int> triggerAction;
|
||||
|
||||
protected override void OnStart()
|
||||
{
|
||||
|
@ -43,7 +43,7 @@ public class Tool_Base : PermanentTriggerBase
|
|||
}
|
||||
}
|
||||
|
||||
public void AddTriggerAction(Action<string,bool> action)
|
||||
public void AddTriggerAction(Func<string, bool, int> action)
|
||||
{
|
||||
this.triggerAction = action;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue