Exemple #1
0
        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;
        }
Exemple #2
0
 /// <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>();
        }
Exemple #4
0
        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;
        }
Exemple #5
0
        /// <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;
        }
Exemple #6
0
 public StageData(HITData.ResultType type, int job)
 {
     this.type = type;
     this.job = job;
 }
Exemple #7
0
 /// <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;
 }
Exemple #8
0
        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;
        }
Exemple #9
0
 /// <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;
 }