Esempio n. 1
0
		/// <summary>
		/// Loads everything from _fullData (everything until Task)
		/// </summary>
		private void load()
		{
			Model = _fullData.Model;

			RowIndex = Model.StateStation.Station.Index;
			VIndex = _fullData.VIndex;
			StartDateTime = Model.StartDateTime;
			DurationSeconds = Model.DurationSeconds;

			//Product and State
			ProductId = Model.StateStation.State.FPC.Product.Id;
			ProductCode = Model.StateStation.State.FPC.Product.Code;
			ProductName = Model.StateStation.State.FPC.Product.Name;
			ProductColor = Model.StateStation.State.FPC.Product.Color;
			StateCode = Model.StateStation.State.Code;
			IsRework = Model.StateStation.State.IsReworkState == Bool3.True;
			
			//Block background texts
			BlockTargetPoint = Model.BlockTargetPoint;
			BlockProducedG1 = _fullData.ReportData[0];
			CanAddSetupBefore = _fullData.CanAddSetupBefore;
			ReportFillPercent = string.Format("{0:D2}%", _fullData.ReportData[1]);
			IsReportFilled = (_fullData.ReportData[1] >= 100);
			
			//Navigation
			//specify the job (if not null)
			if (Model.Job != null)
			{
				Job = new JobVm(Model.Job);
			}
		}
Esempio n. 2
0
		/// <summary>
		/// Removes all blocks of a job from PPTable and database
		/// </summary>
		/// <param name="job"></param>
		public void RemoveBlocks(JobVm job)
		{
			foreach (var station in PPItems.ToArray())
			{
				foreach (var block in station.Blocks.ToArray())
				{
					//check if this block in this station is part of the given Job
					if (block.Job != null && block.Job.Id == job.Id)
					{
						block.DeleteItemCommand.Execute(null);
					}
				}
			}
		}