void SetAIO() { //so can dynamically change AIO device binding (testing mode) if (myaio != null) { myaio = null; //need to implement Dispose! //myaio.Dispose(); } myaio = new MyAIO(PersistentLoggerState.ps.data.testingmode); //Load Devices int devices_count = myaio.DiscoverDevices(DEVICE_ROOT); PersistentLoggerState.ps.data.n_devices = devices_count; SetStatus(PersistentLoggerState.ps.data.n_devices + " Devices Connected"); }
string GenerateDataReport(List <int> data) { String report = ""; if (data.Count > 7) { report += "| A01: " + MyAIO.I2V(data[0]) + "," + MyAIO.I2V(data[1]) + "," + MyAIO.I2V(data[2]) + "\r\n"; report += "| A02: " + MyAIO.I2V(data[3]) + "," + MyAIO.I2V(data[4]) + "," + MyAIO.I2V(data[5]) + "\r\n"; report += "| A03: " + MyAIO.I2V(data[6]) + "," + MyAIO.I2V(data[7]) + "," + MyAIO.I2V(data[8]); } if (data.Count > 28) { report += "\r\n| A10: " + MyAIO.I2V(data[27]) + "," + MyAIO.I2V(data[28]) + "," + MyAIO.I2V(data[29]); } int end = data.Count; report += "\r\n| A" + end + ": " + MyAIO.I2V(data[end - 3]) + "," + MyAIO.I2V(data[end - 2]) + "," + MyAIO.I2V(data[end - 1]); return(report); }
public Calibration(MyAIO aio) { InitializeComponent(); this.myaio = aio; }