public HITView addHIT(string name, HITData data, int jobNumber) { HITView hs; if (name == ShortnJob.HIT_TYPE) { hs = new ShortnView(name, data as ShortnData, jobNumber); } else if (name == CrowdproofJob.HIT_TYPE) { hs = new CrowdproofView(name, data as CrowdproofData, jobNumber); } else if (name == HumanMacroJob.HIT_TYPE) { HumanMacroData hdata = data as HumanMacroData; hs = new HumanMacroView(name, hdata, jobNumber); } else { hs = new HITView(name, data, jobNumber); } jobMap[jobNumber] = data; // Assign the WPF UserControl to the ElementHost control's // Child property. sidebar.addHitView(jobNumber, hs); //host.Child = hs; // Add the ElementHost control to the form's // collection of child controls. //this.Controls.Add(host); return hs; }
/// <summary> /// Add a stage to this container /// </summary> /// <param name="stageNum"></param> /// <param name="type"></param> /// <param name="stageType"></param> /// <param name="totalTurkers"></param> /// <param name="totalCost"></param> public void addStage(int stageNum, HITData.ResultType type, StageData sdata, string stageType, int totalTurkers, double totalCost, int job) { StageData stagedata = sdata; StageView newStage = new StageView(stageNum, type, stagedata, stageType, totalTurkers, totalCost, job); stages.Children.Insert(stages.Children.IndexOf(cancelBtn), newStage); stageList[type] = newStage; //stageList.Add(newStage); }
/// <summary> /// The view for a task in the sidebar /// </summary> /// <param name="workType">Job type</param> /// <param name="data">Data Model for this View</param> public HITViewStub(string workType, HITData data, HITView view) { InitializeComponent(); hitType.Content = workType; this.view = view; this.data = data; //data.register(this); previewText.Text = data.originalText; stageList = new Dictionary<HITData.ResultType,StageView>(); }
public StageView(int stageNum, HITData.ResultType type, StageData stagedata, string stageType, int totalTurkers, double totalCost, int job) { InitializeComponent(); this.stagedata = stagedata; this.type = type; this.totalTurkers = totalTurkers; this.totalCost = totalCost; stagedata.registerListener(this); stageName.Content = String.Format("Stage {0}: {1:c}", stageNum, stageType); updateProgress(0, 0); this.job = job; }
/// <summary> /// The view for a task in the sidebar /// </summary> /// <param name="workType">Job type</param> /// <param name="data">Data Model for this View</param> public HITView(string workType, HITData data, int job) { InitializeComponent(); hitType.Content = workType; this.data = data; data.register(this); previewText.Text = data.originalText; stageList = new Dictionary<HITData.ResultType,StageView>(); stub = new HITViewStub(workType, data, this); this.job = job; cancelBtn.IsEnabled = true; }
public StageData(HITData.ResultType type, int job) { this.type = type; this.job = job; }
/// <summary> /// Represents the data from a specific stage in a job. For example: the Find, Fix, or Verify stage. /// </summary> /// <param name="type">The type of the stage. For example, Find, Fix, or Verify</param> /// <param name="numParagraphs">The number of paragraphs in this job</param> public StageData(HITData.ResultType type, int numParagraphs, int job) { this.type = type; this.FixParagraphNumber(numParagraphs); this.job = job; }
public HITView addHITtoList(string name, HITData data, int jobNumber) { HITView hs; if (name == ShortnJob.HIT_TYPE) { hs = new ShortnView(name, data as ShortnData, jobNumber); } else if (name == CrowdproofJob.HIT_TYPE) { hs = new CrowdproofView(name, data as CrowdproofData, jobNumber); } else if (name == HumanMacroJob.HIT_TYPE) { HumanMacroData hdata = data as HumanMacroData; hs = new HumanMacroView(name, hdata, jobNumber); } else { hs = new HITView(name, data, jobNumber); } jobMap[jobNumber] = data; return hs; }
/// <summary> /// Creates a TurKit job for the selected task. /// </summary> /// <param name="hdata">The HITData representing the desired job</param> public TurKit(HITData hdata) { this.hdata = hdata; }