private void LoadInstrumentListFromDocument() { InstrumentListView.LargeImageList = new ImageList(); InstrumentListView.LargeImageList.ImageSize = new Size(32, 32); InstrumentListView.SmallImageList = new ImageList(); InstrumentListView.SmallImageList.ImageSize = new Size(16, 16); InstrumentListView.View = View.List; InstrumentListView.Columns.Add("Name", 100, HorizontalAlignment.Left); InstrumentListView.Columns.Add("Category", 50, HorizontalAlignment.Left); InstrumentListView.Columns.Add("SubCategory", 40, HorizontalAlignment.Left); InstrumentListView.Columns.Add("Description", 0, HorizontalAlignment.Left); InstrumentListView.View = View.Details; MainForm mainForm = (MainForm)this.parentForm; int numOfSessions = mainForm.numOfSessions; int instrumentListCounter = 0; for (int docCounter = 0; docCounter < getDocNumber(); docCounter++) { for (int patiantCounter = 0; patiantCounter < mainForm.SessionsArray[numOfSessions].document[/*mainForm.SessionsArray[numOfSessions].docNumber*/ docCounter].numOfPatiants; patiantCounter++) { for (int minutesCounter = 0; minutesCounter < mainForm.SessionsArray[numOfSessions].document[/*mainForm.SessionsArray[numOfSessions].docNumber*/ docCounter].sessionDuration * 2; minutesCounter++) { if (mainForm.SessionsArray[numOfSessions].document[docCounter /*mainForm.SessionsArray[numOfSessions].docNumber*/].timeLine[patiantCounter].MinutesArray[minutesCounter].instrumentStartHere) { InstrumentInfo instrument = (InstrumentInfo)mainForm.SessionsArray[numOfSessions].document[/*mainForm.SessionsArray[numOfSessions].docNumber*/ docCounter].timeLine[patiantCounter].MinutesArray[minutesCounter].instrumetnInfo; bool existsInStatisticsList = false; foreach (ListViewItem item in InstrumentListView.Items) { if (item.Text == instrument.Name) { existsInStatisticsList = true; } } if (existsInStatisticsList) { continue; } //myImage my_image = (myImage)imageList[imageCounter]; string picName = mainForm.MainDirectory + "\\pictures\\instruments\\" + instrument.Category + "\\" + instrument.SubCategory + "\\" + instrument.Name; Bitmap image1 = new Bitmap(picName); Bitmap image = new Bitmap(image1, new Size(32, 32)); InstrumentListView.LargeImageList.Images.Add(image); ListViewItem textListItem = InstrumentListView.Items.Add(instrument.Name, instrumentListCounter); image = new Bitmap(image1, new Size(16, 16)); InstrumentListView.SmallImageList.Images.Add(image); textListItem.SubItems.Add(instrument.Category); textListItem.SubItems.Add(instrument.SubCategory); textListItem.SubItems.Add(instrument.Description); instrumentListCounter++; } } } } }
public Minute() { isInstrumentInButton = false; instrumetnInfo = new InstrumentInfo("", "", "", ""); opacPanel = new OpacPanel(Color.Red, 100, new Point(0, 0)); arrowList = new ArrayList(); }
private int performStatistics(int fromSession, int toSession, int fromPatiant, int toPatiant) { int statisticsCounter = 0; MainForm mainForm = (MainForm)this.parentForm; int numOfSessions = mainForm.numOfSessions; int fromMinute = Convert.ToInt16(this.FromMinuteNumericUpDown.Value) * 2; int toMinute = Convert.ToInt16(this.ToMinuteNumericUpDown.Value) * 2; for (int listCounter = 0; listCounter < StatisticsArrayList.Count; listCounter++) { StatisticsListItem statisticsItem = (StatisticsListItem)StatisticsArrayList[listCounter]; switch (statisticsItem.ItemType) { case 1: //instrument for (int docCounter = fromSession; docCounter <= toSession; docCounter++) { for (int patiantCounter = fromPatiant; patiantCounter < toPatiant /*mainForm.SessionsArray[numOfSessions].document[docCounter].numOfPatiants*/; patiantCounter++) { bool dontCountThisPatiant = false; foreach (CheckBox checkbox in checkBoxPanel.Controls) { if (mainForm.SessionsArray[numOfSessions].document[docCounter].timeLine[patiantCounter].PatiantName == checkbox.Text && checkbox.Checked == false) { dontCountThisPatiant = true; } } if (dontCountThisPatiant) { continue; } for (int minutesCounter = fromMinute; minutesCounter < /*mainForm.SessionsArray[numOfSessions].document[docCounter].sessionDuration * 2*/ toMinute; minutesCounter++) { if (mainForm.SessionsArray[numOfSessions].document[docCounter].timeLine[patiantCounter].MinutesArray[minutesCounter].instrumentStartHere) { InstrumentInfo instrument = (InstrumentInfo)mainForm.SessionsArray[numOfSessions].document[/*mainForm.SessionsArray[numOfSessions].docNumber*/ docCounter].timeLine[patiantCounter].MinutesArray[minutesCounter].instrumetnInfo; //myImage my_image = (myImage)imageList[imageCounter]; string instrName = instrument.Category + "\\" + instrument.SubCategory + "\\" + instrument.Name; if (statisticsItem.ItemName == instrName) { statisticsCounter++; } } } } } break; case 2: //text for (int patiantCounter = 0; patiantCounter < mainForm.SessionsArray[numOfSessions].document[mainForm.SessionsArray[numOfSessions].docNumber].numOfPatiants; patiantCounter++) { for (int minutesCounter = 0; minutesCounter < mainForm.SessionsArray[numOfSessions].document[mainForm.SessionsArray[numOfSessions].docNumber].sessionDuration * 2; minutesCounter++) { if (mainForm.SessionsArray[numOfSessions].document[mainForm.SessionsArray[numOfSessions].docNumber].timeLine[patiantCounter].MinutesArray[minutesCounter].topicAndSubTopic == statisticsItem.ItemName) { statisticsCounter++; } } } break; case 3: //arrow break; case 4: //disc for (int docCounter = fromSession; docCounter <= toSession; docCounter++) { for (int x = 0; x < mainForm.SessionsArray[numOfSessions].document[docCounter].DiscList.Count; x++) { Disc disc = (Disc)mainForm.SessionsArray[numOfSessions].document[docCounter].DiscList[x]; if (disc.startPoint >= fromMinute && disc.startPoint <= toMinute) { statisticsCounter++; } } } break; case 5: //sing for (int docCounter = fromSession; docCounter <= toSession; docCounter++) { for (int x = 0; x < mainForm.SessionsArray[numOfSessions].document[docCounter].SingScreamList.Count; x++) { SingSinusAndScreamZigzag sing = (SingSinusAndScreamZigzag)mainForm.SessionsArray[numOfSessions].document[docCounter].SingScreamList[x]; if (sing.startPoint >= fromMinute && sing.startPoint <= toMinute && sing.type == 1) { bool dontCountThisPatiant = false; foreach (CheckBox checkbox in checkBoxPanel.Controls) { if (mainForm.SessionsArray[numOfSessions].document[docCounter].timeLine[sing.patiantNumber].PatiantName == checkbox.Text && checkbox.Checked == false) { dontCountThisPatiant = true; } } if (dontCountThisPatiant) { continue; } statisticsCounter++; } } } break; case 6: //scream for (int docCounter = fromSession; docCounter <= toSession; docCounter++) { for (int x = 0; x < mainForm.SessionsArray[numOfSessions].document[docCounter].SingScreamList.Count; x++) { SingSinusAndScreamZigzag sing = (SingSinusAndScreamZigzag)mainForm.SessionsArray[numOfSessions].document[docCounter].SingScreamList[x]; if (sing.startPoint >= fromMinute && sing.startPoint <= toMinute && sing.type == 2) { bool dontCountThisPatiant = false; foreach (CheckBox checkbox in checkBoxPanel.Controls) { if (mainForm.SessionsArray[numOfSessions].document[docCounter].timeLine[sing.patiantNumber].PatiantName == checkbox.Text && checkbox.Checked == false) { dontCountThisPatiant = true; } } if (dontCountThisPatiant) { continue; } statisticsCounter++; } } } break; case 7: //silence for (int docCounter = fromSession; docCounter <= toSession; docCounter++) { for (int x = 0; x < mainForm.SessionsArray[numOfSessions].document[docCounter].SilencePanelList.Count; x++) { SilencePanel silence = (SilencePanel)mainForm.SessionsArray[numOfSessions].document[docCounter].SilencePanelList[x]; if (silence.startPoint >= fromMinute && silence.startPoint <= toMinute) { statisticsCounter++; } } } break; } } return(statisticsCounter); }