Initial commit
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
using RobotNet.VDA5050.Type;
|
||||
using RobotNet10.RobotApp.Interfaces;
|
||||
|
||||
namespace RobotNet10.RobotApp.Services.Robot.Actions;
|
||||
|
||||
[RobotAction(ActionType.STATE_REQUEST,
|
||||
[ActionScope.INSTANT, ActionScope.NODE, ActionScope.EDGE],
|
||||
[BlockingType.NONE, BlockingType.SOFT, BlockingType.HARD],
|
||||
"Yêu cầu gửi trạng thái robot ngay lập tức.",
|
||||
"Robot đã gửi trạng thái ngay lập tức.")]
|
||||
public class RobotStateRequestAction(IServiceProvider ServiceProvider) : RobotAction(ServiceProvider)
|
||||
{
|
||||
protected override async Task StartAction()
|
||||
{
|
||||
var RobotStates = ServiceProvider.GetRequiredService<IState>();
|
||||
await RobotStates.PubState();
|
||||
SetStatus(ActionEvent.FINISHED);
|
||||
ResultDescription = string.IsNullOrEmpty(ActionAttribute.ResultDescription) ? ResultDescription : ActionAttribute.ResultDescription;
|
||||
}
|
||||
|
||||
protected override Task ExecuteAction()
|
||||
{
|
||||
return base.ExecuteAction();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user