Esempio n. 1
0
        private ModelElement GenerateAddingDevice(AceModelRestricted model)
        {
            var intfc = model.FindElementByVisaName(Consts.DEFAULT_INTFC_VISANAME) as ModelInterfaceSample;

            if (intfc == null)
            {
                intfc = new ModelInterfaceSample();
                intfc.VisaInterfaceId = Consts.DEFAULT_INTFC_VISANAME;
            }
            var device = new ModelDeviceSample();

            device.Parent            = intfc;
            device.ParentId          = intfc.PersistentId;
            device.StaticallyDefined = true;
            return(device);
        }
Esempio n. 2
0
        private ModelElement GetEditintElement(string deviceName, AceModelRestricted model)
        {
            string visa = string.Empty;

            if (deviceName.StartsWith(Consts.SAMPLE_INSTRUMENT, StringComparison.InvariantCultureIgnoreCase))
            {
                visa = GetEditingDeviceVisaName(deviceName);
            }
            else if (deviceName.StartsWith(Consts.SAMPLE_INTERFACE, StringComparison.InvariantCultureIgnoreCase))
            {
                visa = GetEditingInterfaceVisaName(deviceName);
            }
            var element = model.FindElementByVisaName(visa);

            return(element);
        }
 private ModelElement GetEditintElement(string deviceName, AceModelRestricted model)
 {
     string visa = string.Empty;
     if (deviceName.StartsWith(Consts.SAMPLE_INSTRUMENT, StringComparison.InvariantCultureIgnoreCase))
     {
         visa = GetEditingDeviceVisaName(deviceName);
     }
     else if (deviceName.StartsWith(Consts.SAMPLE_INTERFACE, StringComparison.InvariantCultureIgnoreCase))
     {
         visa = GetEditingInterfaceVisaName(deviceName);
     }
     var element = model.FindElementByVisaName(visa);
     return element;
 }
 private ModelElement GenerateAddingDevice(AceModelRestricted model)
 {
     var intfc = model.FindElementByVisaName(Consts.DEFAULT_INTFC_VISANAME) as ModelInterfaceSample;
     if (intfc == null)
     {
         intfc = new ModelInterfaceSample();
         intfc.VisaInterfaceId = Consts.DEFAULT_INTFC_VISANAME;
     }
     var device = new ModelDeviceSample();
     device.Parent = intfc;
     device.ParentId = intfc.PersistentId;
     device.StaticallyDefined = true;
     return device;
 }