private void InitializeDataTable(AIChannelCollection channelCollection, ref DataTable data) { if (channelCollection == null) { return; } int numOfChannels = channelCollection.Count; data.Rows.Clear(); data.Columns.Clear(); dataColumn = new DataColumn[numOfChannels]; int numOfRows = 10; for (int currentChannelIndex = 0; currentChannelIndex < numOfChannels; currentChannelIndex++) { dataColumn[currentChannelIndex] = new DataColumn(); dataColumn[currentChannelIndex].DataType = typeof(double); dataColumn[currentChannelIndex].ColumnName = channelCollection[currentChannelIndex].PhysicalName; } data.Columns.AddRange(dataColumn); for (int currentDataIndex = 0; currentDataIndex < numOfRows; currentDataIndex++) { object[] rowArr = new object[numOfChannels]; data.Rows.Add(rowArr); } }
private void InitializeDataTable(AIChannelCollection channelCollection, ref DataTable data, int secSize) { int numOfChannels = channelCollection.Count; // plus time axis data.Rows.Clear(); data.Columns.Clear(); dataColumn = new DataColumn[numOfChannels + 1]; int numOfRows = samplesPerChannel * secSize; dataColumn[0] = new DataColumn(); dataColumn[0].DataType = typeof(double); dataColumn[0].ColumnName = "Time(sec)"; for (int currentChannelIndex = 0; currentChannelIndex < numOfChannels; currentChannelIndex++) { dataColumn[currentChannelIndex + 1] = new DataColumn(); dataColumn[currentChannelIndex + 1].DataType = typeof(double); dataColumn[currentChannelIndex + 1].ColumnName = channelCollection[currentChannelIndex].PhysicalName; } data.Columns.AddRange(dataColumn); for (int currentDataIndex = 0; currentDataIndex < numOfRows + 1; currentDataIndex++) { object[] rowArr = new object[numOfChannels + 1]; data.Rows.Add(rowArr); } }
public void InitializeDataTable(AIChannelCollection channelCollection, ref DataTable data) { int numOfChannels = channelCollection.Count; data.Rows.Clear(); data.Columns.Clear(); dataColumn = new DataColumn[numOfChannels]; int numOfRows = 10; for (int currentChannelIndex = 0; currentChannelIndex < numOfChannels; currentChannelIndex++) { dataColumn[currentChannelIndex] = new DataColumn(); dataColumn[currentChannelIndex].DataType = typeof(double); dataColumn[currentChannelIndex].ColumnName = channelCollection[currentChannelIndex].PhysicalName; } data.Columns.AddRange(dataColumn); for (int currentDataIndex = 0; currentDataIndex < numOfRows; currentDataIndex++) { object[] rowArr = new object[numOfChannels]; data.Rows.Add(rowArr); } }