Пример #1
0
        private void OnTestQueueComplete(InstructionEntry instructionEntry)
        {
            ThreadHelper.UI_Invoke(Program.app, null, UITestConfigIntructionListGrid, (data) =>
            {
                Instruction instruction = instructionEntry.instruction;
                UITestConfigIntructionListGrid.Rows[last_instruction_index].Cells[2].Value = "Finished";
                UITestConfigIntructionListGrid.Rows[last_instruction_index].Cells[3].Value = instruction.feedbackStatus.ToString();

                UITestConfigParameterTemplateSelect.Enabled = true;
            }, null);
        }
Пример #2
0
        public InstructionEntry AddInstructionEntry(Instruction instr, List <string> observedLabels, int uindex = -1)
        {
            instr._ui_index = uindex;

            InstructionEntry entry = new InstructionEntry
            {
                instruction         = instr,
                observedValueLabels = observedLabels
            };

            instructionEntries.Add(entry);

            return(entry);
        }
Пример #3
0
        private void OnTestQueueAdvance(InstructionEntry instructionEntry)
        {
            UITestConfigIntructionListGrid.ClearSelection();
            Instruction instruction = instructionEntry.instruction;

            //int index = instructionEntry.instruction._ui_index; //
            int index = activeTestConfiguration.InstructionEntryIndex(instructionEntry);

            if (last_instruction_index > -1)
            {
                UITestConfigIntructionListGrid.Rows[last_instruction_index].Cells[2].Value = "Finished ";
                UITestConfigIntructionListGrid.Rows[last_instruction_index].Cells[3].Value = instruction.feedbackStatus.ToString();
            }

            if (index > -1)
            {
                UITestConfigIntructionListGrid.Rows[index].Cells[2].Value = "Running ";
                UITestConfigIntructionListGrid.Rows[index].Selected       = true;
                last_instruction_index = index;
            }
        }
Пример #4
0
        /// <summary>
        /// Run the next instruction in the queue if the queue is not empty. Also invokes the callback functions at the right time, if they are set
        /// </summary>
        /// <param name="stream">The stream the instruction should be sent to</param>
        public void RunQueuedInstruction(DataStream stream)
        {
            if (currentInstructionEntry.instruction != null)
            {
                // Complete current instruction if there is one, and if there is something to do before executing next instruction
            }

            if (instructionEntryQueue.Count > 0)
            {
                queue_position++;
                currentInstructionEntry = instructionEntryQueue.Dequeue();

                if (onQueueAdvanceCallback != null)
                {
                    if (currentInstructionEntry.instruction.feedbackStatus == ObservableNumericValueStatus.Unknown)
                    {
                        currentInstructionEntry.instruction.feedbackStatus = ObservableNumericValueStatus.Stable;
                    }
                    onQueueAdvanceCallback.Invoke(currentInstructionEntry);
                }

                stream.Output(currentInstructionEntry.instruction.toJObject());
            }
            else
            {
                queue_position           = -1;
                internalReceiver.Observe = false;
                is_running = false;

                if (onQueueCompleteCallback != null)
                {
                    onQueueCompleteCallback.Invoke(currentInstructionEntry);
                }
                Debug.Log("Instruction queue is empty");
                // Queue is empty
            }
        }
Пример #5
0
 public void AddInstructionEntry(InstructionEntry entry)
 {
     instructionEntries.Add(entry);
 }
Пример #6
0
 public int InstructionEntryIndex(InstructionEntry entry)
 {
     return(instructionEntries.IndexOf(entry));
 }