protected virtual string GeneratePath(TShot shot, MemoryFrame frame, int frameIndex, Smithers.Serialization.Writers.IWriter writer)
        {
            string folderName = writer.Type.Name;

            int    shotCount = _session.Shots.IndexOf(shot as Shot <ShotDefinition, DS4SavedItem>) + 1;
            string shotName  = string.Format("Shot_{0:D3}", shotCount);

            // 0 -> Frame_001, 1 -> Frame_002, etc.
            string frameName = string.Format("Frame_{0:D3}", frameIndex + 1);

            string fileName = string.Format(
                "{0}{1}{2}{3}",
                shotName,
                shotName == null ? "" : "_",
                frameName,
                writer.FileExtension
                );

            if (_mode == CaptureMode.Sweeping)
            {
                string sweepName     = string.Format("sweep_{0:D2}", _session.SweepCounter);
                string sweepFileName = string.Format("{0:D3}{1}", frameIndex + 1, writer.FileExtension);
                //In sweep mode, put sweepName out to be folder so someone can conveniently fit one sweep
                return(Path.Combine(sweepName, folderName, sweepFileName));
            }

            return(Path.Combine(folderName, fileName));
        }
Beispiel #2
0
        public SessionManager(TSession session)
        {
            _session = session;

            _frames = new MemoryFrame[session.MaximumFrameCount];
            for (int i = 0; i < _frames.Length; i += 1)
            {
                _frames[i] = new MemoryFrame();
            }
        }
Beispiel #3
0
        public MemoryMonitor() : base(GearsetSettings.Instance.MemoryMonitorConfig)
        {
            for (var i = 0; i < Frames.Length; i++)
            {
                Frames[i] = new MemoryFrame();
            }

            LineDrawer = new InternalLineDrawer();
            Children.Add(LineDrawer);

            Children.Add(_internalLabeler);
            Children.Add(TempBoxDrawer);

            CreateMemoryGraph();
        }
Beispiel #4
0
        protected virtual IEnumerable <IWriter> WritersForFrame(MemoryFrame frame, int frameIndex)
        {
            var writers = new List <IWriter>();

            if (frameIndex == 0)
            {
                // For each pose, only save the first color and depth mapping frames
                writers.Add(new ColorFrameWriter(frame, _serializer));
                writers.Add(new DepthMappingWriter(frame, _serializer));
            }

            writers.Add(new DepthFrameWriter(frame, _serializer));
            writers.Add(new InfraredFrameWriter(frame, _serializer));
            writers.Add(new SkeletonWriter(frame, _serializer));

            return(writers);
        }
Beispiel #5
0
        protected virtual string GeneratePath(TShot shot, MemoryFrame frame, int frameIndex, IWriter writer)
        {
            string folderName = writer.Type.Name;

            string shotName = string.Format("Shot_{0:D3}", _session.Shots.IndexOf(shot) + 1);

            // 0 -> Frame_001, 1 -> Frame_002, etc.
            string frameName = string.Format("Frame_{0:D3}", frameIndex + 1);

            string fileName = string.Format(
                "{0}{1}{2}{3}",
                shotName,
                shotName == null ? "" : "_",
                frameName,
                writer.FileExtension
                );

            return(Path.Combine(folderName, fileName));
        }
        protected virtual IEnumerable <Smithers.Serialization.Writers.IWriter> WritersForFrame(MemoryFrame frame, int frameIndex)
        {
            var writers = new List <Smithers.Serialization.Writers.IWriter>();

            //if (frameIndex == 0)
            //{
            //    // For each pose, only save the first color and depth mapping frames
            //    writers.Add(new ColorFrameWriter(frame, _serializer));
            //}

            writers.Add(new ColorFrameWriter(frame, _serializer));
            writers.Add(new DepthFrameWriter(frame, _serializer));
#if DEBUG
            //writers.Add(new PXCMPoint3DF32ListWriter(frame, _serializer));
            //writers.Add(new PXCMPoint3DF32ObjWriter(frame, _serializer));
            //if (_reader.DSAPI == null)
            //{
            //    writers.Add(new IRLeftFrameWriter(frame, _serializer));
            //    writers.Add(new IRRightFrameWriter(frame, _serializer));
            //}
#endif
            return(writers);
        }