Ejemplo n.º 1
0
 public TrajectoryMulitDOFJointTrajectoryPoint()
 {
     transforms      = new GeometryTransform[0];
     velocities      = new GeometryTwist[0];
     accelerations   = new GeometryTwist[0];
     time_from_start = new StandardTime();
 }
Ejemplo n.º 2
0
 public NavigationMapMetaData()
 {
     map_load_time = null;
     resolution    = 0;
     width         = 0;
     height        = 0;
     origin        = new GeometryPose();
 }
Ejemplo n.º 3
0
 public TrajectoryJointTrajectoryPoint()
 {
     positions       = new float[0];
     velocities      = new float[0];
     accelerations   = new float[0];
     effort          = new float[0];
     time_from_start = new StandardTime();
 }
        public async Task <IActionResult> PutByNumber(int key, [FromBody] StandardTime uStandardTime)
        {
            if (uStandardTime != null)
            {
                uStandardTime.ModifyDate = DateTime.Now;
                uStandardTime.Modifyer   = uStandardTime.Modifyer ?? "Someone";

                return(new JsonResult(await this.repository.UpdateAsync(uStandardTime, key), this.DefaultJsonSettings));
            }
            return(NotFound(new { Error = "Standard Tiem not found." }));
        }
        public async Task <IActionResult> Post([FromBody] StandardTime nStandardTime)
        {
            if (nStandardTime != null)
            {
                nStandardTime.CreateDate = DateTime.Now;
                nStandardTime.Creator    = nStandardTime.Creator ?? "Someone";

                return(new JsonResult(await this.repository.AddAsync(nStandardTime), this.DefaultJsonSettings));
            }
            return(NotFound(new { Error = "Standard Time not found." }));
        }
Ejemplo n.º 6
0
        public static StandardTime GetVerifiedTime(StandardTime time)
        {
            int counter = (int)StandardTimeValues.counter;

            for (int value = counter - 1; value > 0; --value)
            {
                time = CheckForOvertime(time, value);
            }

            return(time);
        }
Ejemplo n.º 7
0
        public static StandardTime ToStandardTime(float seconds)
        {
            int secondsInMinute = GetMaxValue(StandardTimeValues.Minutes);
            int millisInSecond  = StandardTimeVerifyer.GetMaximumTime(StandardTimeValues.Milliseconds);

            StandardTime time = StandardTime.zero;

            time.Minutes      = (int)(seconds / secondsInMinute);
            time.Seconds      = (int)(seconds - (secondsInMinute * time.Minutes));
            time.Milliseconds = (int)((seconds - ((int)seconds)) * millisInSecond);
            return(time);
        }
Ejemplo n.º 8
0
        public static float ToFloat(StandardTime time)
        {
            int secondsInMinute = GetMaxValue(StandardTimeValues.Minutes);
            int millisInSecond  = StandardTimeVerifyer.GetMaximumTime(StandardTimeValues.Milliseconds);

            float resulting_seconds = 0f;

            resulting_seconds += time.Milliseconds / millisInSecond;
            resulting_seconds += time.Seconds;
            resulting_seconds += time.Minutes * secondsInMinute;
            return(resulting_seconds);
        }
Ejemplo n.º 9
0
        private static StandardTime CheckForOvertime(StandardTime time, int timeValueIndex)
        {
            int max_value = StandardTimeVerifyer.GetMaximumTime((StandardTimeValues)timeValueIndex);
            OvertimeContainer overtimeContainer = VerifyTimeVariable(time.TimeValues[timeValueIndex], max_value);

            time.TimeValues[timeValueIndex] = overtimeContainer.ProperTime;
            if (timeValueIndex >= 1)
            {
                time.TimeValues[timeValueIndex - 1] += overtimeContainer.Overtime;
            }
            return(time);
        }
        public void Restart()
        {
            OnRestart?.Invoke();
            Player.Instance.SetPosition(playerInitPosition);
            toolsCollected = 0;
            gameTime       = TimeToFinish.ToFloat();
            stGameTime     = new StandardTime();
            stGameTime.ConvertFrom(gameTime);

            ResumeGame();
            UpdateGameUI();
        }
        public static bool TryParse(Queue <Token> unProcessedTokens, out AbstractTime time)
        {
            string timeExpressionRegex = String.Format(@"^(({0})|({1})|({1}:{2})|({1}:{2}:{3})){4}?$", zeroRegex,
                                                       hoursRegex, minutesRegex, secondsRegex, timeTypeRegex);

            if (Regex.IsMatch(unProcessedTokens.Peek().Value, timeExpressionRegex))
            {
                string timeString = unProcessedTokens.Dequeue().Value;
                try
                {
                    if (timeString.EndsWith("w"))
                    {
                        timeString = timeString.TrimEnd('w');
                        time       = new LocalTime(ParseTimeString(timeString));
                        return(true);
                    }
                    if (timeString.EndsWith("s"))
                    {
                        timeString = timeString.TrimEnd('s');
                        time       = new StandardTime(ParseTimeString(timeString));
                        return(true);
                    }
                    if (timeString.EndsWith("u") || timeString.EndsWith("g") ||
                        timeString.EndsWith("z"))
                    {
                        timeString = timeString.TrimEnd('u', 'g', 'z');
                        time       = new UtcTime(ParseTimeString(timeString));
                        return(true);
                    }

                    // default is local time
                    time = new LocalTime(ParseTimeString(timeString));
                    return(true);
                }

                catch (Exception e)
                {
                    string msg = String.Format("Unable to parse {0}: {1}", typeof(TzDbTimeExpression).Name, timeString);
                    throw new Exception(msg, e);
                }
            }
            time = null;
            return(false);
        }
Ejemplo n.º 12
0
 public StandardHeader()
 {
     seq      = 0;
     stamp    = new StandardTime();
     frame_id = "";
 }
 public TzDbStandardDateTime(Date date, StandardTime time)
     : base(date, time)
 {
 }
Ejemplo n.º 14
0
 public void UpdateTme(StandardTime time)
 {
     CurrentTime.text = time.ToString();
 }
Ejemplo n.º 15
0
 public void SetUp()
 {
     standardTime = new StandardTime();
 }
Ejemplo n.º 16
0
 public void SetTime(StandardTime time) => SetUI(timeText, time.ToString());
Ejemplo n.º 17
0
 public void TearDown()
 {
     standardTime = null;
 }
Ejemplo n.º 18
0
 public void UpdateResults(StandardTime time, int correct_answers)
 {
     CorrectAnswers.text = correct_answers.ToString();
     TotalTime.text      = time.ToString();
 }