Example #1
0
 protected override void EstablishContext()
 {
     base.EstablishContext();
     IoDeviceWrapper = new Mock<IIoDeviceWrapper>();
     IoDeviceWrapperFactory = new Mock<IIoDeviceWrapperFactory>();
     IoDeviceWrapperFactory.Setup(f => f.Create()).Returns(IoDeviceWrapper.Object);
     IoDevice = new io_devices
         {
             name = "IoDeviceRunTargetName",
             options = IoDeviceOptions,
             type = string.Format("{0}{1}{2}", IoDeviceFolder, PHmiConstants.PHmiIoDeviceSeparator, IoDeviceFile)
         };
     DigitalTag = new dig_tags
         {
             id = 1,
             device = "M0",
             can_read = true
         };
     IoDevice.dig_tags.Add(DigitalTag);
     WriteOnlyDigitalTag = new dig_tags
         {
             id = 2,
             device = "M1",
             can_read = false
         };
     IoDevice.dig_tags.Add(WriteOnlyDigitalTag);
     NumericTag = new num_tags
         {
             id = 1,
             device = "D0",
             num_tag_types = new num_tag_types {name = "Int32"},
             can_read = true
         };
     IoDevice.num_tags.Add(NumericTag);
     WriteOnlyNumericTag = new num_tags
         {
             id = 2,
             device = "D1",
             num_tag_types = new num_tag_types {name = "Int16"},
             can_read = false
         };
     IoDevice.num_tags.Add(WriteOnlyNumericTag);
     Reporter = new Mock<INotificationReporter>();
     IoDeviceRunTarget = new IoDeviceRunTarget(IoDevice, IoDeviceWrapperFactory.Object, Reporter.Object);
     DigitalTagValue = true;
     NumericTagValue = new Random().Next();
     IoDeviceWrapper
         .Setup(w => w.Read(It.IsAny<ReadParameter[]>()))
         .Returns(new object[] { DigitalTagValue, NumericTagValue });
 }
Example #2
0
 /// <summary>
 /// Create a new dig_tags object.
 /// </summary>
 /// <param name="id">Initial value of the id property.</param>
 /// <param name="name">Initial value of the name property.</param>
 /// <param name="ref_io_devices">Initial value of the ref_io_devices property.</param>
 /// <param name="device">Initial value of the device property.</param>
 /// <param name="can_read">Initial value of the can_read property.</param>
 public static dig_tags Createdig_tags(global::System.Int32 id, global::System.String name, global::System.Int32 ref_io_devices, global::System.String device, global::System.Boolean can_read)
 {
     dig_tags dig_tags = new dig_tags();
     dig_tags.id = id;
     dig_tags.name = name;
     dig_tags.ref_io_devices = ref_io_devices;
     dig_tags.device = device;
     dig_tags.can_read = can_read;
     return dig_tags;
 }
Example #3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the dig_tags EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddTodig_tags(dig_tags dig_tags)
 {
     base.AddObject("dig_tags", dig_tags);
 }