public void SnapShot() { PersistentLoggerState s = new PersistentLoggerState(); MyAIO aio = new MyAIO(true); aio.DiscoverDevices("Aio00"); List <float[]> ss = aio.ChannelsSnapShot(s.data.n_channels); Debug.Write("####################################################################"); Debug.Write(ss[0][0] + "," + ss[0][1] + "," + ss[0][2] + "," + ss[0][3] + "," + ss[0][4]); Debug.Write(ss[1][0] + "," + ss[1][1] + "," + ss[1][2] + "," + ss[1][3] + "," + ss[1][4]); }
public void TestAIOSettingsImportExport() { //string testXMLfault = @"<?xmlversion=""1.0"" encoding=""utf-16""?><SettingData xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema""><testpath>C:\Users\Alva\Desktop\Control Tests Device 2</testpath><frequency>0</frequency><clipsOn>false</clipsOn><mass>0</mass><load>0</load><shakertype>0</shakertype><paddtype>1</paddtype><n_devices>0</n_devices><n_channels>64</n_channels><duration>5</duration><timer_interval>1000</timer_interval><external_trigger>false</external_trigger><path>C:\Users\Alva\Desktop\default.xml</path><modified>false</modified></SettingData>"; string testXML = @"<?xml version=""1.0"" encoding=""utf-16""?><SettingData xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema""><testpath>C:\Users\Alva\Desktop\Control Tests Device 2</testpath><frequency>0</frequency><clipsOn>false</clipsOn><mass>0</mass><load>0</load><shakertype>0</shakertype><paddtype>1</paddtype><n_devices>0</n_devices><n_channels>64</n_channels><duration>5</duration><timer_interval>1000</timer_interval><external_trigger>false</external_trigger><path>C:\Users\Alva\Desktop\default.xml</path><modified>false</modified></SettingData>"; PersistentLoggerState aios = new PersistentLoggerState(); bool res; //if comment out the default_xml line in code //res = aios.ImportXML(testXMLfault); //Assert.IsFalse(res); //Assert.IsTrue(aios.data.n_channels == 0); res = aios.ImportXML(testXML); Assert.IsTrue(res); Assert.IsTrue(aios.data.n_channels == 64); }