2014-04-03 07:13:15 +08:00
|
|
|
|
using NTwain.Data;
|
2014-04-21 08:45:08 +08:00
|
|
|
|
using System;
|
2014-04-03 07:01:21 +08:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
2014-05-20 08:48:21 +08:00
|
|
|
|
using System.Text;
|
2014-04-03 07:01:21 +08:00
|
|
|
|
|
|
|
|
|
namespace NTwain
|
|
|
|
|
{
|
2014-09-25 09:52:28 +08:00
|
|
|
|
// This contains all cap-related methods prefixed with Cap.
|
|
|
|
|
// It will attempt to have all known cap abilities defined
|
|
|
|
|
// with a wrapper unless it can only exist as part of another cap
|
|
|
|
|
// or it's lame & nobody uses it.
|
2014-09-12 09:14:41 +08:00
|
|
|
|
|
|
|
|
|
|
2014-09-18 18:46:01 +08:00
|
|
|
|
partial class DataSource : ICapControl
|
2014-04-03 07:01:21 +08:00
|
|
|
|
{
|
2014-09-17 19:33:52 +08:00
|
|
|
|
#region low-level cap stuff
|
|
|
|
|
|
2014-04-21 10:24:05 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the actual supported operations for a capability.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="capId">The cap identifier.</param>
|
|
|
|
|
/// <returns></returns>
|
2014-09-15 19:24:13 +08:00
|
|
|
|
public QuerySupports CapQuerySupport(CapabilityId capId)
|
2014-04-21 10:24:05 +08:00
|
|
|
|
{
|
2014-09-15 19:24:13 +08:00
|
|
|
|
QuerySupports retVal = QuerySupports.None;
|
2014-04-21 10:24:05 +08:00
|
|
|
|
using (TWCapability cap = new TWCapability(capId))
|
|
|
|
|
{
|
2014-09-03 07:10:35 +08:00
|
|
|
|
var rc = _session.DGControl.Capability.QuerySupport(cap);
|
2014-04-21 10:24:05 +08:00
|
|
|
|
if (rc == ReturnCode.Success)
|
|
|
|
|
{
|
2014-05-23 09:29:22 +08:00
|
|
|
|
var read = CapabilityReader.ReadValue(cap);
|
2014-04-21 10:24:05 +08:00
|
|
|
|
|
|
|
|
|
if (read.ContainerType == ContainerType.OneValue)
|
|
|
|
|
{
|
2014-09-15 19:24:13 +08:00
|
|
|
|
retVal = read.OneValue.ConvertToEnum<QuerySupports>();
|
2014-04-21 10:24:05 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return retVal;
|
|
|
|
|
}
|
|
|
|
|
|
2014-04-03 07:01:21 +08:00
|
|
|
|
/// <summary>
|
2014-04-10 09:30:07 +08:00
|
|
|
|
/// Gets the current value for a capability.
|
2014-04-03 07:01:21 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="capId">The cap id.</param>
|
|
|
|
|
/// <returns></returns>
|
2014-05-20 09:26:44 +08:00
|
|
|
|
public object CapGetCurrent(CapabilityId capId)
|
2014-04-03 07:01:21 +08:00
|
|
|
|
{
|
|
|
|
|
using (TWCapability cap = new TWCapability(capId))
|
|
|
|
|
{
|
2014-09-03 07:10:35 +08:00
|
|
|
|
var rc = _session.DGControl.Capability.GetCurrent(cap);
|
2014-04-03 07:01:21 +08:00
|
|
|
|
if (rc == ReturnCode.Success)
|
|
|
|
|
{
|
2014-05-23 09:29:22 +08:00
|
|
|
|
var read = CapabilityReader.ReadValue(cap);
|
2014-04-10 09:30:07 +08:00
|
|
|
|
|
|
|
|
|
switch (read.ContainerType)
|
2014-04-03 07:01:21 +08:00
|
|
|
|
{
|
|
|
|
|
case ContainerType.Enum:
|
2014-09-17 19:33:52 +08:00
|
|
|
|
if (read.CollectionValues != null && read.CollectionValues.Count > read.EnumCurrentIndex)
|
2014-04-03 07:01:21 +08:00
|
|
|
|
{
|
2014-04-10 09:30:07 +08:00
|
|
|
|
return read.CollectionValues[read.EnumCurrentIndex];
|
2014-04-03 07:01:21 +08:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case ContainerType.OneValue:
|
2014-04-10 09:30:07 +08:00
|
|
|
|
return read.OneValue;
|
2014-04-03 07:01:21 +08:00
|
|
|
|
case ContainerType.Range:
|
2014-04-10 09:30:07 +08:00
|
|
|
|
return read.RangeCurrentValue;
|
|
|
|
|
case ContainerType.Array:
|
|
|
|
|
// no source should ever return an array but anyway
|
|
|
|
|
if (read.CollectionValues != null)
|
2014-04-03 07:01:21 +08:00
|
|
|
|
{
|
2014-04-10 09:30:07 +08:00
|
|
|
|
return read.CollectionValues.FirstOrDefault();
|
2014-04-03 07:01:21 +08:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2014-04-10 09:30:07 +08:00
|
|
|
|
return null;
|
2014-04-03 07:01:21 +08:00
|
|
|
|
}
|
|
|
|
|
|
2014-09-17 19:33:52 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the default value for a capability.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="capId">The cap id.</param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public object CapGetDefault(CapabilityId capId)
|
|
|
|
|
{
|
|
|
|
|
using (TWCapability cap = new TWCapability(capId))
|
|
|
|
|
{
|
|
|
|
|
var rc = _session.DGControl.Capability.GetDefault(cap);
|
|
|
|
|
if (rc == ReturnCode.Success)
|
|
|
|
|
{
|
|
|
|
|
var read = CapabilityReader.ReadValue(cap);
|
|
|
|
|
|
|
|
|
|
switch (read.ContainerType)
|
|
|
|
|
{
|
|
|
|
|
case ContainerType.Enum:
|
|
|
|
|
if (read.CollectionValues != null && read.CollectionValues.Count > read.EnumDefaultIndex)
|
|
|
|
|
{
|
|
|
|
|
return read.CollectionValues[read.EnumDefaultIndex];
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case ContainerType.OneValue:
|
|
|
|
|
return read.OneValue;
|
|
|
|
|
case ContainerType.Range:
|
|
|
|
|
return read.RangeDefaultValue;
|
|
|
|
|
case ContainerType.Array:
|
|
|
|
|
// no source should ever return an array but anyway
|
|
|
|
|
if (read.CollectionValues != null)
|
|
|
|
|
{
|
|
|
|
|
return read.CollectionValues.FirstOrDefault();
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
2014-04-03 07:01:21 +08:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
2014-09-15 19:24:13 +08:00
|
|
|
|
/// A general method that tries to get capability values from current <see cref="DataSource" />.
|
2014-04-03 07:01:21 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="capabilityId">The capability unique identifier.</param>
|
|
|
|
|
/// <returns></returns>
|
2014-09-17 19:33:52 +08:00
|
|
|
|
public IList<object> CapGet(CapabilityId capabilityId)
|
2014-04-03 07:01:21 +08:00
|
|
|
|
{
|
2014-04-10 09:30:07 +08:00
|
|
|
|
var list = new List<object>();
|
2014-04-03 07:01:21 +08:00
|
|
|
|
using (TWCapability cap = new TWCapability(capabilityId))
|
|
|
|
|
{
|
2014-09-03 07:10:35 +08:00
|
|
|
|
var rc = _session.DGControl.Capability.Get(cap);
|
2014-04-03 07:01:21 +08:00
|
|
|
|
if (rc == ReturnCode.Success)
|
|
|
|
|
{
|
2014-04-10 09:30:07 +08:00
|
|
|
|
cap.ReadMultiCapValues(list);
|
2014-04-03 07:01:21 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2014-09-17 19:33:52 +08:00
|
|
|
|
/// Resets all values and constraint to power-on defaults.
|
2014-04-03 07:01:21 +08:00
|
|
|
|
/// </summary>
|
2014-09-17 19:33:52 +08:00
|
|
|
|
/// <param name="capabilityId">The capability identifier.</param>
|
2014-04-03 07:01:21 +08:00
|
|
|
|
/// <returns></returns>
|
2014-09-18 08:15:05 +08:00
|
|
|
|
public ReturnCode CapResetAll(CapabilityId capabilityId)
|
2014-04-03 07:01:21 +08:00
|
|
|
|
{
|
2014-09-17 19:33:52 +08:00
|
|
|
|
using (TWCapability cap = new TWCapability(capabilityId)
|
|
|
|
|
{
|
|
|
|
|
ContainerType = ContainerType.DoNotCare
|
|
|
|
|
})
|
|
|
|
|
{
|
|
|
|
|
var rc = DGControl.Capability.ResetAll(cap);
|
|
|
|
|
return rc;
|
|
|
|
|
}
|
2014-04-03 07:01:21 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2014-09-17 19:33:52 +08:00
|
|
|
|
/// Resets the current value to power-on default.
|
2014-04-03 07:01:21 +08:00
|
|
|
|
/// </summary>
|
2014-09-17 19:33:52 +08:00
|
|
|
|
/// <param name="capabilityId">The capability identifier.</param>
|
2014-04-03 07:01:21 +08:00
|
|
|
|
/// <returns></returns>
|
2014-09-18 08:15:05 +08:00
|
|
|
|
public ReturnCode CapReset(CapabilityId capabilityId)
|
2014-04-03 07:01:21 +08:00
|
|
|
|
{
|
2014-09-17 19:33:52 +08:00
|
|
|
|
using (TWCapability cap = new TWCapability(capabilityId)
|
|
|
|
|
{
|
|
|
|
|
ContainerType = ContainerType.DoNotCare
|
|
|
|
|
})
|
2014-04-03 07:01:21 +08:00
|
|
|
|
{
|
2014-09-17 19:33:52 +08:00
|
|
|
|
var rc = DGControl.Capability.Reset(cap);
|
|
|
|
|
return rc;
|
2014-04-03 07:01:21 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
2014-09-18 18:46:01 +08:00
|
|
|
|
#region high-level caps stuff
|
2014-04-03 07:01:21 +08:00
|
|
|
|
|
2014-09-17 20:07:00 +08:00
|
|
|
|
#region audio caps
|
|
|
|
|
|
2014-09-18 18:46:01 +08:00
|
|
|
|
private CapWrapper<XferMech> _audXferMech;
|
2014-04-03 07:01:21 +08:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
2014-09-17 20:07:00 +08:00
|
|
|
|
/// Gets the property to work with audio <see cref="XferMech"/> for the current source.
|
2014-04-03 07:01:21 +08:00
|
|
|
|
/// </summary>
|
2014-09-17 19:33:52 +08:00
|
|
|
|
/// <value>
|
2014-09-17 20:07:00 +08:00
|
|
|
|
/// The audio xfer mech.
|
2014-09-17 19:33:52 +08:00
|
|
|
|
/// </value>
|
2014-09-18 18:46:01 +08:00
|
|
|
|
public CapWrapper<XferMech> CapAudioXferMech
|
2014-04-03 07:01:21 +08:00
|
|
|
|
{
|
2014-09-17 19:33:52 +08:00
|
|
|
|
get
|
2014-04-03 07:01:21 +08:00
|
|
|
|
{
|
2014-09-18 18:46:01 +08:00
|
|
|
|
return _audXferMech ?? (_audXferMech = new CapWrapper<XferMech>(this, CapabilityId.ACapXferMech, ValueExtensions.ConvertToEnum<XferMech>,
|
2014-09-17 20:07:00 +08:00
|
|
|
|
value => new TWCapability(CapabilityId.ACapXferMech, new TWOneValue
|
2014-09-17 19:33:52 +08:00
|
|
|
|
{
|
|
|
|
|
Item = (uint)value,
|
|
|
|
|
ItemType = ItemType.UInt16
|
2014-09-18 18:46:01 +08:00
|
|
|
|
})));
|
2014-04-03 07:01:21 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-09-17 20:07:00 +08:00
|
|
|
|
#endregion
|
2014-04-03 07:01:21 +08:00
|
|
|
|
|
2014-09-17 20:07:00 +08:00
|
|
|
|
#region img caps
|
|
|
|
|
|
2014-09-25 09:52:28 +08:00
|
|
|
|
private CapWrapper<Unit> _imgUnits;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the property to work with image <see cref="Unit"/> for the current source.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>
|
|
|
|
|
/// The image unit of measure.
|
|
|
|
|
/// </value>
|
|
|
|
|
public CapWrapper<Unit> CapImageUnits
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _imgUnits ?? (_imgUnits = new CapWrapper<Unit>(this, CapabilityId.ICapUnits, ValueExtensions.ConvertToEnum<Unit>,
|
|
|
|
|
value => new TWCapability(CapabilityId.ICapUnits, new TWOneValue
|
|
|
|
|
{
|
|
|
|
|
Item = (uint)value,
|
|
|
|
|
ItemType = ItemType.UInt16
|
|
|
|
|
})));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-09-18 18:46:01 +08:00
|
|
|
|
private CapWrapper<XferMech> _imgXferMech;
|
2014-04-03 07:01:21 +08:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
2014-09-17 20:07:00 +08:00
|
|
|
|
/// Gets the property to work with image <see cref="XferMech"/> for the current source.
|
2014-04-03 07:01:21 +08:00
|
|
|
|
/// </summary>
|
2014-09-17 19:33:52 +08:00
|
|
|
|
/// <value>
|
2014-09-17 20:07:00 +08:00
|
|
|
|
/// The image xfer mech.
|
2014-09-17 19:33:52 +08:00
|
|
|
|
/// </value>
|
2014-09-18 18:46:01 +08:00
|
|
|
|
public CapWrapper<XferMech> CapImageXferMech
|
2014-04-03 07:01:21 +08:00
|
|
|
|
{
|
2014-09-17 19:33:52 +08:00
|
|
|
|
get
|
|
|
|
|
{
|
2014-09-18 18:46:01 +08:00
|
|
|
|
return _imgXferMech ?? (_imgXferMech = new CapWrapper<XferMech>(this, CapabilityId.ICapXferMech, ValueExtensions.ConvertToEnum<XferMech>,
|
2014-09-17 20:07:00 +08:00
|
|
|
|
value => new TWCapability(CapabilityId.ICapXferMech, new TWOneValue
|
2014-09-17 19:33:52 +08:00
|
|
|
|
{
|
|
|
|
|
Item = (uint)value,
|
|
|
|
|
ItemType = ItemType.UInt16
|
2014-09-18 18:46:01 +08:00
|
|
|
|
})));
|
2014-09-17 19:33:52 +08:00
|
|
|
|
}
|
2014-04-03 07:01:21 +08:00
|
|
|
|
}
|
|
|
|
|
|
2014-09-17 19:33:52 +08:00
|
|
|
|
|
2014-09-18 18:46:01 +08:00
|
|
|
|
private CapWrapper<CompressionType> _compression;
|
2014-09-17 19:33:52 +08:00
|
|
|
|
|
2014-04-03 07:01:21 +08:00
|
|
|
|
/// <summary>
|
2014-09-17 19:33:52 +08:00
|
|
|
|
/// Gets the property to work with image <see cref="CompressionType"/> for the current source.
|
2014-04-03 07:01:21 +08:00
|
|
|
|
/// </summary>
|
2014-09-17 19:33:52 +08:00
|
|
|
|
/// <value>
|
|
|
|
|
/// The image compression.
|
|
|
|
|
/// </value>
|
2014-09-18 18:46:01 +08:00
|
|
|
|
public CapWrapper<CompressionType> CapImageCompression
|
2014-04-03 07:01:21 +08:00
|
|
|
|
{
|
2014-09-17 19:33:52 +08:00
|
|
|
|
get
|
2014-04-03 07:01:21 +08:00
|
|
|
|
{
|
2014-09-18 18:46:01 +08:00
|
|
|
|
return _compression ?? (_compression = new CapWrapper<CompressionType>(this, CapabilityId.ICapCompression, ValueExtensions.ConvertToEnum<CompressionType>,
|
2014-09-17 19:33:52 +08:00
|
|
|
|
value => new TWCapability(CapabilityId.ICapCompression, new TWOneValue
|
|
|
|
|
{
|
|
|
|
|
Item = (uint)value,
|
|
|
|
|
ItemType = ItemType.UInt16
|
2014-09-18 18:46:01 +08:00
|
|
|
|
})));
|
2014-04-03 07:01:21 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2014-09-18 18:46:01 +08:00
|
|
|
|
private CapWrapper<FileFormat> _fileFormat;
|
2014-04-08 07:46:03 +08:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
2014-09-17 19:33:52 +08:00
|
|
|
|
/// Gets the property to work with image <see cref="FileFormat"/> for the current source.
|
2014-04-08 07:46:03 +08:00
|
|
|
|
/// </summary>
|
2014-09-17 19:33:52 +08:00
|
|
|
|
/// <value>
|
|
|
|
|
/// The image file format.
|
|
|
|
|
/// </value>
|
2014-09-18 18:46:01 +08:00
|
|
|
|
public CapWrapper<FileFormat> CapImageFileFormat
|
2014-04-08 07:46:03 +08:00
|
|
|
|
{
|
2014-09-17 19:33:52 +08:00
|
|
|
|
get
|
|
|
|
|
{
|
2014-09-18 18:46:01 +08:00
|
|
|
|
return _fileFormat ?? (_fileFormat = new CapWrapper<FileFormat>(this, CapabilityId.ICapImageFileFormat, ValueExtensions.ConvertToEnum<FileFormat>,
|
2014-09-17 19:33:52 +08:00
|
|
|
|
value => new TWCapability(CapabilityId.ICapImageFileFormat, new TWOneValue
|
|
|
|
|
{
|
|
|
|
|
Item = (uint)value,
|
|
|
|
|
ItemType = ItemType.UInt16
|
2014-09-18 18:46:01 +08:00
|
|
|
|
})));
|
2014-09-17 19:33:52 +08:00
|
|
|
|
}
|
2014-04-08 07:46:03 +08:00
|
|
|
|
}
|
|
|
|
|
|
2014-09-17 19:33:52 +08:00
|
|
|
|
|
2014-09-18 18:46:01 +08:00
|
|
|
|
private CapWrapper<PixelType> _pixelType;
|
2014-09-17 19:33:52 +08:00
|
|
|
|
|
2014-04-08 07:46:03 +08:00
|
|
|
|
/// <summary>
|
2014-09-17 19:33:52 +08:00
|
|
|
|
/// Gets the property to work with image <see cref="PixelType"/> for the current source.
|
2014-04-08 07:46:03 +08:00
|
|
|
|
/// </summary>
|
2014-09-17 19:33:52 +08:00
|
|
|
|
/// <value>
|
|
|
|
|
/// The image pixel type.
|
|
|
|
|
/// </value>
|
2014-09-18 18:46:01 +08:00
|
|
|
|
public CapWrapper<PixelType> CapImagePixelType
|
2014-04-08 07:46:03 +08:00
|
|
|
|
{
|
2014-09-17 19:33:52 +08:00
|
|
|
|
get
|
|
|
|
|
{
|
2014-09-18 18:46:01 +08:00
|
|
|
|
return _pixelType ?? (_pixelType = new CapWrapper<PixelType>(this, CapabilityId.ICapPixelType, ValueExtensions.ConvertToEnum<PixelType>,
|
2014-09-17 19:33:52 +08:00
|
|
|
|
value => new TWCapability(CapabilityId.ICapPixelType, new TWOneValue
|
|
|
|
|
{
|
|
|
|
|
Item = (uint)value,
|
|
|
|
|
ItemType = ItemType.UInt16
|
2014-09-18 18:46:01 +08:00
|
|
|
|
})));
|
2014-09-17 19:33:52 +08:00
|
|
|
|
}
|
2014-04-08 07:46:03 +08:00
|
|
|
|
}
|
|
|
|
|
|
2014-09-17 19:33:52 +08:00
|
|
|
|
|
2014-09-18 18:46:01 +08:00
|
|
|
|
private CapWrapper<SupportedSize> _supportSize;
|
2014-09-17 19:33:52 +08:00
|
|
|
|
|
2014-04-08 07:46:03 +08:00
|
|
|
|
/// <summary>
|
2014-09-17 19:33:52 +08:00
|
|
|
|
/// Gets the property to work with image <see cref="SupportedSize"/> for the current source.
|
2014-04-08 07:46:03 +08:00
|
|
|
|
/// </summary>
|
2014-09-17 19:33:52 +08:00
|
|
|
|
/// <value>
|
|
|
|
|
/// The image supported size.
|
|
|
|
|
/// </value>
|
2014-09-18 18:46:01 +08:00
|
|
|
|
public CapWrapper<SupportedSize> CapImageSupportedSize
|
2014-04-08 07:46:03 +08:00
|
|
|
|
{
|
2014-09-17 19:33:52 +08:00
|
|
|
|
get
|
2014-04-08 07:46:03 +08:00
|
|
|
|
{
|
2014-09-18 18:46:01 +08:00
|
|
|
|
return _supportSize ?? (_supportSize = new CapWrapper<SupportedSize>(this, CapabilityId.ICapSupportedSizes, ValueExtensions.ConvertToEnum<SupportedSize>,
|
2014-09-17 19:33:52 +08:00
|
|
|
|
value => new TWCapability(CapabilityId.ICapSupportedSizes, new TWOneValue
|
|
|
|
|
{
|
|
|
|
|
Item = (uint)value,
|
|
|
|
|
ItemType = ItemType.UInt16
|
2014-09-18 18:46:01 +08:00
|
|
|
|
})));
|
2014-04-08 07:46:03 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-09-17 19:33:52 +08:00
|
|
|
|
|
2014-09-18 18:46:01 +08:00
|
|
|
|
private CapWrapper<BoolType> _autoDeskew;
|
2014-09-17 19:33:52 +08:00
|
|
|
|
|
2014-04-08 07:46:03 +08:00
|
|
|
|
/// <summary>
|
2014-09-17 19:33:52 +08:00
|
|
|
|
/// Gets the property to work with image auto deskew flag for the current source.
|
2014-04-08 07:46:03 +08:00
|
|
|
|
/// </summary>
|
2014-09-17 19:33:52 +08:00
|
|
|
|
/// <value>
|
2014-09-17 20:07:00 +08:00
|
|
|
|
/// The image auto deskew flag.
|
2014-09-17 19:33:52 +08:00
|
|
|
|
/// </value>
|
2014-09-18 18:46:01 +08:00
|
|
|
|
public CapWrapper<BoolType> CapImageAutoDeskew
|
2014-04-08 07:46:03 +08:00
|
|
|
|
{
|
2014-09-17 19:33:52 +08:00
|
|
|
|
get
|
2014-04-08 07:46:03 +08:00
|
|
|
|
{
|
2014-09-18 18:46:01 +08:00
|
|
|
|
return _autoDeskew ?? (_autoDeskew = new CapWrapper<BoolType>(this, CapabilityId.ICapAutomaticDeskew, ValueExtensions.ConvertToEnum<BoolType>, value =>
|
2014-09-25 09:52:28 +08:00
|
|
|
|
new TWCapability(CapabilityId.ICapAutomaticDeskew, new TWOneValue
|
2014-09-17 20:07:00 +08:00
|
|
|
|
{
|
2014-09-18 07:33:18 +08:00
|
|
|
|
Item = (uint)value,
|
|
|
|
|
ItemType = ItemType.Bool
|
2014-09-18 18:46:01 +08:00
|
|
|
|
})));
|
2014-04-08 07:46:03 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2014-09-18 18:46:01 +08:00
|
|
|
|
private CapWrapper<BoolType> _autoRotate;
|
2014-04-03 07:01:21 +08:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
2014-09-17 20:07:00 +08:00
|
|
|
|
/// Gets the property to work with image auto rotate flag for the current source.
|
2014-04-03 07:01:21 +08:00
|
|
|
|
/// </summary>
|
2014-09-17 20:07:00 +08:00
|
|
|
|
/// <value>
|
|
|
|
|
/// The image auto rotate flag.
|
|
|
|
|
/// </value>
|
2014-09-18 18:46:01 +08:00
|
|
|
|
public CapWrapper<BoolType> CapImageAutoRotate
|
2014-04-03 07:01:21 +08:00
|
|
|
|
{
|
2014-09-17 20:07:00 +08:00
|
|
|
|
get
|
|
|
|
|
{
|
2014-09-18 18:46:01 +08:00
|
|
|
|
return _autoRotate ?? (_autoRotate = new CapWrapper<BoolType>(this, CapabilityId.ICapAutomaticRotate, ValueExtensions.ConvertToEnum<BoolType>, value =>
|
|
|
|
|
new TWCapability(CapabilityId.ICapAutomaticRotate, new TWOneValue
|
|
|
|
|
{
|
|
|
|
|
Item = (uint)value,
|
|
|
|
|
ItemType = ItemType.Bool
|
|
|
|
|
})));
|
2014-09-17 20:07:00 +08:00
|
|
|
|
}
|
2014-04-03 07:01:21 +08:00
|
|
|
|
}
|
|
|
|
|
|
2014-09-17 20:07:00 +08:00
|
|
|
|
|
2014-09-18 18:46:01 +08:00
|
|
|
|
private CapWrapper<TWFix32> _xResolution;
|
2014-09-17 20:07:00 +08:00
|
|
|
|
|
2014-04-03 07:01:21 +08:00
|
|
|
|
/// <summary>
|
2014-09-17 20:07:00 +08:00
|
|
|
|
/// Gets the property to work with image horizontal resolution for the current source.
|
2014-04-03 07:01:21 +08:00
|
|
|
|
/// </summary>
|
2014-09-17 20:07:00 +08:00
|
|
|
|
/// <value>
|
|
|
|
|
/// The image horizontal resolution.
|
|
|
|
|
/// </value>
|
2014-09-18 18:46:01 +08:00
|
|
|
|
public CapWrapper<TWFix32> CapImageXResolution
|
2014-04-03 07:01:21 +08:00
|
|
|
|
{
|
2014-09-17 20:07:00 +08:00
|
|
|
|
get
|
2014-04-03 07:01:21 +08:00
|
|
|
|
{
|
2014-09-18 18:46:01 +08:00
|
|
|
|
return _xResolution ?? (_xResolution = new CapWrapper<TWFix32>(this, CapabilityId.ICapXResolution, ValueExtensions.ConvertToFix32,
|
2014-09-17 20:07:00 +08:00
|
|
|
|
value => new TWCapability(CapabilityId.ICapXResolution, new TWOneValue
|
|
|
|
|
{
|
|
|
|
|
Item = (uint)value,// ((uint)dpi) << 16;
|
|
|
|
|
ItemType = ItemType.Fix32
|
2014-09-18 18:46:01 +08:00
|
|
|
|
})));
|
2014-04-03 07:01:21 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2014-09-18 18:46:01 +08:00
|
|
|
|
private CapWrapper<TWFix32> _yResolution;
|
2014-04-03 07:01:21 +08:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
2014-09-17 20:07:00 +08:00
|
|
|
|
/// Gets the property to work with image vertical resolution for the current source.
|
2014-04-03 07:01:21 +08:00
|
|
|
|
/// </summary>
|
2014-09-17 20:07:00 +08:00
|
|
|
|
/// <value>
|
|
|
|
|
/// The image vertical resolution.
|
|
|
|
|
/// </value>
|
2014-09-18 18:46:01 +08:00
|
|
|
|
public CapWrapper<TWFix32> CapImageYResolution
|
2014-04-03 07:01:21 +08:00
|
|
|
|
{
|
2014-09-17 20:07:00 +08:00
|
|
|
|
get
|
2014-04-03 07:01:21 +08:00
|
|
|
|
{
|
2014-09-18 18:46:01 +08:00
|
|
|
|
return _yResolution ?? (_yResolution = new CapWrapper<TWFix32>(this, CapabilityId.ICapYResolution, ValueExtensions.ConvertToFix32,
|
2014-09-17 20:07:00 +08:00
|
|
|
|
value => new TWCapability(CapabilityId.ICapYResolution, new TWOneValue
|
|
|
|
|
{
|
|
|
|
|
Item = (uint)value,// ((uint)dpi) << 16;
|
|
|
|
|
ItemType = ItemType.Fix32
|
2014-09-18 18:46:01 +08:00
|
|
|
|
})));
|
2014-04-03 07:01:21 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-09-17 20:07:00 +08:00
|
|
|
|
|
2014-09-18 18:46:01 +08:00
|
|
|
|
private CapWrapper<BoolType> _borderDetect;
|
2014-09-17 20:07:00 +08:00
|
|
|
|
|
2014-04-03 07:01:21 +08:00
|
|
|
|
/// <summary>
|
2014-09-18 07:33:18 +08:00
|
|
|
|
/// Gets the property to work with auto border detection flag for the current source.
|
2014-04-03 07:01:21 +08:00
|
|
|
|
/// </summary>
|
2014-09-17 20:07:00 +08:00
|
|
|
|
/// <value>
|
2014-09-18 07:33:18 +08:00
|
|
|
|
/// The auto border detection flag.
|
2014-09-17 20:07:00 +08:00
|
|
|
|
/// </value>
|
2014-09-18 18:46:01 +08:00
|
|
|
|
public CapWrapper<BoolType> CapImageAutomaticBorderDetection
|
2014-04-03 07:01:21 +08:00
|
|
|
|
{
|
2014-09-17 20:07:00 +08:00
|
|
|
|
get
|
2014-04-03 07:01:21 +08:00
|
|
|
|
{
|
2014-09-25 09:52:28 +08:00
|
|
|
|
return _borderDetect ?? (_borderDetect = new CapWrapper<BoolType>(this, CapabilityId.ICapAutomaticBorderDetection, ValueExtensions.ConvertToEnum<BoolType>, value =>
|
2014-04-03 07:01:21 +08:00
|
|
|
|
{
|
2014-09-18 07:33:18 +08:00
|
|
|
|
var rc = ReturnCode.Failure;
|
|
|
|
|
|
|
|
|
|
var one = new TWOneValue
|
2014-09-17 20:07:00 +08:00
|
|
|
|
{
|
2014-09-18 07:33:18 +08:00
|
|
|
|
Item = (uint)value,
|
|
|
|
|
ItemType = ItemType.Bool
|
|
|
|
|
};
|
2014-09-17 20:07:00 +08:00
|
|
|
|
|
2014-09-18 07:33:18 +08:00
|
|
|
|
using (TWCapability capValue = new TWCapability(CapabilityId.ICapUndefinedImageSize, one))
|
|
|
|
|
{
|
|
|
|
|
rc = _session.DGControl.Capability.Set(capValue);
|
2014-09-17 20:07:00 +08:00
|
|
|
|
}
|
2014-09-18 07:33:18 +08:00
|
|
|
|
using (TWCapability capValue = new TWCapability(CapabilityId.ICapAutomaticBorderDetection, one))
|
2014-09-17 20:07:00 +08:00
|
|
|
|
{
|
2014-09-18 07:33:18 +08:00
|
|
|
|
rc = _session.DGControl.Capability.Set(capValue);
|
2014-09-17 20:07:00 +08:00
|
|
|
|
}
|
2014-09-18 07:33:18 +08:00
|
|
|
|
|
|
|
|
|
return rc;
|
2014-09-18 18:46:01 +08:00
|
|
|
|
}));
|
2014-04-03 07:01:21 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-09-17 20:07:00 +08:00
|
|
|
|
#endregion
|
|
|
|
|
|
2014-09-18 07:33:18 +08:00
|
|
|
|
#region other caps
|
2014-09-17 20:07:00 +08:00
|
|
|
|
|
2014-09-25 09:52:28 +08:00
|
|
|
|
private CapWrapper<Duplex> _duplex;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the property to see what's the duplex mode for the current source.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>
|
|
|
|
|
/// The duplex mode.
|
|
|
|
|
/// </value>
|
|
|
|
|
public CapWrapper<Duplex> CapDuplex
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _duplex ?? (_duplex = new CapWrapper<Duplex>(this, CapabilityId.CapDuplex, ValueExtensions.ConvertToEnum<Duplex>));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-09-18 18:46:01 +08:00
|
|
|
|
private CapWrapper<BoolType> _duplexEnabled;
|
2014-09-17 20:07:00 +08:00
|
|
|
|
|
2014-04-03 07:01:21 +08:00
|
|
|
|
/// <summary>
|
2014-09-18 07:33:18 +08:00
|
|
|
|
/// Gets the property to work with duplex enabled flag for the current source.
|
2014-04-03 07:01:21 +08:00
|
|
|
|
/// </summary>
|
2014-09-18 07:33:18 +08:00
|
|
|
|
/// <value>
|
|
|
|
|
/// The duplex enabled flag.
|
|
|
|
|
/// </value>
|
2014-09-18 18:46:01 +08:00
|
|
|
|
public CapWrapper<BoolType> CapDuplexEnabled
|
2014-04-03 07:01:21 +08:00
|
|
|
|
{
|
2014-09-18 07:33:18 +08:00
|
|
|
|
get
|
2014-04-03 07:01:21 +08:00
|
|
|
|
{
|
2014-09-18 18:46:01 +08:00
|
|
|
|
return _duplexEnabled ?? (_duplexEnabled = new CapWrapper<BoolType>(this, CapabilityId.CapDuplexEnabled, ValueExtensions.ConvertToEnum<BoolType>, value =>
|
2014-09-18 07:33:18 +08:00
|
|
|
|
new TWCapability(CapabilityId.CapDuplexEnabled, new TWOneValue
|
|
|
|
|
{
|
|
|
|
|
Item = (uint)value,
|
|
|
|
|
ItemType = ItemType.Bool
|
2014-09-18 18:46:01 +08:00
|
|
|
|
})));
|
2014-04-03 07:01:21 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-09-18 07:33:18 +08:00
|
|
|
|
|
2014-09-18 18:46:01 +08:00
|
|
|
|
private CapWrapper<int> _xferCount;
|
2014-09-18 07:33:18 +08:00
|
|
|
|
|
2014-04-03 07:01:21 +08:00
|
|
|
|
/// <summary>
|
2014-09-18 07:33:18 +08:00
|
|
|
|
/// Gets the property to work with xfer count for the current source.
|
2014-04-03 07:01:21 +08:00
|
|
|
|
/// </summary>
|
2014-09-18 07:33:18 +08:00
|
|
|
|
/// <value>
|
|
|
|
|
/// The xfer count.
|
|
|
|
|
/// </value>
|
2014-09-18 18:46:01 +08:00
|
|
|
|
public CapWrapper<int> CapXferCount
|
2014-04-03 07:01:21 +08:00
|
|
|
|
{
|
2014-09-18 07:33:18 +08:00
|
|
|
|
get
|
2014-04-03 07:01:21 +08:00
|
|
|
|
{
|
2014-09-18 18:46:01 +08:00
|
|
|
|
return _xferCount ?? (_xferCount = new CapWrapper<int>(this, CapabilityId.CapXferCount, ValueExtensions.ConvertToEnum<int>, value =>
|
2014-09-18 07:33:18 +08:00
|
|
|
|
new TWCapability(CapabilityId.CapXferCount, new TWOneValue
|
|
|
|
|
{
|
|
|
|
|
Item = value > 0 ? (uint)value : uint.MaxValue,
|
|
|
|
|
ItemType = ItemType.UInt16
|
2014-09-18 18:46:01 +08:00
|
|
|
|
})));
|
2014-09-18 07:33:18 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2014-04-03 07:01:21 +08:00
|
|
|
|
|
2014-09-25 09:52:28 +08:00
|
|
|
|
private CapWrapper<BoolType> _feederLoaded;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the property to work with feeder loaded flag for the current source.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>
|
|
|
|
|
/// The feeder loaded flag.
|
|
|
|
|
/// </value>
|
|
|
|
|
public CapWrapper<BoolType> CapFeederLoaded
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _feederLoaded ?? (_feederLoaded = new CapWrapper<BoolType>(this, CapabilityId.CapFeederLoaded, ValueExtensions.ConvertToEnum<BoolType>));
|
|
|
|
|
}
|
|
|
|
|
}
|
2014-04-03 07:01:21 +08:00
|
|
|
|
|
2014-09-18 18:46:01 +08:00
|
|
|
|
private CapWrapper<BoolType> _feederEnabled;
|
2014-04-03 07:01:21 +08:00
|
|
|
|
|
2014-09-18 07:33:18 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the property to work with feeder enabled flag for the current source.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>
|
|
|
|
|
/// The feeder enabled flag.
|
|
|
|
|
/// </value>
|
2014-09-18 18:46:01 +08:00
|
|
|
|
public CapWrapper<BoolType> CapFeederEnabled
|
2014-09-18 07:33:18 +08:00
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
2014-09-18 18:46:01 +08:00
|
|
|
|
return _feederEnabled ?? (_feederEnabled = new CapWrapper<BoolType>(this, CapabilityId.CapFeederEnabled, ValueExtensions.ConvertToEnum<BoolType>, value =>
|
2014-04-03 07:01:21 +08:00
|
|
|
|
{
|
2014-09-18 07:33:18 +08:00
|
|
|
|
var rc = ReturnCode.Failure;
|
2014-04-03 07:01:21 +08:00
|
|
|
|
|
2014-09-18 07:33:18 +08:00
|
|
|
|
var one = new TWOneValue
|
2014-04-03 07:01:21 +08:00
|
|
|
|
{
|
2014-09-18 07:33:18 +08:00
|
|
|
|
Item = (uint)value,
|
|
|
|
|
ItemType = ItemType.Bool
|
|
|
|
|
};
|
2014-04-03 07:01:21 +08:00
|
|
|
|
|
2014-09-18 07:33:18 +08:00
|
|
|
|
// we will never set feeder off, only autofeed and autoscan
|
|
|
|
|
// but if it is true then enable feeder needs to be set first
|
|
|
|
|
if (value == BoolType.True)
|
2014-04-03 07:01:21 +08:00
|
|
|
|
{
|
2014-09-18 07:33:18 +08:00
|
|
|
|
using (TWCapability enabled = new TWCapability(CapabilityId.CapFeederEnabled, one))
|
|
|
|
|
{
|
|
|
|
|
rc = _session.DGControl.Capability.Set(enabled);
|
|
|
|
|
}
|
2014-04-03 07:01:21 +08:00
|
|
|
|
}
|
2014-09-18 07:33:18 +08:00
|
|
|
|
// to really use feeder we must also set autofeed or autoscan, but only
|
|
|
|
|
// for one of them since setting autoscan also sets autofeed
|
|
|
|
|
if (SupportedCaps.Contains(CapabilityId.CapAutoScan))
|
2014-04-03 07:01:21 +08:00
|
|
|
|
{
|
2014-09-18 07:33:18 +08:00
|
|
|
|
using (TWCapability autoScan = new TWCapability(CapabilityId.CapAutoScan, one))
|
|
|
|
|
{
|
|
|
|
|
rc = _session.DGControl.Capability.Set(autoScan);
|
|
|
|
|
}
|
2014-04-03 07:01:21 +08:00
|
|
|
|
}
|
2014-09-18 07:33:18 +08:00
|
|
|
|
else if (SupportedCaps.Contains(CapabilityId.CapAutoFeed))
|
2014-04-03 07:01:21 +08:00
|
|
|
|
{
|
2014-09-18 07:33:18 +08:00
|
|
|
|
using (TWCapability autoScan = new TWCapability(CapabilityId.CapAutoFeed, one))
|
|
|
|
|
{
|
|
|
|
|
rc = _session.DGControl.Capability.Set(autoScan);
|
|
|
|
|
}
|
2014-04-03 07:01:21 +08:00
|
|
|
|
}
|
2014-09-18 07:33:18 +08:00
|
|
|
|
|
|
|
|
|
return rc;
|
2014-09-18 18:46:01 +08:00
|
|
|
|
}));
|
2014-04-03 07:01:21 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-09-25 09:52:28 +08:00
|
|
|
|
private CapWrapper<BoolType> _clearPage;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the property to work with clear page flag for the current source.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>
|
|
|
|
|
/// The clear page flag.
|
|
|
|
|
/// </value>
|
|
|
|
|
public CapWrapper<BoolType> CapClearPage
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _clearPage ?? (_clearPage = new CapWrapper<BoolType>(this, CapabilityId.CapClearPage, ValueExtensions.ConvertToEnum<BoolType>, value =>
|
|
|
|
|
new TWCapability(CapabilityId.CapClearPage, new TWOneValue
|
|
|
|
|
{
|
|
|
|
|
Item = (uint)value,
|
|
|
|
|
ItemType = ItemType.Bool
|
|
|
|
|
})));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private CapWrapper<BoolType> _feedPage;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the property to work with feed page flag for the current source.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>
|
|
|
|
|
/// The feed page flag.
|
|
|
|
|
/// </value>
|
|
|
|
|
public CapWrapper<BoolType> CapFeedPage
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _feedPage ?? (_feedPage = new CapWrapper<BoolType>(this, CapabilityId.CapFeedPage, ValueExtensions.ConvertToEnum<BoolType>, value =>
|
|
|
|
|
new TWCapability(CapabilityId.CapFeedPage, new TWOneValue
|
|
|
|
|
{
|
|
|
|
|
Item = (uint)value,
|
|
|
|
|
ItemType = ItemType.Bool
|
|
|
|
|
})));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private CapWrapper<BoolType> _rewindPage;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the property to work with rewind page flag for the current source.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>
|
|
|
|
|
/// The rewind page flag.
|
|
|
|
|
/// </value>
|
|
|
|
|
public CapWrapper<BoolType> CapRewindPage
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _rewindPage ?? (_rewindPage = new CapWrapper<BoolType>(this, CapabilityId.CapRewindPage, ValueExtensions.ConvertToEnum<BoolType>, value =>
|
|
|
|
|
new TWCapability(CapabilityId.CapRewindPage, new TWOneValue
|
|
|
|
|
{
|
|
|
|
|
Item = (uint)value,
|
|
|
|
|
ItemType = ItemType.Bool
|
|
|
|
|
})));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private CapWrapper<BoolType> _indicators;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the property to work with indicators flag for the current source.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>
|
|
|
|
|
/// The indicators flag.
|
|
|
|
|
/// </value>
|
|
|
|
|
public CapWrapper<BoolType> CapIndicators
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _indicators ?? (_indicators = new CapWrapper<BoolType>(this, CapabilityId.CapIndicators, ValueExtensions.ConvertToEnum<BoolType>, value =>
|
|
|
|
|
new TWCapability(CapabilityId.CapIndicators, new TWOneValue
|
|
|
|
|
{
|
|
|
|
|
Item = (uint)value,
|
|
|
|
|
ItemType = ItemType.Bool
|
|
|
|
|
})));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private CapWrapper<BoolType> _paperDetectable;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the property to work with paper sensor flag for the current source.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>
|
|
|
|
|
/// The paper sensor flag.
|
|
|
|
|
/// </value>
|
|
|
|
|
public CapWrapper<BoolType> CapPaperDetectable
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _paperDetectable ?? (_paperDetectable = new CapWrapper<BoolType>(this, CapabilityId.CapPaperDetectable, ValueExtensions.ConvertToEnum<BoolType>));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private CapWrapper<BoolType> _uiControllable;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the property to work with UI controllable flag for the current source.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>
|
|
|
|
|
/// The UI controllable flag.
|
|
|
|
|
/// </value>
|
|
|
|
|
public CapWrapper<BoolType> CapUIControllable
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _uiControllable ?? (_uiControllable = new CapWrapper<BoolType>(this, CapabilityId.CapUIControllable, ValueExtensions.ConvertToEnum<BoolType>));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private CapWrapper<BoolType> _devOnline;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the property to work with devince online flag for the current source.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>
|
|
|
|
|
/// The devince online flag.
|
|
|
|
|
/// </value>
|
|
|
|
|
public CapWrapper<BoolType> CapDeviceOnline
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _devOnline ?? (_devOnline = new CapWrapper<BoolType>(this, CapabilityId.CapDeviceOnline, ValueExtensions.ConvertToEnum<BoolType>));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private CapWrapper<BoolType> _thumbsEnabled;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the property to work with thumbnails enabled flag for the current source.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>
|
|
|
|
|
/// The thumbnails enabled flag.
|
|
|
|
|
/// </value>
|
|
|
|
|
public CapWrapper<BoolType> CapThumbnailsEnabled
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _thumbsEnabled ?? (_thumbsEnabled = new CapWrapper<BoolType>(this, CapabilityId.CapThumbnailsEnabled, ValueExtensions.ConvertToEnum<BoolType>, value =>
|
|
|
|
|
new TWCapability(CapabilityId.CapThumbnailsEnabled, new TWOneValue
|
|
|
|
|
{
|
|
|
|
|
Item = (uint)value,
|
|
|
|
|
ItemType = ItemType.Bool
|
|
|
|
|
})));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private CapWrapper<BoolType> _dsUIonly;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the property to see whether device supports UI only flag (no transfer).
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>
|
|
|
|
|
/// The UI only flag.
|
|
|
|
|
/// </value>
|
|
|
|
|
public CapWrapper<BoolType> CapEnableDSUIOnly
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _dsUIonly ?? (_dsUIonly = new CapWrapper<BoolType>(this, CapabilityId.CapEnableDSUIOnly, ValueExtensions.ConvertToEnum<BoolType>));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private CapWrapper<BoolType> _dsData;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the property to see whether device supports custom data triplets.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>
|
|
|
|
|
/// The custom data flag.
|
|
|
|
|
/// </value>
|
|
|
|
|
public CapWrapper<BoolType> CapCustomDSData
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _dsData ?? (_dsData = new CapWrapper<BoolType>(this, CapabilityId.CapCustomDSData, ValueExtensions.ConvertToEnum<BoolType>));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private CapWrapper<JobControl> _jobControl;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the property to work with job control option for the current source.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>
|
|
|
|
|
/// The job control option.
|
|
|
|
|
/// </value>
|
|
|
|
|
public CapWrapper<JobControl> CapJobControl
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _jobControl ?? (_jobControl = new CapWrapper<JobControl>(this, CapabilityId.CapJobControl, ValueExtensions.ConvertToEnum<JobControl>, value =>
|
|
|
|
|
new TWCapability(CapabilityId.CapJobControl, new TWOneValue
|
|
|
|
|
{
|
|
|
|
|
Item = (uint)value,
|
|
|
|
|
ItemType = ItemType.UInt16
|
|
|
|
|
})));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private CapWrapper<int> _alarmVolume;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the property to work with alarm volume for the current source.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>
|
|
|
|
|
/// The alarm volume.
|
|
|
|
|
/// </value>
|
|
|
|
|
public CapWrapper<int> CapAlarmVolume
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _alarmVolume ?? (_alarmVolume = new CapWrapper<int>(this, CapabilityId.CapAlarmVolume, ValueExtensions.ConvertToEnum<int>, value =>
|
|
|
|
|
new TWCapability(CapabilityId.CapAlarmVolume, new TWOneValue
|
|
|
|
|
{
|
|
|
|
|
Item = (uint)value,
|
|
|
|
|
ItemType = ItemType.Int32
|
|
|
|
|
})));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//private CapWrapper<int> _autoCapture;
|
|
|
|
|
|
|
|
|
|
///// <summary>
|
|
|
|
|
///// Gets the property to work with auto capture count for the current source.
|
|
|
|
|
///// </summary>
|
|
|
|
|
///// <value>
|
|
|
|
|
///// The auto capture count.
|
|
|
|
|
///// </value>
|
|
|
|
|
//public CapWrapper<int> CapAutomaticCapture
|
|
|
|
|
//{
|
|
|
|
|
// get
|
|
|
|
|
// {
|
|
|
|
|
// return _autoCapture ?? (_autoCapture = new CapWrapper<int>(this, CapabilityId.CapAutomaticCapture, ValueExtensions.ConvertToEnum<int>, value =>
|
|
|
|
|
// new TWCapability(CapabilityId.CapAutomaticCapture, new TWOneValue
|
|
|
|
|
// {
|
|
|
|
|
// Item = (uint)value,
|
|
|
|
|
// ItemType = ItemType.Int32
|
|
|
|
|
// })));
|
|
|
|
|
// }
|
|
|
|
|
//}
|
|
|
|
|
|
2014-09-18 07:33:18 +08:00
|
|
|
|
|
2014-04-03 07:01:21 +08:00
|
|
|
|
#endregion
|
2014-09-18 07:33:18 +08:00
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
2014-04-03 07:01:21 +08:00
|
|
|
|
}
|
|
|
|
|
}
|