<feat> 프로그램 진입 시 로봇 모터 ON/OFF 표시
This commit is contained in:
@@ -4,6 +4,7 @@ public class ProgramPresenter
|
||||
{
|
||||
private ProgramModel model;
|
||||
private ProgramView view;
|
||||
private RobotController controlledRobot;
|
||||
|
||||
public ProgramPresenter(ProgramModel model, ProgramView view)
|
||||
{
|
||||
@@ -17,11 +18,31 @@ public class ProgramPresenter
|
||||
this.view.OnAddPointClicked += HandleAddPoint;
|
||||
}
|
||||
|
||||
public void RegisterControlledRobot(RobotController robot)
|
||||
{
|
||||
this.controlledRobot = robot;
|
||||
}
|
||||
|
||||
public void OnApplicationStart()
|
||||
{
|
||||
if (controlledRobot != null)
|
||||
{
|
||||
Debug.Log("로봇 모터를 ON 상태로 설정합니다.");
|
||||
controlledRobot.SetMotorState(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError("제어할 로봇이 등록되지 않았습니다");
|
||||
}
|
||||
}
|
||||
|
||||
private void HandleCreateProgram(string programId)
|
||||
{
|
||||
if (model.CreateNewProgram(programId))
|
||||
{
|
||||
view.DisplayProgram(model.CurrentProgram);
|
||||
view.HideProgramSelectPanel();
|
||||
OnApplicationStart();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -40,8 +61,11 @@ public class ProgramPresenter
|
||||
if (model.LoadProgram(programId))
|
||||
{
|
||||
view.DisplayProgram(model.CurrentProgram);
|
||||
view.HideProgramSelectPanel();
|
||||
view.HideProgramList();
|
||||
|
||||
OnApplicationStart();
|
||||
}
|
||||
view.HideProgramList();
|
||||
}
|
||||
|
||||
private void HandleSaveProgram()
|
||||
|
||||
Reference in New Issue
Block a user