Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Controlled replay of recorded data

Controlled replay of recorded data

Scheduled Pinned Locked Moved C#
sysadminalgorithmsdiscussion
8 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Chuck844
    wrote on last edited by
    #1

    I have an application that receives messages from a network that describe object events and status (think of a CAN Bus data logging type of application). My plan is to record 'change' events (actual change as opposed to re-transmit) to disk along with 'key frames' (status of all objects) to allow later playback of the data. Data format is not predetermined. I'll work with whatever is the best fit. I am looking for code that would support playback controls such as 'play', 'pause', 'rewind', 'start playing at ', 'fast forward', etc. My searching of the web gets me lots of things having to do with audio and video playback but nothing in the area of arbitrary data playback. I can 'roll my own' but a head start would be helpful. Thanks in advance for your thoughts ...

    L B 2 Replies Last reply
    0
    • C Chuck844

      I have an application that receives messages from a network that describe object events and status (think of a CAN Bus data logging type of application). My plan is to record 'change' events (actual change as opposed to re-transmit) to disk along with 'key frames' (status of all objects) to allow later playback of the data. Data format is not predetermined. I'll work with whatever is the best fit. I am looking for code that would support playback controls such as 'play', 'pause', 'rewind', 'start playing at ', 'fast forward', etc. My searching of the web gets me lots of things having to do with audio and video playback but nothing in the area of arbitrary data playback. I can 'roll my own' but a head start would be helpful. Thanks in advance for your thoughts ...

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      You need to be more specific about what you mean by "arbitrary data playback". A system restore involves a "pause, rewind and play" (but there's nothing to see).

      It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it. ― Confucian Analects: Rules of Confucius about his food

      C 1 Reply Last reply
      0
      • L Lost User

        You need to be more specific about what you mean by "arbitrary data playback". A system restore involves a "pause, rewind and play" (but there's nothing to see).

        It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it. ― Confucian Analects: Rules of Confucius about his food

        C Offline
        C Offline
        Chuck844
        wrote on last edited by
        #3

        To be more specific ... My application is a signal system I have designed for "Ride On Railroads" (7.5" gauge typically here in the USA). The system consists of controller nodes distributed around the railroad. Each of these nodes detects track occupancy, calculates which train should be permitted to proceed and sets signals accordingly. All of this data (track occupancy, signal head settings, etc.) is broadcast on a single CAN Bus in real time. There can be one or more PCs attached to the network for monitoring and control (NOT control of train movements, that's totally done by the controller nodes). One of the things the PCs support is display of train movements to passengers as well as one or more dispatchers. I want to record this CAN Bus data as a stream of 'change' events as well as periodic "key frame" records to a disk file. The key frame record records the current status of every object (track, signal, etc.) on the railroad. Thus, starting at a 'key frame' and proceeding forward in time you have a time record of everything that happened on the railroad. I want to be able to switch the display screen from the 'live data stream' (what is currently happening on the railroad) and display what happened at an earlier time ... i.e.: replay the railroad activity. So, I need to be able to support things like "play back the data stream from 5pm yesterday", etc. This is done all the time with audio and video streams but I have not been able to find any examples of code that will do it for an arbitrary stream of data. I also need to decide the file format that would be efficient for recording the data stream and allows somewhat random read start points. Least efficient, but would work, would be for me to just do a 'binary search' in the file by picking a point in the file and scanning for a key frame, check the time, and jump forward or backward depending on the result of the comparison. No complicated indexes needed. Writing of the stream to disk is a MUCH more frequent activity than read so writing needs to be optimized over reading/playback. It's kind of like a data acquisition system that gathers a stream of data and you want to be able to play it back from an arbitrary point. Again, I can roll my own but figured it was worth checking to see if something existed that was close to my needs but all my searches only show up tools for audio or video. As an aside: forward seems easy, skip back "x seconds" is harder/less efficient. For more information on the system in g

        D L M 3 Replies Last reply
        0
        • C Chuck844

          To be more specific ... My application is a signal system I have designed for "Ride On Railroads" (7.5" gauge typically here in the USA). The system consists of controller nodes distributed around the railroad. Each of these nodes detects track occupancy, calculates which train should be permitted to proceed and sets signals accordingly. All of this data (track occupancy, signal head settings, etc.) is broadcast on a single CAN Bus in real time. There can be one or more PCs attached to the network for monitoring and control (NOT control of train movements, that's totally done by the controller nodes). One of the things the PCs support is display of train movements to passengers as well as one or more dispatchers. I want to record this CAN Bus data as a stream of 'change' events as well as periodic "key frame" records to a disk file. The key frame record records the current status of every object (track, signal, etc.) on the railroad. Thus, starting at a 'key frame' and proceeding forward in time you have a time record of everything that happened on the railroad. I want to be able to switch the display screen from the 'live data stream' (what is currently happening on the railroad) and display what happened at an earlier time ... i.e.: replay the railroad activity. So, I need to be able to support things like "play back the data stream from 5pm yesterday", etc. This is done all the time with audio and video streams but I have not been able to find any examples of code that will do it for an arbitrary stream of data. I also need to decide the file format that would be efficient for recording the data stream and allows somewhat random read start points. Least efficient, but would work, would be for me to just do a 'binary search' in the file by picking a point in the file and scanning for a key frame, check the time, and jump forward or backward depending on the result of the comparison. No complicated indexes needed. Writing of the stream to disk is a MUCH more frequent activity than read so writing needs to be optimized over reading/playback. It's kind of like a data acquisition system that gathers a stream of data and you want to be able to play it back from an arbitrary point. Again, I can roll my own but figured it was worth checking to see if something existed that was close to my needs but all my searches only show up tools for audio or video. As an aside: forward seems easy, skip back "x seconds" is harder/less efficient. For more information on the system in g

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          I've never heard of any such tools, probably because of the infinite nature of "arbitrary data".

          Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles.
          Dave Kreskowiak

          1 Reply Last reply
          0
          • C Chuck844

            To be more specific ... My application is a signal system I have designed for "Ride On Railroads" (7.5" gauge typically here in the USA). The system consists of controller nodes distributed around the railroad. Each of these nodes detects track occupancy, calculates which train should be permitted to proceed and sets signals accordingly. All of this data (track occupancy, signal head settings, etc.) is broadcast on a single CAN Bus in real time. There can be one or more PCs attached to the network for monitoring and control (NOT control of train movements, that's totally done by the controller nodes). One of the things the PCs support is display of train movements to passengers as well as one or more dispatchers. I want to record this CAN Bus data as a stream of 'change' events as well as periodic "key frame" records to a disk file. The key frame record records the current status of every object (track, signal, etc.) on the railroad. Thus, starting at a 'key frame' and proceeding forward in time you have a time record of everything that happened on the railroad. I want to be able to switch the display screen from the 'live data stream' (what is currently happening on the railroad) and display what happened at an earlier time ... i.e.: replay the railroad activity. So, I need to be able to support things like "play back the data stream from 5pm yesterday", etc. This is done all the time with audio and video streams but I have not been able to find any examples of code that will do it for an arbitrary stream of data. I also need to decide the file format that would be efficient for recording the data stream and allows somewhat random read start points. Least efficient, but would work, would be for me to just do a 'binary search' in the file by picking a point in the file and scanning for a key frame, check the time, and jump forward or backward depending on the result of the comparison. No complicated indexes needed. Writing of the stream to disk is a MUCH more frequent activity than read so writing needs to be optimized over reading/playback. It's kind of like a data acquisition system that gathers a stream of data and you want to be able to play it back from an arbitrary point. Again, I can roll my own but figured it was worth checking to see if something existed that was close to my needs but all my searches only show up tools for audio or video. As an aside: forward seems easy, skip back "x seconds" is harder/less efficient. For more information on the system in g

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            "Play back" then simply depends on the "player" having a proper interface; i.e. the same one for real-time playing and historical. In real-time, you add to a concurrent queue (enque / dequeue) AND a concurrent serial log (append). The real-time "playing" uses the "real-time" queue. In play-back, you load what you want to the "play-back" queue (a reference) from the serial log, and a new instance of the player runs off of that.

            It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it. ― Confucian Analects: Rules of Confucius about his food

            1 Reply Last reply
            0
            • C Chuck844

              I have an application that receives messages from a network that describe object events and status (think of a CAN Bus data logging type of application). My plan is to record 'change' events (actual change as opposed to re-transmit) to disk along with 'key frames' (status of all objects) to allow later playback of the data. Data format is not predetermined. I'll work with whatever is the best fit. I am looking for code that would support playback controls such as 'play', 'pause', 'rewind', 'start playing at ', 'fast forward', etc. My searching of the web gets me lots of things having to do with audio and video playback but nothing in the area of arbitrary data playback. I can 'roll my own' but a head start would be helpful. Thanks in advance for your thoughts ...

              B Offline
              B Offline
              BillWoodruff
              wrote on last edited by
              #6

              I would separate out the task of display of real-time "live" continuous state information from the task of doing a kind of animated slide-show starting from an initial state (key-frame). I think different strategies would be involved: streaming vs. moving back or forward in time in a data store.

              «One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali

              C 1 Reply Last reply
              0
              • C Chuck844

                To be more specific ... My application is a signal system I have designed for "Ride On Railroads" (7.5" gauge typically here in the USA). The system consists of controller nodes distributed around the railroad. Each of these nodes detects track occupancy, calculates which train should be permitted to proceed and sets signals accordingly. All of this data (track occupancy, signal head settings, etc.) is broadcast on a single CAN Bus in real time. There can be one or more PCs attached to the network for monitoring and control (NOT control of train movements, that's totally done by the controller nodes). One of the things the PCs support is display of train movements to passengers as well as one or more dispatchers. I want to record this CAN Bus data as a stream of 'change' events as well as periodic "key frame" records to a disk file. The key frame record records the current status of every object (track, signal, etc.) on the railroad. Thus, starting at a 'key frame' and proceeding forward in time you have a time record of everything that happened on the railroad. I want to be able to switch the display screen from the 'live data stream' (what is currently happening on the railroad) and display what happened at an earlier time ... i.e.: replay the railroad activity. So, I need to be able to support things like "play back the data stream from 5pm yesterday", etc. This is done all the time with audio and video streams but I have not been able to find any examples of code that will do it for an arbitrary stream of data. I also need to decide the file format that would be efficient for recording the data stream and allows somewhat random read start points. Least efficient, but would work, would be for me to just do a 'binary search' in the file by picking a point in the file and scanning for a key frame, check the time, and jump forward or backward depending on the result of the comparison. No complicated indexes needed. Writing of the stream to disk is a MUCH more frequent activity than read so writing needs to be optimized over reading/playback. It's kind of like a data acquisition system that gathers a stream of data and you want to be able to play it back from an arbitrary point. Again, I can roll my own but figured it was worth checking to see if something existed that was close to my needs but all my searches only show up tools for audio or video. As an aside: forward seems easy, skip back "x seconds" is harder/less efficient. For more information on the system in g

                M Offline
                M Offline
                Mycroft Holmes
                wrote on last edited by
                #7

                What format is the data in? Can it be stored into a database in a sequential manner? If so the do as Bill suggested and divorce the real time (which should be recording the data into a database) process and the play back process. If the data can be stored in a database then play back is a trivial matter.

                Never underestimate the power of human stupidity - RAH I'm old. I know stuff - JSOP

                1 Reply Last reply
                0
                • B BillWoodruff

                  I would separate out the task of display of real-time "live" continuous state information from the task of doing a kind of animated slide-show starting from an initial state (key-frame). I think different strategies would be involved: streaming vs. moving back or forward in time in a data store.

                  «One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali

                  C Offline
                  C Offline
                  Chuck844
                  wrote on last edited by
                  #8

                  Thanks to all for the feedback. I am going to reexamine the amount of data involved and the expected frequency of recording .vs. playback to see if it warrants a database approach or another approach. Thanks to all.

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups