c# - Save data stream to a file every second in .NET -
i reading sensor(kinect) data in event handler of event gets raised when data available (at 30 times/sec). calculating joint angles data.
up on clicking button,i need write joint angle data file every second(variable) 5 minutes(variable).
can 1 please point me in right direction on how accomplish this.
i using wpf, c#, kinect widows 2 sdk
you can use timer!
static system.windows.forms.timer mytimer = new system.windows.forms.timer(); void timerinit(int interval) { mytimer.tick += new eventhandler(mytimer_tick); //this run every interval mytimer.interval = internal; mytimer.enabled = true; mytimer.start(); } private static void mytimer_tick(object sender, eventargs e) { system.io.file.writealltext(@"c:\path.txt", jointangles); //you might want append if (reached 5 minutes or x write cycles) { mytimer.stop(); } }
Comments
Post a Comment