public PanelState(string lotID, CSAM_ManualRecipe recipe) { LotID = lotID; int iDeviceCount = recipe.TEMS_Count_X * recipe.TEMS_Count_Y; for (int y = 1; y <= recipe.TEMS_Count_Y; y++) { for (int x = 1; x <= recipe.TEMS_Count_X; x++) { int deviceIndex = 0; if (y % 2 == 1) { deviceIndex = x + (y - 1) * recipe.TEMS_Count_X; } else { deviceIndex = (1 + recipe.TEMS_Count_X - x) + (y - 1) * recipe.TEMS_Count_X; } TEMS_State tems_state = new TEMS_State(y, x, deviceIndex); TEMS_States.Add(tems_state); //dictPoint_TEMS_States.Add(new Point(x, y), tems_state); //dictDeviceID_TEMS_States.Add(deviceIndex, tems_state); } } }
public static CSAM_ManualRecipe Load(string recipePath, string recipeFileName) { CSAM_ManualRecipe oCSAM_ManualRecipe = null; Logger logger = LogManager.GetCurrentClassLogger(); try { logger.Debug("entering {0}.{1}", MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name); XmlSerializer serializer = new XmlSerializer(typeof(CSAM_ManualRecipe)); // Could do some handling here, but I don't think it buys us much. There are .UnknownNode, .UnknownElement, and a few other .Unknown methods. // AddHandler serializer.UnknownNode StreamReader reader = new StreamReader(recipePath + recipeFileName); oCSAM_ManualRecipe = (CSAM_ManualRecipe)serializer.Deserialize(reader); oCSAM_ManualRecipe.FileFullPath = recipePath + recipeFileName; reader.Close(); } catch (Exception ex) { logger.Error(ex); } finally { logger.Debug("exiting {0}.{1}", MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name); } return(oCSAM_ManualRecipe); }
public static CSAM_ManualRecipe OpenWithDialog(string initialDirectory) { CSAM_ManualRecipe recipe = null; Logger logger = LogManager.GetCurrentClassLogger(); try { using (OpenFileDialog openFileDialog = new OpenFileDialog()) { openFileDialog.InitialDirectory = initialDirectory; openFileDialog.Filter = "xml files (*.xml)|*.xml"; openFileDialog.RestoreDirectory = true; if (openFileDialog.ShowDialog() == DialogResult.OK) { recipe = CSAM_ManualRecipe.Load(openFileDialog.FileName); recipe.FileFullPath = openFileDialog.FileName; } } } catch (Exception ex) { logger.Error(ex); } return(recipe); }
public void SetLotIDAndFolder(string lotID, string folderPath, CSAM_ManualRecipe recipe) { try { FolderPath = folderPath; LotID = lotID; LoadedRecipe = recipe; currentPanelState = new PanelState(lotID, LoadedRecipe); if (File.Exists(FolderPath + @"\" + PanelStateFilename)) { currentPanelState = PanelState.Load <PanelState>(FolderPath + @"\" + PanelStateFilename); } if (Directory.Exists(FolderPath)) { fileNameTH = FolderPath + @"\" + recipe.TH_AG1_Filename_Format; this.panelImageBoxTH.LoadImage(fileNameTH, PanelImageSides.TH, currentPanelState, LoadedRecipe); fileNameBH = FolderPath + @"\" + recipe.BH_AG1_Filename_Format; this.panelImageBoxBH.LoadImage(fileNameBH, PanelImageSides.BH, currentPanelState, LoadedRecipe); } } catch (Exception ex) { logger.Error(ex); } }
private void btnLoadRecipe_Click(object sender, EventArgs e) { try { LoadedRecipe = CSAM_ManualRecipe.OpenWithDialog(Program.RECIPE_PATH); } catch (Exception ex) { logger.Error(ex); } }
//public void SetImage(Image image) //{ // iboxPanel.Image = image; //} public void LoadImage(string sFilename, PanelImageSides panelImageSide, PanelState panelState, CSAM_ManualRecipe recipe) { if (File.Exists(sFilename)) { _RawFileName = sFilename; OpenRawImage(); _PanelImageSide = panelImageSide; _PanelState = panelState; this.recipe = recipe; } else { MessageBox.Show("Filename doesn't exist: " + sFilename); } }
private void btnMakeNewRecipe_Click(object sender, EventArgs e) { LoadedRecipe = new CSAM_ManualRecipe(); }