/// <summary>
 /// データを追加
 /// </summary>
 /// <param name="state">NXT State</param>
 public void AppendData(NxtState state)
 {
     // 全ての系列に対してデータを追加
     foreach (string name in NxtState.NxtStateDataMember)
     {
         Point p = state.GetTimeSeriesData(name);
         // データポイントを生成
         DataPoint point = new DataPoint(p.X, p.Y);
         // 系列名からデータを追加する系列を取得
         Series s = stateSeriesList.Find(o => o.Name == name);
         // データを追加
         s.Points.Add(point);
     }
 }
Beispiel #2
0
        /// <summary>
        /// Constructor
        /// </summary>
        public NxtStateManager(Point startPos, double startDirection)
        {
            this.startPos       = startPos;
            this.startDirection = startDirection;

            // NXT Stateを初期化
            state = new NxtState(startPos, startDirection);

            // ログリストを生成
            stateLogList = new List <NxtState>();
            // 初期値をリストに追加
            stateLogList.Add((NxtState)state.Clone());

            stateTextBuilder = new StringBuilder();
            stateTextBuilder.AppendFormat("  RunTime, MoveDist, MoveSpd, Direction, TurnAngle, Posture, TailAngle, Position.X, Position.Y\r\n");
        }
Beispiel #3
0
        /// <summary>
        /// Cloneを返す
        /// </summary>
        /// <returns>Clone</returns>
        public object Clone()
        {
            NxtState clone = new NxtState(this.StartPosition, this.startDirection);

            clone.RunTime          = this.RunTime;
            clone.MomentRunTime    = this.MomentRunTime;
            clone.Distance         = this.Distance;
            clone.MomentDistance   = this.MomentDistance;
            clone.AverageSpd       = this.AverageSpd;
            clone.MomentAverageSpd = this.MomentAverageSpd;

            clone.Posture             = this.Posture;
            clone.TailAngle           = this.TailAngle;
            clone.TailTurnAngle       = this.TailTurnAngle;
            clone.MomentTailTurnAngle = this.MomentTailTurnAngle;
            clone.Direction           = this.Direction;
            clone.TurnAngle           = this.TurnAngle;
            clone.MotorSpd            = this.MotorSpd;
            clone.Position            = this.Position;

            return(clone);
        }
Beispiel #4
0
 /// <summary>
 /// ログリストのデータをクリア
 /// </summary>
 public void ClearList()
 {
     stateLogList.Clear();
     this.state = new NxtState(this.startPos, this.startDirection);
 }