private VisionResult Fm_SoftwareCliab_DetectLabel(string arg1, Module arg2, Nozzle arg3) { VisionResult rtn = new VisionResult(); if (this.bSet_CamLive) { this.bCamLive_Click(this, new EventArgs()); Thread.Sleep(100); } Camera camera = Camera.Bottom1; if (arg3 == Nozzle.Nz3 || arg3 == Nozzle.Nz4) { camera = Camera.Bottom2; } var roi = SystemEntiy.Instance[arg2].MachineConfig[arg3].ViewRoi; using (VisionImage img = CameraDefine.Instance.Camera[arg2][camera].Snap()) { rtn = VisionCalHelper.Instance.DetectUI(arg1, img, roi); Algorithms.Copy(img, this.imageSet.imageSet.Image); } return(rtn); }
private void sliderthroat_ValueChanged(object sender, RoutedPropertyChangedEventArgs <double> e) //funcion que cambia la forma de la tubera { try { canvasNozzle.Children.Clear(); double k = this.sliderthroat.Value * this.dx; this.nozzle = new Nozzle(this.numR, this.dx, k); this.pilaNozzle = new Stack <Nozzle>(); // Courant condition --> stability this.dt = this.nozzle.getdt(this.C, this.dx); this.positionThroat = this.nozzle.getthroatpos(); contadortxt.Text = " Contador: " + this.contadordt.ToString() + " Δt"; this.listdt = new List <double>(); this.listdt.Add(this.contadordt); this.listdendt = new List <double>(); this.listdendt.Add(this.nozzle.GetRectangulo(this.positionThroat).GetDensP()); this.listpredt = new List <double>(); this.listpredt.Add(this.nozzle.GetRectangulo(this.positionThroat).GetPresP()); this.listtempdt = new List <double>(); this.listtempdt.Add(this.nozzle.GetRectangulo(this.positionThroat).GetTempP()); this.listveldt = new List <double>(); this.listveldt.Add(this.nozzle.GetRectangulo(this.positionThroat).GetVelP()); this.listmassflowdt = new List <double>(); this.listmassflowdt.Add(listdendt[this.contadordt] * this.nozzle.GetRectangulo(this.positionThroat).GetArea() * this.listveldt[this.contadordt]); fillCanvasNozzleSlider(); refreshCanvas(); updateParameterlist(); crearDataTable(); } catch { } }
public short RGoAngle(double angle, Nozzle nozzle, Shceme shceme = Shceme.ManualNormal) { short rtn = 0; rtn += this.MachineAxis.R[(int)nozzle].GoPos(angle, SpeedDefine.Instance[Module][shceme, GeneralAxis.U]); return(rtn); }
// Use this for initialization void Start() { mainThruster = gameObject.transform.Find("Thrusters/MainThruster").GetComponent <Nozzle> (); frontLeftThruster = gameObject.transform.Find("Thrusters/FrontLeftThruster").GetComponent <Nozzle> (); frontRightThruster = gameObject.transform.Find("Thrusters/FrontRightThruster").GetComponent <Nozzle> (); backLeftThruster = gameObject.transform.Find("Thrusters/BackLeftThruster").GetComponent <Nozzle> (); backRightThruster = gameObject.transform.Find("Thrusters/BackRightThruster").GetComponent <Nozzle> (); frontThruster1 = gameObject.transform.Find("Thrusters/FrontThruster1").GetComponent <Nozzle> (); frontThruster2 = gameObject.transform.Find("Thrusters/FrontThruster2").GetComponent <Nozzle> (); if (weapons.Count != 0) { activeWeapon = weapons[0]; weaponNr = 1; } else { weaponNr = 0; } pidController = gameObject.GetComponent <PIDController> (); if (gameObject.tag == "Vessel") { StartCoroutine(ClearSpaceAroundShip(false, 0.1f)); } initialFuel = fuel; fuelIsBingo = false; initialHealth = health; }
/// <summary> /// 根据吸嘴获得实际坐标 /// </summary> /// <param name="nz">输入-吸嘴</param> /// <param name="capturePt"></param> /// <param name="imagePt"></param> /// <param name="wroldPt"></param> /// <returns></returns> public bool WroldPt(Nozzle nz, PointF capturePt, PointContour imagePt, out PointF wroldPt) { Camera camera = Camera.Bottom1; if (nz == Nozzle.Nz3 || nz == Nozzle.Nz4) { camera = Camera.Bottom2; } int i = 0; if (nz == Nozzle.Nz2 || nz == Nozzle.Nz4) { i = 1; } wroldPt = new PointF(); try { PointF pt1 = CameraDefine.Instance.CameraList[this.Module][camera].Mat2D[i].Pixel2World(imagePt); wroldPt = pt1; wroldPt.X = capturePt.X - (pt1.X - CameraDefine.Instance.CameraList[this.Module][camera].Mat2D[i].CliabCenter.X); wroldPt.Y = capturePt.Y - (pt1.Y - CameraDefine.Instance.CameraList[this.Module][camera].Mat2D[i].CliabCenter.Y); return(true); } catch { return(false); } }
public ulong this[Nozzle nz] { get { if (ZDropCount.ContainsKey(nz)) { return(ZDropCount[nz]); } else { return(0); } } set { if (!ZDropCount.ContainsKey(nz)) { ZDropCount.Add(nz, value); } else { ZDropCount[nz] = value; } } }
public override void OnEnter() { for (Nozzle nz = Nozzle.Nz1; nz <= Nozzle.Nz4; ++nz) { switch (this.machine.RunData.RUN_NzData[nz].State) { case NZ_State.Sucked: case NZ_State.DownSuccessed: case NZ_State.DownFailed: this.RejectList.Add(nz); this.MoveParam.NzUsed[(int)nz] = true; this.MoveParam.ZPos[(int)nz] = this.entiy.MachineConfig[nz].DropHeight; this.MoveParam.MoveR = true; this.MoveParam.MoveZ = true; this.MoveParam.XYPos = this.entiy.MachineConfig.DropPoint; break; case NZ_State.Pasted: this.machine.RunData.RUN_NzData[nz].State = NZ_State.NoUsed; break; } } base.OnEnter(); }
public Anderson() { InitializeComponent(); // creamos el nozzle con las condiciones iniciales this.Ax = 0.1; this.nozzle = new Nozzle(30, this.Ax); this.At = this.nozzle.getdt(0.5, this.Ax); // creamos las tablas AndersonTabla_FisrtStep = new DataTable(); AndersonTabla_SteadyState = new DataTable(); AndersonTabla_InitialConditions = new DataTable(); NozzleTabla_FirstStep = new DataTable(); NozzleTabla_SteadyState = new DataTable(); NozzleTabla_InitialConditions = new DataTable(); ErrorDataTable_FirstStep = new DataTable(); ErrorDataTable_SteadyState = new DataTable(); ErrorDataTable_InitialConditions = new DataTable(); this.createTables(); // por defecto: first step table andersongrid.ItemsSource = AndersonTabla_FisrtStep.DefaultView; andersongrid.DataContext = AndersonTabla_FisrtStep.DefaultView; andersongrid.Items.Refresh(); datasimgrid.ItemsSource = NozzleTabla_FirstStep.DefaultView; datasimgrid.DataContext = NozzleTabla_FirstStep.DefaultView; datasimgrid.Items.Refresh(); errorgrid.ItemsSource = ErrorDataTable_FirstStep.DefaultView; errorgrid.DataContext = ErrorDataTable_FirstStep.DefaultView; errorgrid.Items.Refresh(); }
public PointF GetPasteOffset(Nozzle nz, PointF upPt, PointF pastePt) { PointF realPt = pastePt; double p1, p2, p3, p4, os, os2; if (HardwareOrgHelper.Instance.HardWare[this.Module].XPoly != null) { p1 = HardwareOrgHelper.Instance.HardWare[this.Module].XPoly.Evaluate(upPt.X); p2 = HardwareOrgHelper.Instance.HardWare[this.Module].XPoly.Evaluate(this.MachineConfig[nz].UpMarkPt.X); os = p2 - p1; p3 = HardwareOrgHelper.Instance.HardWare[this.Module].XPoly.Evaluate(pastePt.X); p4 = HardwareOrgHelper.Instance.HardWare[this.Module].XPoly.Evaluate(this.MachineConfig[nz].PastePt.X); os2 = p3 - p4; realPt.X += (float)(os + os2); } if (HardwareOrgHelper.Instance.HardWare[this.Module].YPoly != null) { p1 = HardwareOrgHelper.Instance.HardWare[this.Module].YPoly.Evaluate(upPt.Y); p2 = HardwareOrgHelper.Instance.HardWare[this.Module].YPoly.Evaluate(this.MachineConfig[nz].UpMarkPt.Y); os = p2 - p1; p3 = HardwareOrgHelper.Instance.HardWare[this.Module].YPoly.Evaluate(pastePt.Y); p4 = HardwareOrgHelper.Instance.HardWare[this.Module].YPoly.Evaluate(this.MachineConfig[nz].PastePt.Y); os2 = p3 - p4; realPt.Y += (float)(os + os2); } return(realPt); }
/// <summary> /// 初始化运行时变量 /// </summary> /// <param name="multiInfo"></param> public void Restet(MultiPasteInfo multiInfo) { RUN_CamMarkIsDone = false; RUN_CamBadmarkIsDone = false; RUN_CamPanelIsDone = false; RUN_CamCodeIsDone = false; RUN_NzData = new ConcurrentDictionary <Nozzle, NZ_RunData>(); RUN_PCBData = new List <Board_RunData>(); for (Nozzle nz = Nozzle.Nz1; nz <= Nozzle.Nz4; ++nz) { RUN_NzData.TryAdd(nz, new NZ_RunData()); } for (int i = 0; i < multiInfo.PasteInfos.Count; ++i) { RUN_PCBData.Add(new Board_RunData()); RUN_PCBData[i].MarkData = new Mark_RunData(); RUN_PCBData[i].PcsData = new Pcs_RunData[multiInfo.PasteInfos[i].PasteList.Count]; for (int j = 0; j < multiInfo.PasteInfos[i].PasteList.Count; ++j) { RUN_PCBData[i].PcsData[j] = new Pcs_RunData(); if (!multiInfo.PasteInfos[i].PasteList[j].CanPaste) { RUN_PCBData[i].PcsData[j].iPasteState = 3; } RUN_PCBData[i][j].UpPastePt = multiInfo.PasteInfos[i].PasteList[j].Pos; } } ChangePasteRegion?.Invoke(this.module); UpdateChart?.Invoke(this.module); }
public UpdateCalculationRequest() { HoseLength = 0; TipSize = 0; HoseSize = 0; NozzleType = Nozzle.SmoothBoreHand; }
// Use this for initialization void Start() { mainThruster = gameObject.transform.Find("Thrusters/MainThruster").GetComponent <Nozzle> (); frontLeftThruster = gameObject.transform.Find("Thrusters/FrontLeftThruster").GetComponent <Nozzle> (); frontRightThruster = gameObject.transform.Find("Thrusters/FrontRightThruster").GetComponent <Nozzle> (); backLeftThruster = gameObject.transform.Find("Thrusters/BackLeftThruster").GetComponent <Nozzle> (); backRightThruster = gameObject.transform.Find("Thrusters/BackRightThruster").GetComponent <Nozzle> (); frontThruster1 = gameObject.transform.Find("Thrusters/FrontThruster1").GetComponent <Nozzle> (); frontThruster2 = gameObject.transform.Find("Thrusters/FrontThruster2").GetComponent <Nozzle> (); if (weapons.Length != 0) { activeWeapon = weapons[0]; weaponIndex = 1; } else { weaponIndex = 0; } radar = gameObject.transform.Find("Radar").GetComponent <RadarController>(); radar.pingReach = radarRange; radar.SetRadarOff(); initialFuel = fuel; fuelIsBingo = false; pidController = gameObject.GetComponent <PIDController> (); if (gameObject.tag == "Vessel") { StartCoroutine(ClearSpaceAroundShip(false, 0.1f)); } }
private void bUpdateRotate_Click(object sender, EventArgs e) { try { double x = double.Parse(this.tDetectX.Text); double y = double.Parse(this.tDetectY.Text); this.tRotateX.Text = this.tDetectX.Text; this.tRotateY.Text = this.tDetectY.Text; SystemEntiy.Instance[this.module.Module].MachineConfig[this.selectNz2.SelectNz].RotatePoint = new PointContour(x, y); SystemEntiy.Instance[this.module.Module].MachineConfig[this.selectNz2.SelectNz].RotateCamPoint = SystemEntiy.Instance[this.module.Module].XYPos; SystemConfig.Save(); PointF captrue = SystemEntiy.Instance[this.module.Module].XYPos; for (Nozzle nz = Nozzle.Nz1; nz <= Nozzle.Nz4; ++nz) { if (SystemEntiy.Instance[this.module.Module].MachineConfig[this.selectNz2.SelectNz].RotateCamPoint != captrue) { MessageBox.Show("吸嘴拍照位置不一致!!请确认"); return; } } } catch { } }
public void SetNozzle(int index, Nozzle nozzle) { if (index < equippedNozzles_.Count()) { this.equippedNozzles_[index] = nozzle; } }
public override void OnEnter() { if (SystemConfig.Instance.General.EnableNozzleCheck && SystemConfig.Instance.General.RunMode == RunMode.Normal) { #region 设置曝光和打光 if (SystemConfig.Instance.General.RunMode == RunMode.Normal) { for (Nozzle nz = Nozzle.Nz1; nz <= Nozzle.Nz4; ++nz) { if (this.machine.RunData.RUN_NzData[nz].State == NZ_State.Pasted) { if (nz == Nozzle.Nz1 || nz == Nozzle.Nz2) { VisionCalHelper.Instance.SetShutterAndLight(entiy.Module, Camera.Bottom1 , this.machine.RunData.RUN_NzData[nz].SuckLabel); } else { VisionCalHelper.Instance.SetShutterAndLight(entiy.Module, Camera.Bottom2 , this.machine.RunData.RUN_NzData[nz].SuckLabel); } break; } } } #endregion base.OnEnter(); } else { this.OnExit(); } }
public override void OnEnter() { this.MoveParam.XYPos = entiy.MachineConfig[Nozzle.Nz1].RotateCamPoint; // 设置曝光和打光 Task.Factory.StartNew(() => { bool c1Light = false; bool c2Light = false; for (Nozzle nz = Nozzle.Nz1; nz <= Nozzle.Nz4; ++nz) { if (this.machine.RunData.RUN_NzData[nz].State == NZ_State.Sucked) { if ((nz == Nozzle.Nz1 || nz == Nozzle.Nz2) && !c1Light) { VisionCalHelper.Instance.SetShutterAndLight(entiy.Module, Camera.Bottom1 , this.machine.RunData.RUN_NzData[nz].SuckLabel); c1Light = true; } if ((nz == Nozzle.Nz3 || nz == Nozzle.Nz4) && !c2Light) { VisionCalHelper.Instance.SetShutterAndLight(entiy.Module, Camera.Bottom2 , this.machine.RunData.RUN_NzData[nz].SuckLabel); c2Light = true; } } } }); base.OnEnter(); }
public NozzleConfig this[Nozzle nozzle] { get { return(NozzleMap[nozzle]); } }
private void button2_Click(object sender, EventArgs e) { try { if (!ValidateInputNozzel()) { return; } Nozzle type = new Nozzle(); type.Id = commonFunctions.ToInt(lbl_nozzel.Text.Trim()); type.PumpId = commonFunctions.ToInt(lbl_id.Text.Trim()); type.FuelTypeId = commonFunctions.ToInt(cmb_fueltypes.SelectedValue.ToString()); type.TankId = commonFunctions.ToInt(cmb_tanks.SelectedValue.ToString()); type.UnitPrice = txt_unitPrice.Value; type.NozzelName = txt_nozzelName.Text.Trim(); type.LastTotalizerReading = 0; type.GroupOfCompanyID = 1; type.ModifiedUser = commonFunctions.LoginuserID; type.ModifiedDate = DateTime.Now; type.CreatedUser = commonFunctions.LoginuserID; type.CreatedDate = DateTime.Now; type.DataTransfer = 1; if (MessageBox.Show("Do you want to insert this record?", Messaging.MessageCaption, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { repoNozzle.Update(type); GetData(); } } catch (Exception ex) { MessageBox.Show("Error Has found when Saving data. Please forword following details to technical" + Environment.NewLine + "[" + ex.Message + Environment.NewLine + ex.Source + "]", Messaging.MessageCaption, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void CalNz(Nozzle nz, string funcName, VisionImage image) { if (this.machine.RunData.RUN_NzData[nz].State == NZ_State.Sucked) { // 移动完成开始拍照 var item = new Tool.ResultItem(); if (nz == Nozzle.Nz1 || nz == Nozzle.Nz2) { item.Camera = Camera.Bottom1; } else { item.Camera = Camera.Bottom2; } int offset = 0; if (nz == Nozzle.Nz2 || nz == Nozzle.Nz4) { offset = 800; } item.Key = ResultKey.DownVision; item.ROI = this.machine.MachineEntiy.MachineConfig[nz].ViewRoi; item.NZIndex = nz; item.funcName = funcName; item.PCBIndex = this.machine.RunData.RUN_NzData[nz].PCBIndex; item.PCSIndex = this.machine.RunData.RUN_NzData[nz].PCSIndex; item.CaptruePos = this.entiy.MachineConfig[Nozzle.Nz1].RotateCamPoint; VisionCalHelper.Instance.VisionDetect(entiy.Module, item, image, offset); } }
public PointF NozzleToCam(Nozzle nozzle, PointF nzPt) { PointF cur = this.XYPos; cur.X = nzPt.X + this.MachineConfig[nozzle].NzToCam.X; cur.Y = nzPt.Y + this.MachineConfig[nozzle].NzToCam.Y; return(cur); }
public static IList <Pressure> GetPressureFor(Nozzle nozzle) { var ret = from p in _db.Table <Pressure>() where p.NozzleId == nozzle.Id select p; return(ret.ToList()); }
/// <summary> /// 相机位转吸嘴位 /// </summary> /// <param name="nz"></param> /// <param name="labelPt"></param> /// <returns></returns> public PointF LabelToNz(Nozzle nz, PointF labelPt) { PointF nzPt = new PointF(); nzPt.X = labelPt.X - this.MachineConfig[nz].NzToLabelDist.X; nzPt.Y = labelPt.Y - this.MachineConfig[nz].NzToLabelDist.Y; return(nzPt); }
/// <summary> /// 吸嘴位转相机位 /// </summary> /// <param name="nz"></param> /// <param name="nzPt"></param> /// <returns></returns> public PointF NzToLabel(Nozzle nz, PointF nzPt) { PointF label = new PointF(); label.X = nzPt.X + this.MachineConfig[nz].NzToLabelDist.X; label.Y = nzPt.Y + this.MachineConfig[nz].NzToLabelDist.Y; return(label); }
public short ZGoPosTillStop(Nozzle nozzle, double pos, Shceme shceme = Shceme.ManualNormal) { short rtn = 0; double curPos = this.MachineAxis.Z[(int)nozzle].Pos; rtn += this.MachineAxis.Z[(int)nozzle].GoPosTillStop(ConstDefine.iActionTimeout, pos, SpeedDefine.Instance[Module][curPos, pos, shceme, GeneralAxis.Z]); return(rtn); }
public short RGoAngleTillStop(double angle, Nozzle nozzle, Shceme shceme = Shceme.ManualNormal) { short rtn = 0; double curPos = this.MachineAxis.R[(int)nozzle].Pos; rtn += this.MachineAxis.R[(int)nozzle].GoPosTillStop(ConstDefine.iActionTimeout, angle, SpeedDefine.Instance[Module][curPos, angle, shceme, GeneralAxis.U]); return(rtn); }
/// <summary> /// 相机 转 吸嘴坐标 /// </summary> /// <param name="camPt"></param> /// <returns></returns> public PointF CamToNozzle(Nozzle nozzle, PointF camPt) { PointF cur = this.XYPos; cur.X = camPt.X - this.MachineConfig[nozzle].NzToCam.X; cur.Y = camPt.Y - this.MachineConfig[nozzle].NzToCam.Y; return(cur); }
public ActionResult DeleteConfirmed(long id) { Nozzle nozzle = db.Nozzles.Find(id); db.Nozzles.Remove(nozzle); db.SaveChanges(); return(RedirectToAction("Index")); }
public static IList <WaterFlow> GetWaterFlowFor(Nozzle nozzle) { var ret = from wf in _db.Table <WaterFlow>() where wf.NozzleId == nozzle.Id select wf; return(ret.ToList()); }
public DataTable SimularUnCiclo() // simula un único ciclo y da la tabla con los resultados { Nozzle newnozzle = new Nozzle(this.nozzle); newnozzle.EjecutarCiclo(this.At, this.Ax, 1.4); newnozzle.ActualizarEstados(); return(newnozzle.GetEstado(this.Ax)); }
private void bCalRotateCenter_Click(object sender, EventArgs e) { if (fm_SoftwareCliab.FindTemp == null || fm_SoftwareCliab.FindTemp.GetInvocationList().Length <= 0) { MessageBox.Show("请打开相机轴控界面!!"); return; } Task.Factory.StartNew(() => { var entiy = SystemEntiy.Instance[this.module.Module]; PointF curPos = entiy.XYPos; Nozzle nz = this.selectNz2.SelectNz; PointContour circle = new PointContour(); List <PointF> ImagePt = new List <PointF>(); Camera camera = Camera.Bottom1; if (nz == Nozzle.Nz3 || nz == Nozzle.Nz4) { camera = Camera.Bottom2; } // 12 次拟合 for (int I = 0; I < 6; ++I) { entiy.RGoAngleTillStop(I * 60, nz); Thread.Sleep(200); var result = fm_SoftwareCliab.FindTemp.Invoke(this.module.Module, camera); if (result.State == VisionResultState.OK) { ImagePt.Add(new PointF((float)result.Point.X, (float)result.Point.Y)); } else { MessageBox.Show("侦测失败!!"); return; } } double x, y, r = 0; if (VisionHelper.FitCircle(ImagePt.ToArray(), out x, out y, out r)) { circle.X = x; circle.Y = y; this.BeginInvoke(new Action(() => { this.tDetectX.Text = x.ToString("f3"); this.tDetectY.Text = y.ToString("f3"); })); MessageBox.Show("旋转中心检测成功!!"); } else { MessageBox.Show("拟合圆失败!!"); } }); }