private void RefreshPattern() { if (recipeCombo.SelectedIndex < 0) { masterNo = 0; return; } DataRow row = ((DataTable)recipeCombo.DataSource).Rows[recipeCombo.SelectedIndex]; recipeSet.Fetch(row); recipeNo = recipeSet.RecNo; RefreshStringToSmus(); masterSet.Select(recipeNo); masterSet.Fetch(); masterNo = masterSet.RecNo; xLengthEdit.EditValue = masterSet.XLength; yHeightEdit.EditValue = masterSet.YHeight; stringCountEdit.EditValue = masterSet.StrCount; ledCountEdit.EditValue = masterSet.LedCount; ctrlPatternGrid.XLength = masterSet.XLength; ctrlPatternGrid.YHeight = masterSet.YHeight; ctrlPatternGrid.StringCount = masterSet.StrCount; ctrlPatternGrid.LedCount = masterSet.LedCount; bookmark.Get(); slaveSet.Select(masterNo); if (slaveSet.Empty == true) { patternGrid.DataSource = null; SetEditValueFromDataSet(); SetEditReadOnly(true); } else { patternGrid.DataSource = slaveSet.DataSet.Tables[0]; } bookmark.Goto(); patternGrid.Focus(); }
private void DialogPatternList_Load(object sender, EventArgs e) { masterSet.Select(recipeNo); masterSet.Fetch(); Int64 masterNo = masterSet.RecNo; xLengthEdit.EditValue = masterSet.XLength; yHeightEdit.EditValue = masterSet.YHeight; stringCountEdit.EditValue = masterSet.StrCount; ledCountEdit.EditValue = masterSet.LedCount; ctrlPatternGrid.XLength = masterSet.XLength; ctrlPatternGrid.YHeight = masterSet.YHeight; ctrlPatternGrid.StringCount = masterSet.StrCount; ctrlPatternGrid.LedCount = masterSet.LedCount; slaveSet.SelectIncludeNone(masterNo); patternGrid.DataSource = slaveSet.DataSet.Tables[0]; patternGridView.Appearance.EvenRow.BackColor = Color.FromArgb(244, 244, 236); patternGridView.OptionsView.EnableAppearanceEvenRow = true; }
private void Load(Int64 recipeNo) { masterSet.Select(recipeNo); masterSet.Fetch(0); MasterNo = masterSet.RecipeNo; keys = new Dictionary <Int64, PatternObject>(); names = new Dictionary <string, PatternObject>(); slaveSet.Select(MasterNo); for (int i = 0; i < slaveSet.RowCount; i++) { slaveSet.Fetch(i); PatternObject item = new PatternObject(slaveSet.RecNo); item.RecNo = slaveSet.RecNo; item.Name = slaveSet.Name; item.Memo = slaveSet.Memo; keys.Add(item.RecNo, item); names.Add(item.Name, item); } }
private void SetEditValueFromDataSet() { nameEdit.Text = recipeSet.Name; memoEdit.Text = recipeSet.Memo; st1XEdit.EditValue = recipeSet.ST1_X; st1YEdit.EditValue = recipeSet.ST1_Y; st1QREdit.Text = recipeSet.ST1_QR; st2XEdit.EditValue = recipeSet.ST2_X; st2YEdit.EditValue = recipeSet.ST2_Y; st2QREdit.Text = recipeSet.ST2_QR; masterSet.Select(recipeNo); masterSet.Fetch(); Int64 masterPatternNo = masterSet.RecNo; xLengthEdit.Value = masterSet.XLength; yHeightEdit.Value = masterSet.YHeight; stringCountEdit.Value = masterSet.StrCount; ledCountEdit.Value = masterSet.LedCount; ctrlPatternGrid.XLength = masterSet.XLength; ctrlPatternGrid.YHeight = masterSet.YHeight; ctrlPatternGrid.StringCount = masterSet.StrCount; ctrlPatternGrid.LedCount = masterSet.LedCount; ctrlPatternGrid.RefreshGrid(); masterLedSet.Select(masterPatternNo); for (int i = 0; i < masterLedSet.RowCount; i++) { masterLedSet.Fetch(i); int x = masterLedSet.X; int y = masterLedSet.Y; ctrlPatternGrid.PatternRows[y].Leds[x].RecNo = masterLedSet.RecNo; ctrlPatternGrid.PatternRows[y].Leds[x].X = x; ctrlPatternGrid.PatternRows[y].Leds[x].Y = y; ctrlPatternGrid.PatternRows[y].Leds[x].StringIndex = masterLedSet.StrNo; ctrlPatternGrid.PatternRows[y].Leds[x].LedIndex = masterLedSet.LedNo; ctrlPatternGrid.PatternRows[y].Leds[x].Type = masterLedSet.Type; } ctrlPatternGrid.RefreshGridData(); smuSet.Select(recipeNo); RefreshSmuGrid(AppRes.Properties.SmuCount, masterSet.StrCount); for (int i = 0; i < smuSet.RowCount; i++) { smuSet.Fetch(i); stringRows[smuSet.StringNo].RecNo = smuSet.RecNo; stringRows[smuSet.StringNo].Sets.DDWord(0, smuSet.Sets); } RefreshSmuGridData(); binSet.Select(recipeNo); for (int i = 0; i < binSet.RowCount; i++) { binSet.Fetch(i); binRows[i].RecNo = binSet.RecNo; binRows[i].Type = binSet.Type; binRows[i].Index = binSet.Index; binRows[i].Name = binSet.Name; binRows[i].Mark = binSet.Mark; } AppHelper.RefreshGridData(binGridView); }