1104
This commit is contained in:
49
Assets/Scripts/Simulator/Components/ASRS/ASRSComponent.cs
Normal file
49
Assets/Scripts/Simulator/Components/ASRS/ASRSComponent.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using Gpm.Ui.Sample;
|
||||
using Simulator.Data;
|
||||
using System.Collections.Generic;
|
||||
using System.Security.Cryptography;
|
||||
using UnityEditor.Rendering;
|
||||
using UnityEngine;
|
||||
using UVC.Data.Core;
|
||||
|
||||
public class ASRSComponent : ComponentBase
|
||||
{
|
||||
ASRSDataClass asrsData = new ASRSDataClass();
|
||||
public RackComponent rack;
|
||||
public StackerCrane stacker;
|
||||
|
||||
public void SetComponent(ASRSDataClass asrsData)
|
||||
{
|
||||
this.asrsData = asrsData;
|
||||
data = asrsData;
|
||||
SetRack(asrsData.asrs_layout);
|
||||
SetStackerCrane(asrsData.asrs_layout);
|
||||
}
|
||||
|
||||
public override void GetModelData(DataObject modelData)
|
||||
{
|
||||
var name = modelData.GetString("event_name");
|
||||
if (string.Equals(name,"moving"))
|
||||
{
|
||||
stacker.SetTargetPosition(modelData,rack);
|
||||
}
|
||||
if (string.Equals(name, "fork_operation"))
|
||||
{
|
||||
stacker.SetForkPosition(modelData,rack);
|
||||
}
|
||||
if (string.Equals(name, "arrived"))
|
||||
{
|
||||
rack.GetModelData(modelData);
|
||||
}
|
||||
}
|
||||
|
||||
public void SetRack(rack_layout layout)
|
||||
{
|
||||
rack.SpawnCell(layout,true);
|
||||
}
|
||||
|
||||
void SetStackerCrane(rack_layout layout)
|
||||
{
|
||||
stacker.SetPosition(layout);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user