private void VisionControl_Load(object sender, EventArgs e) { //splitcontainer3.hide(); //生成Tree View treeViewProgram.Hide(); try { if (File.Exists(ENVFilePath)) { easyRanger = new ProcessingEnvironment(); easyRanger.Load(ENVFilePath); updateLogMsg("Load Environment File from " + ENVFilePath); envRes = new ENVResolveClass(easyRanger); updateLogMsg("Load Environment File Successfully..."); InitStpNameDict(easyRanger); InitGUIControls(); //InitTreeView(); InitViewer(selectedViewType); //updateLogMsg("InitDisplaying " + selectedViewType + "......"); //if (InitialCamera()) //{ // updateLogMsg("Camera Initial successfully..."); // imageProcessStartFlag = false; //} //else //{ // updateLogMsg("Camera Initial failed..."); //} // default select index mySyncContext = SynchronizationContext.Current; backgroundWorker = new BackgroundWorker(); backgroundWorker.DoWork += BackgroundWorker_DoWork; backgroundWorker.WorkerSupportsCancellation = true; threadRunFlag = true; xmlRes = new XmlResolveClass(); List <string> doubleDataNames = xmlRes.getEnableVariables(XmlResolveClass.VariableType.Number); int i = 0; foreach (Control cnt in splitContainer4.Panel2.Controls) { cnt.Text = doubleDataNames[i].Substring(4); cnt.Size = new System.Drawing.Size(54, 20); cnt.BackColor = Color.FromKnownColor(KnownColor.LightGray); i++; } } else { updateLogMsg(ENVFilePath + " do not exist!"); } } catch (Exception ex) { updateLogMsg(ex.ToString()); } }
void InitStpNameDict(ProcessingEnvironment env) { int i = 0; foreach (StepProgram stpProg in env.Programs) { stpNameDict.Add(stpProg.Name, i); comboBoxProgram.Items.Add(stpProg.Name); i++; } }
public override void Init(ProcessingEnvironment processingEnv) { lock (this) { base.Init(processingEnv); _messagePrinter = new MessagePrinter(processingEnv.Messager); _duplicationValidator = new DuplicatedExtensionValidator <ICollection <Element>, Stream <CompilationMessage> >(processingEnv.ElementUtils, _supportedAnnotationType, _customNameFunction); _visitor = _visitorSupplier.apply(processingEnv); } }
public ENVResolveClass(ProcessingEnvironment ezrEnz) { env = ezrEnz; xmlRes = new XmlResolveClass(); }
protected ContentLoaderBase(Type annotatedClass, ProcessingEnvironment environment) { _environment = environment; _annotatedClass = annotatedClass; _typeRetriever = TypeRetriever.With(environment); }