} // end FormClosing private void AnalyzeMaster() { string info; info = masterSeq.channelCount.ToString() + " channels\n"; info += masterSeq.groupCount.ToString() + " groups\n"; frmResults resultsForm = new frmResults(); resultsForm.SetInfo(info); resultsForm.ShowDialog(); DialogResult = resultsForm.DialogResult; }
} // end FormClosing private void AnalyzeMaster() { // Reset controllerCount = 0; string info = ""; channel ch; int ctlFound = -1; for (int chan = 0; chan < masterSeq.channelCount; chan++) { ch = masterSeq.channels[chan]; ctlFound = -1; if (controllerCount > 0) { for (int ctl = 0; ctl < controllerCount; ctl++) { if (ch.deviceType == controllers[ctl].type) { if (ch.unit == controllers[ctl].unit) { ctlFound = ctl; break; } } } } if (ctlFound < 0) { Controller ctlr = new Controller(); ctlr.type = ch.deviceType; ctlr.unit = ch.unit; ctlr.highestCircuit = ch.circuit; ctlr.channelCount = 1; int[] chList = new int[1]; chList[0] = chan; ctlr.channelList = chList; int[] ckts = new int[1]; ckts[0] = ch.circuit; ctlr.circuits = ckts; Array.Resize(ref controllers, controllerCount + 1); controllers[controllerCount] = ctlr; controllerCount++; } else { Controller ctlr = controllers[ctlFound]; ctlr.channelCount++; int[] chList = ctlr.channelList; Array.Resize(ref chList, ctlr.channelCount); chList[ctlr.channelCount - 1] = chan; int[] ckts = ctlr.circuits; ctlr.channelList = chList; Array.Resize(ref ckts, ctlr.channelCount); ckts[ctlr.channelCount - 1] = ch.circuit; ctlr.circuits = ckts; if (ch.circuit > ctlr.highestCircuit) { ctlr.highestCircuit = ch.circuit; } } } DateTime creationTime = File.GetCreationTime(lastMasterConfig); DateTime lastWriteTime = File.GetLastWriteTime(lastMasterConfig); info = "created on " + creationTime.ToString() + "\n"; info += "last modified on " + lastWriteTime.ToString() + "\n"; long fileSize = new System.IO.FileInfo(lastMasterConfig).Length; info += fileSize.ToString("###,###,###") + " bytes\n"; info += masterSeq.lineCount.ToString() + " lines\n"; info += masterSeq.channelCount.ToString() + " channels\n"; info += masterSeq.groupCount.ToString() + " groups\n"; info += masterSeq.trackCount.ToString() + " tracks\n"; info += masterSeq.timingGridCount.ToString() + " timing grids\n"; info += controllerCount.ToString() + " controllers\n"; frmResults resultsForm = new frmResults(); resultsForm.SetInfo(info); resultsForm.SetFilename(Path.GetFileNameWithoutExtension(lastMasterConfig)); resultsForm.ShowDialog(); DialogResult = resultsForm.DialogResult; }