Exemplo n.º 1
0
        private void btnRunConformance_Click(object sender, EventArgs e)
        {
            if (ApplicationState.Idle != StateManager.GetState())
            {
                return;
            }

            if (ConversationList.IsEmpty)
            {
                DialogHelper.ShowError(Resources.Message_Diagnostics_ConversationList_Empty);
                return;
            }

            var devices = UnitSet.GetDevices();

            if (devices.Any(item => !item.IsFeatureListAttached))
            {
                var result = DialogHelper.ShowWarning(Resources.Message_Diagnostics_FeatureList_NotAttached);

                if (DialogResult.Cancel == result)
                {
                    return;
                }
            }

            Clear();
            RunTests();
        }
Exemplo n.º 2
0
 private void RemoveDeviceSpecificCommands()
 {
     if (UnitSet.GetDevices().Contains(mClient))
     {
         mRequestResponseList.RemoveAll(item => mDeviceSpecificCommands.Contains(item.Request.GetDetails()));
     }
 }
Exemplo n.º 3
0
        protected void AddDevicesList(XElement doc)
        {
            String headerId = GetIdWithPostfix(ID_DEVICE_TABLE, 1);

            var deviceTableHeaderTemplate = XmlUtil.GetElementById(doc, headerId);
            var deviceTableTemplate       = deviceTableHeaderTemplate.NextNode as XElement;

            XElement lastElement = deviceTableTemplate;

            if (null == deviceTableTemplate)
            {
                throw new XmlException("device table does not exist");
            }

            var devices = UnitSet.GetDevices();
            int count   = 3 > devices.Count ? 3 : devices.Count;

            for (int i = 1; i < count; ++i)
            {
                var newHeader = new XElement(deviceTableHeaderTemplate);
                var newTable  = new XElement(deviceTableTemplate);

                ProcessDeviceHeader(newHeader, i + 1);
                ProcessDeviceTable(newTable, i + 1);

                lastElement.AddAfterSelf(newHeader);
                newHeader.AddAfterSelf(newTable);

                lastElement = newTable;
            }
        }
        private static void WriteDevicesList(XmlWriter writer) // TODO remove ???
        {
            writer.WriteStartElement("DeviceUsed");


            foreach (var device in UnitSet.GetDevices())
            {
                writer.WriteStartElement("DeviceInformation");
                writer.WriteElementString("MemberName", device.Manufacturer);
                writer.WriteElementString("ProductName", device.Name);
                writer.WriteElementString("FirmwareVersion", device.FirmwareVersion);

                writer.WriteStartElement("DeviceSupportedProfile");
                for (int i = 0; i < 3; i++)
                {
                    writer.WriteElementString("Profile", String.Empty);
                }
                writer.WriteEndElement();

                writer.WriteEndElement();
            }

            writer.WriteEndElement();
            writer.WriteEndElement();
        }
Exemplo n.º 5
0
        protected void FillDevicesList(XElement doc)
        {
            var devices = UnitSet.GetDevices();

            for (int i = 0; i < devices.Count; ++i)
            {
                var device       = devices[i];
                int deviceNumber = i + 1;

                ReplaceElementValue(doc, GetIdWithPostfix(ID_DEVICE_PRODUCT, deviceNumber), device.GetConformanceName());
                ReplaceElementValue(doc, GetIdWithPostfix(ID_DEVICE_MEMBER, deviceNumber), device.Info.Manufacturer ?? String.Empty);
                ReplaceElementValue(doc, GetIdWithPostfix(ID_DEVICE_FIRMWARE, deviceNumber), device.Info.FirmwareVersion ?? String.Empty);
                ReplaceElementValue(doc, GetIdWithPostfix(ID_DEVICE_PROFILE, deviceNumber), String.Join(", ", device.GetSupportedProfiles()));
            }
        }
Exemplo n.º 6
0
        private void WriteDevicesList(XmlWriter writer) // TODO remove ???
        {
            writer.WriteStartElement("DeviceUsed");

            foreach (var device in UnitSet.GetDevices())
            {
                writer.WriteStartElement("DeviceInformation");
                writer.WriteElementString("MemberName", device.Info.Manufacturer);
                writer.WriteElementString("ProductName", device.GetConformanceName());
                writer.WriteElementString("FirmwareVersion", device.Info.FirmwareVersion);

                WriteDeviceSupportedProfiles(device, writer);

                writer.WriteEndElement();
            }

            writer.WriteEndElement();
        }
Exemplo n.º 7
0
        private void Check()
        {
            ConformanceLog.Instance.Clear();

            foreach (Profile profile in Enum.GetValues(typeof(Profile)))
            {
                var devices = UnitSet.GetDevices(profile);

                bool isProfileSupported = profile.IsSupported();
                if (!isProfileSupported && !devices.Any())
                {
                    ConformanceLog.Instance.AddWarning(profile, "0 devices found");
                    continue;
                }

                Check3Devices(profile, devices);

                if (isProfileSupported && !devices.Any())
                {
                    ConformanceLog.Instance.AddError(profile, "At least one Device Feature List is missing");
                }

                if (Profile.C == profile)
                {
                    if (FeatureStatus.Undefined == Feature.EventHandling.GetInfo().Status)
                    {
                        ConformanceLog.Instance.AddError(profile, "At least one Event Handling Feature Required");
                    }
                }

                CheckMandatoryTests(profile);
                CheckConditionalTests(profile);

                foreach (var device in devices)
                {
                    CheckDeviceSpecificTests(profile, device);
                }
            }
        }