Exemplo n.º 1
0
        private void OnModifyProcessParams()
        {
            DataTable dt = this.dataGridView1.DataSource as DataTable;

            if (dt == null || dt.Rows.Count < 1)
            {
                return;
            }
            foreach (DataRow dr in dt.Rows)
            {
                string           processID = dr["processStepID"].ToString();
                ProcessStepModel process   = processStepBll.GetModel(processID);
                if (process == null)
                {
                    continue;
                }
                float processVal = 0;
                if (!float.TryParse(dr["tag1"].ToString(), out processVal))
                {
                    continue;
                }
                process.tag1 = dr["tag1"].ToString();
                processStepBll.Update(process);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        ///		Procesa un paso
        /// </summary>
        private async Task ProcessStepAsync(ProcessStepModel step)
        {
            IJobStepProcessor processor = Processors[step.PluginKey];

            // Procesa el trabajo
            if (processor == null)
            {
                Context.WriteError("JobManager - Process", $"Can't find the processor for step {step.PluginKey}");
            }
            else
            {
                // Ejecuta el trabajo
                try
                {
                    // Inicializa el procesador
                    processor.Initialize(Context, step);
                    // Procesa
                    await processor.ProcessAsync();
                }
                catch (Exception exception)
                {
                    Context.WriteError("JobManager - Process", exception.Message);
                }
                // Muestra los benchmarks
                ShowBenchmarks(Context.Benchmarks);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        ///		Carga los datos de un paso
        /// </summary>
        private ProcessBaseModel LoadStep(JobModel job, MLNode rootML)
        {
            ProcessStepModel step = new ProcessStepModel(job);

            // Asigna las propiedades básicas
            step.Key       = rootML.Attributes[TagKey].Value;
            step.PluginKey = rootML.Attributes[TagPluginKey].Value;
            step.StartWithPreviousError = rootML.Attributes[TagStartWithPreviousError].Value.GetBool(false);
            step.Name           = rootML.Nodes[TagName].Value;
            step.Description    = rootML.Nodes[TagDescription].Value;
            step.ScriptFileName = rootML.Nodes[TagScript].Value;
            // Carga los datos
            foreach (MLNode nodeML in rootML.Nodes)
            {
                switch (nodeML.Name)
                {
                case TagParameter:
                    LoadParameter(nodeML, step.Parameters);
                    break;
                }
            }
            // Devuelve los datos del paso
            return(step);
        }
Exemplo n.º 4
0
 /// <summary>
 ///		Inicializa el procesador
 /// </summary>
 public void Initialize(Models.Context.JobContextModel context, ProcessStepModel step)
 {
     Context = context;
     Step    = step;
 }
Exemplo n.º 5
0
 /// <summary>
 ///		Actualiza el trabajo y paso actual
 /// </summary>
 public void UpdateJobStep(string processorKey, ProcessStepModel step)
 {
     ActualProcessorKey = processorKey;
     ActualStep         = step;
 }