Example #1
0
        public static void Main(string[] args)
        {
            string  filename = "gestures/track_high_kick_00.log";
            Command cmd      = LogFileVisualizer.Command.ViewGesture;

            if (args.Length > 0)
            {
                filename = args[0];
                if (args.Length > 1)
                {
                    cmd = (LogFileVisualizer.Command)Enum.Parse(typeof(LogFileVisualizer.Command), args[1]);
                }
            }

            string whichJoint;

            switch (cmd)
            {
            case Command.ViewGesture:
                using (var vw = new GestureJointVisualizer(filename)) {
                    vw.Run(30.0);
                }
                break;

            case Command.PlotJoint:
                whichJoint = GetJointName();
                var gest1 = new InputGesture(new LogFileLoader(filename));
                var jp    = new JointPlotter(gest1, whichJoint, true);
                Application.Run(jp.DisplayPlots());
                break;

            case Command.PlotJointsFromGestures:
                whichJoint = GetJointName();
                var  plotlist = new List <JointPlotter>();
                var  fnames   = LogFileLoader.LogFilenames(filename);
                Form last     = null;
                foreach (var name in fnames)
                {
                    var gest2 = new InputGesture(new LogFileLoader(name));
                    var jp2   = new JointPlotter(gest2, whichJoint, false);
                    plotlist.Add(jp2);
                    last = jp2.DisplayPlots();
                }
                Application.Run(last);
                break;
            }
        }
Example #2
0
		public static void Main (string[] args)
		{
			string filename = "gestures/track_high_kick_00.log";
			Command cmd = LogFileVisualizer.Command.ViewGesture;
			if ( args.Length > 0 ) {
				filename = args[0];
				if ( args.Length > 1 ) {
					cmd = (LogFileVisualizer.Command)Enum.Parse(typeof(LogFileVisualizer.Command), args[1]);
				}
			}
			
			string whichJoint;
			switch ( cmd ) {
			case Command.ViewGesture:
				using ( var vw = new GestureJointVisualizer(filename) ) {
					vw.Run(30.0);
				}
				break;
			case Command.PlotJoint:
				whichJoint = GetJointName();
				var gest1 = new InputGesture(new LogFileLoader(filename));
				var jp = new JointPlotter(gest1, whichJoint, true);
				Application.Run(jp.DisplayPlots());
				break;
			case Command.PlotJointsFromGestures:
				whichJoint = GetJointName();
				var plotlist = new List<JointPlotter>();
				var fnames = LogFileLoader.LogFilenames(filename);
				Form last = null;
				foreach ( var name in fnames ) {
					var gest2 = new InputGesture(new LogFileLoader(name));
					var jp2 = new JointPlotter(gest2, whichJoint, false);
					plotlist.Add(jp2);
					last = jp2.DisplayPlots();
				}
				Application.Run(last);
				break;
			}
		}