Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
        public void OnStreamConnected(DataStream stream)
        {
            ThreadHelper.UI_Invoke(this, null, TestConfigTab.UITestDeviceSelect, (data) =>
            {
                TestConfigTab.AddDeviceToList(stream);

                if (stream == Program.serial)
                {
                    if (comSettings != null)
                    {
                        comSettings.Close();
                    }
                }
            }, null);
        }
Ejemplo n.º 3
0
        private void ReceiveSensorList(object _sensor_list, string attribute, string label)
        {
            Debug.Log("Receive sensor list " + attribute);
            JObject sensor_list = (JObject)_sensor_list;

            ThreadHelper.UI_Invoke(this, null, UISensorCheckboxList, (data) =>
            {
                autoObservableValues = new ObservableNumericValueCollection();
                foreach (var elem in (JObject)data["sensor_list"])
                {
                    if (!sensor_information.ContainsKey(elem.Key))
                    {
                        //string sensor_name = label + ": " + elem.Key;
                        string sensor_name = elem.Key;

                        sensor_information.Add(sensor_name, elem.Value.ToString());

                        UISensorCheckboxList.Items.Add(sensor_name);

                        if (DataReceiver.Observe)
                        {
                            AddParameterControlRow(new ObservedDataRow
                            {
                                name  = elem.Key,
                                value = ""
                            }
                                                   );

                            IObservableNumericValue o = autoObservableValues.AddWithType(elem.Key, elem.Value.ToString());
                            o.OnUpdate(ObservedValueChanged);
                        }
                    }
                }
                if (autoObservableValues.Count > 0)
                {
                    autoParamControlTemplate.SetCollection(autoObservableValues);
                    DataReceiver.SetObservableNumericValues(autoObservableValues);
                }
            }, new Hashtable {
                { "form", this },
                { "panel", null },
                { "control", UISensorCheckboxList },
                { "sensor_list", sensor_list }
            });
        }
Ejemplo n.º 4
0
        public void ReceiveInstructionList(object payload, string attribute, string label)
        {
            ThreadHelper.UI_Invoke(this, null, TestConfigTab.UITestConfigInstructionParameterGrid, (Hashtable d) =>
            {
                instruction_list = (JObject)payload;

                foreach (KeyValuePair <string, JToken> instruction in instruction_list)
                {
                    InstructionUIEntry entry = new InstructionUIEntry
                    {
                        label      = instruction.Key,
                        parameters = instruction.Value as JObject
                    };
                    TestConfigTab.AddInstructionUIEntry(entry);
                }
            },
                                   null);
        }
Ejemplo n.º 5
0
        public void OnStreamDisconnected(DataStream stream)
        {
            if (isClosing)
            {
                return;
            }
            ThreadHelper.UI_Invoke(this, null, TestConfigTab.UITestDeviceSelect, (data) =>
            {
                TestConfigTab.RemoveDeviceFromList(stream);

                if (stream == Program.serial)
                {
                    SetCOMConnectionStatus("Serial disconnected");
                }

                if (stream == Program.socketHandler)
                {
                    SetNetworkConnectionStatus("Network disconnected");
                }
            }, null);
        }