private void CreateCommandClick(object obj)
        {
            try
            {
                if (!IPAddress.TryParse(ipV4string, out IPAddress ipV4parsed))
                {
                    MessageBox.Show("IP address mst be in v4 format eg: 192.168.0.1", "IP address invalid", MessageBoxButton.OK, MessageBoxImage.Error);
                    return;
                }

                if (!PoseDtoFactory.TryParseString(poseString, out _))
                {
                    MessageBox.Show("Pose must be in the format: xx,yy,hh", "Pose string invalid", MessageBoxButton.OK, MessageBoxImage.Error);
                    return;
                }

                AGVTemplate template = new AGVTemplate()
                {
                    IPV4String     = ipV4parsed.ToString(),
                    PoseDataString = poseString
                };

                Model.FleetTemplate.Add(template);
            }
            catch (Exception ex)
            {
                Logger.Error(ex);
            }
        }
Esempio n. 2
0
        protected override IServiceCallResult HandleExecution(IFleetManagerClient client)
        {
            IPAddress ipAddress = IPAddress.Parse(IPv4String);

            PoseDtoFactory.TryParseString(PoseString, out PoseDto poseData);

            return(client.SetPose(ipAddress, poseData ?? PoseDtoFactory.NaNPose));
        }