本文整理汇总了C#中PropertyValue.AddValues方法的典型用法代码示例。如果您正苦于以下问题:C# PropertyValue.AddValues方法的具体用法?C# PropertyValue.AddValues怎么用?C# PropertyValue.AddValues使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PropertyValue
的用法示例。
在下文中一共展示了PropertyValue.AddValues方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InitExposureDelay
protected override PropertyValue<long> InitExposureDelay()
{
PropertyValue<long> res = new PropertyValue<long>() { Name = "Exposure delay mode", IsEnabled = true, Code = 0xD06A };
res.AddValues("3 sec", 0);
res.AddValues("2 sec", 1);
res.AddValues("One sec", 1);
res.AddValues("OFF", 1);
res.ValueChanged += (sender, key, val) => SetProperty(CONST_CMD_SetDevicePropValue, new[] { (byte)val }, res.Code, -1);
return res;
}
示例2: CaptureAreaCrop
protected override PropertyValue<long> CaptureAreaCrop()
{
PropertyValue<long> res = new PropertyValue<long>()
{
Name = "Capture area crop",
IsEnabled = true,
Code = 0xD030,
SubType = typeof(sbyte)
};
res.AddValues("DX", 0);
res.AddValues("1.3x", 1);
res.ValueChanged +=
(sender, key, val) => SetProperty(CONST_CMD_SetDevicePropValue, BitConverter.GetBytes(val), res.Code);
return res;
}
示例3: FakeCameraDevice
public FakeCameraDevice()
{
HaveLiveView = false;
IsBusy = false;
DeviceName = "Fake camera";
SerialNumber = "00000000";
IsConnected = true;
HaveLiveView = false;
ExposureStatus = 1;
ExposureCompensation = new PropertyValue<int>() {IsEnabled = false};
Mode = new PropertyValue<uint> {IsEnabled = false};
FNumber = new PropertyValue<int> {IsEnabled = false};
ShutterSpeed = new PropertyValue<long> {IsEnabled = false};
WhiteBalance = new PropertyValue<long> {IsEnabled = false};
FocusMode = new PropertyValue<long> {IsEnabled = false};
CompressionSetting = new PropertyValue<int> {IsEnabled = false};
IsoNumber = new PropertyValue<int> {IsEnabled = false};
ExposureMeteringMode = new PropertyValue<int> {IsEnabled = false};
Battery = 100;
Capabilities.Add(CapabilityEnum.CaptureNoAf);
Capabilities.Add(CapabilityEnum.LiveView);
LiveViewImageZoomRatio=new PropertyValue<int>();
LiveViewImageZoomRatio.AddValues("All",0);
LiveViewImageZoomRatio.Value = "All";
}
示例4: Init
public bool Init(DeviceDescriptor deviceDescriptor,DeviceDescription description)
{
base.Init(deviceDescriptor);
StillImageDevice imageDevice = StillImageDevice as StillImageDevice;
if (imageDevice != null)
imageDevice.DeviceEvent += StillImageDevice_DeviceEvent;
foreach (var property in description.Properties)
{
if (!string.IsNullOrEmpty(property.Name))
{
try
{
MTPDataResponse result = StillImageDevice.ExecuteReadData(CONST_CMD_GetDevicePropDesc, property.Code);
ErrorCodes.GetException(result.ErrorCode);
uint dataType = BitConverter.ToUInt16(result.Data, 2);
int dataLength = StaticHelper.GetDataLength(dataType);
var value = new PropertyValue<long> { Code = property.Code, Name = property.Name };
foreach (var propertyValue in property.Values)
{
value.AddValues(propertyValue.Name, propertyValue.Value);
}
value.ValueChanged += value_ValueChanged;
AdvancedProperties.Add(value);
}
catch (Exception ex)
{
Log.Error("Error ger property ", ex);
}
}
}
return true;
}
示例5: FakeCameraDevice
public FakeCameraDevice()
{
HaveLiveView = false;
IsBusy = false;
DeviceName = "Fake camera";
SerialNumber = "00000000";
IsConnected = true;
HaveLiveView = false;
ExposureStatus = 1;
ExposureCompensation = new PropertyValue<int>() {IsEnabled = false};
Mode = new PropertyValue<uint> {IsEnabled = false};
FNumber = new PropertyValue<int> {IsEnabled = false};
ShutterSpeed = new PropertyValue<long> {IsEnabled = false};
WhiteBalance = new PropertyValue<long> {IsEnabled = false};
FocusMode = new PropertyValue<long> {IsEnabled = false};
CompressionSetting = new PropertyValue<int> {IsEnabled = false};
IsoNumber = new PropertyValue<int> {IsEnabled = true};
ExposureMeteringMode = new PropertyValue<int> {IsEnabled = false};
Battery = 100;
Capabilities.Add(CapabilityEnum.CaptureNoAf);
Capabilities.Add(CapabilityEnum.LiveView);
Capabilities.Add(CapabilityEnum.LiveViewStream);
LiveViewImageZoomRatio = new PropertyValue<int>();
LiveViewImageZoomRatio.AddValues("All", 0);
LiveViewImageZoomRatio.Value = "All";
IsoNumber.AddValues("100", 100);
IsoNumber.AddValues("200", 200);
IsoNumber.AddValues("300", 300);
IsoNumber.Value = "100";
IsoNumber.ReloadValues();
var val = new PropertyValue<long>() {Name = "Test Test"};
val.AddValues("Val 1", 1);
val.AddValues("Val 2", 2);
val.AddValues("Val 3", 3);
val.Value = "Val 1";
val.ReloadValues();
AdvancedProperties.Add(val);
}
示例6: Init
public override bool Init(DeviceDescriptor deviceDescriptor)
{
CurrentValues = new Dictionary<string, string>();
Capabilities.Add(CapabilityEnum.LiveView);
Capabilities.Add(CapabilityEnum.LiveViewStream);
Protocol = deviceDescriptor.StillImageDevice as YiCameraProtocol;
Protocol.DataReceiverd += Protocol_DataReceiverd;
DeviceName = Protocol.Model;
Manufacturer = Protocol.Manufacturer;
IsConnected = true;
CompressionSetting = new PropertyValue<int> { Tag = "photo_quality" };
Mode = new PropertyValue<uint> { Tag = "capture_mode" };
Mode.AddValues("Single", 0);
Mode.AddValues("Burst", 1);
Mode.AddValues("Delayed", 2);
//Mode.AddValues("TimeLapse", 3);
Mode.ReloadValues();
ExposureMeteringMode = new PropertyValue<int>() { Tag = "meter_mode" };
LiveViewImageZoomRatio = new PropertyValue<int>();
LiveViewImageZoomRatio.AddValues("All", 0);
LiveViewImageZoomRatio.Value = "All";
SendCommand(3);
Thread.Sleep(500);
SerialNumber = GetValue("serial_number");
SetProperty(Mode.Tag, GetValue(Mode.Tag));
var thread = new Thread(LoadProperties) { Priority = ThreadPriority.Lowest };
thread.Start();
return true;
}
示例7: InitCompressionSetting
protected override void InitCompressionSetting()
{
try
{
byte datasize = 1;
CompressionSetting = new PropertyValue<int>();
CompressionSetting.ValueChanged += CompressionSetting_ValueChanged;
byte[] result = StillImageDevice.ExecuteReadData(CONST_CMD_GetDevicePropDesc, CONST_PROP_CompressionSetting);
byte defval = result[datasize + 5];
for (int i = 0; i < result.Length - ((2 * datasize) + 6 + 2); i += datasize)
{
byte val = result[((2 * datasize) + 6 + 2) + i];
CompressionSetting.AddValues(_csTable.ContainsKey(val) ? _csTable[val] : val.ToString(), val);
}
CompressionSetting.SetValue(defval);
}
catch (Exception)
{
}
}
示例8: InitStillCaptureMode
protected override PropertyValue<long> InitStillCaptureMode()
{
PropertyValue<long> res = new PropertyValue<long>()
{
Name = "Still Capture Mode",
IsEnabled = true,
Code = 0x5013,
SubType = typeof (UInt16)
};
res.AddValues("Single shot (single-frame shooting)", 0x0001);
res.AddValues("Continuous high-speed shooting (CH)", 0x0002);
res.AddValues("Continuous low-speed shooting (CL)", 0x8010);
res.AddValues("Self-timer", 0x8011);
res.AddValues("Mirror-up", 0x8012);
res.AddValues("Quiet shooting", 0x8016);
res.AddValues("Remote control", 0x8017);
res.ValueChanged +=
(sender, key, val) => SetProperty(CONST_CMD_SetDevicePropValue, BitConverter.GetBytes(val),
res.Code, -1);
return res;
}
示例9: InitFocalLength
protected virtual PropertyValue<long> InitFocalLength()
{
PropertyValue<long> res = new PropertyValue<long>()
{
Name = "Focal Length",
IsEnabled = true,
Code = 0x5008,
SubType = typeof(UInt32)
};
res.AddValues("3500", 0x0DAC);
res.AddValues("4600", 0x11F8);
res.AddValues("5300", 0x14B4);
res.AddValues("6100", 0x17D4);
res.AddValues("7300", 0x1C84);
res.AddValues("8600", 0x2198);
res.AddValues("10500", 0x2904);
res.SetValue(StillImageDevice.ExecuteReadData(CONST_CMD_GetDevicePropValue,
res.Code), false);
res.ReloadValues();
res.ValueChanged +=
(sender, key, val) => SetProperty(CONST_CMD_SetDevicePropValue, BitConverter.GetBytes(val), res.Code);
return res;
}
示例10: InitCompression
private void InitCompression()
{
CompressionSetting = new PropertyValue<int>();
CompressionSetting.AddValues("Jpeg", (int) EosImageFormat.Jpeg);
CompressionSetting.AddValues("Crw", (int) EosImageFormat.Crw);
CompressionSetting.AddValues("Cr2", (int) EosImageFormat.Cr2);
CompressionSetting.SetValue((int) Camera.ImageQuality.PrimaryImageFormat);
CompressionSetting.ValueChanged +=
new PropertyValue<int>.ValueChangedEventHandler(CompressionSetting_ValueChanged);
}
示例11: InitEc
private void InitEc()
{
ExposureCompensation = new PropertyValue<int>();
ExposureCompensation.ValueChanged += ExposureCompensation_ValueChanged;
try
{
foreach (KeyValuePair<uint, string> keyValuePair in _ec)
{
ExposureCompensation.AddValues(keyValuePair.Value, (int) keyValuePair.Key);
}
ExposureCompensation.IsEnabled = true;
ExposureCompensation.SetValue((int) Camera.GetProperty(Edsdk.PropID_ExposureCompensation), false);
}
catch (Exception exception)
{
Log.Debug("Error get EC", exception);
}
}
示例12: InitDriveMode
private PropertyValue<long> InitDriveMode()
{
PropertyValue<long> res = new PropertyValue<long>()
{
Name = "Drive Mode",
IsEnabled = true,
Code = Edsdk.PropID_DriveMode,
SubType = typeof (UInt32),
DisableIfWrongValue = true
};
res.AddValues("Single-Frame Shooting", 0);
res.AddValues("Continuous Shooting", 1);
res.AddValues("Video", 2);
//res.AddValues("Not used", 3);
res.AddValues("High-Speed Continuous Shooting", 4);
res.AddValues("Low-Speed Continuous Shooting", 5);
res.AddValues("Silent single shooting", 6);
res.AddValues("10-Sec Self-Timer plus continuous shots", 7);
res.AddValues("10-Sec Self-Timer", 10);
res.AddValues("2-Sec Self-Timer", 11);
res.ValueChanged +=
(sender, key, val) => Camera.SetProperty(res.Code, val);
return res;
}
示例13: InitFlash
private PropertyValue<long> InitFlash()
{
PropertyValue<long> res = new PropertyValue<long>()
{
Name = "Flash",
IsEnabled = true,
Code = Edsdk.PropID_FlashOn,
SubType = typeof(UInt32),
DisableIfWrongValue = true
};
res.AddValues("No flash", 0);
res.AddValues("Flash", 1);
res.ValueChanged +=
(sender, key, val) => Camera.SetProperty(res.Code, val);
return res;
}
示例14: InitStillCaptureMode
protected virtual PropertyValue<long> InitStillCaptureMode()
{
PropertyValue<long> res = new PropertyValue<long>()
{
Name = "Still Capture Mode",
IsEnabled = true,
Code = 0x5013,
SubType = typeof (UInt16)
};
res.AddValues("Single shot (single-frame shooting)", 0x0001);
res.AddValues("Continuous shot (continuous shooting)", 0x0002);
res.AddValues("Self-timer", 0x8011);
res.AddValues("Quick-response remote", 0x8014);
res.AddValues("2s delayed remote", 0x8015);
res.AddValues("Quiet shooting", 0x8016);
res.ReloadValues();
res.ValueChanged +=
(sender, key, val) => SetProperty(CONST_CMD_SetDevicePropValue, BitConverter.GetBytes(val),
res.Code);
return res;
}
示例15: InitCompression
private void InitCompression()
{
var data = GetSettingsList(Edsdk.PropID_ImageQuality);
CompressionSetting = new PropertyValue<int>();
CompressionSetting.AddValues("Large Fine JPEG", (int) new EosImageQuality(){PrimaryCompressLevel = EosCompressLevel.Fine,PrimaryImageFormat = EosImageFormat.Jpeg,PrimaryImageSize = EosImageSize.Large,SecondaryCompressLevel = EosCompressLevel.Unknown,SecondaryImageFormat = EosImageFormat.Unknown, SecondaryImageSize = EosImageSize.Unknown}.ToBitMask());
CompressionSetting.AddValues("Large Normal JPEG", (int)new EosImageQuality() { PrimaryCompressLevel = EosCompressLevel.Normal, PrimaryImageFormat = EosImageFormat.Jpeg, PrimaryImageSize = EosImageSize.Large, SecondaryCompressLevel = EosCompressLevel.Unknown, SecondaryImageFormat = EosImageFormat.Unknown, SecondaryImageSize = EosImageSize.Unknown }.ToBitMask());
CompressionSetting.AddValues("Medium Fine JPEG", (int)new EosImageQuality() { PrimaryCompressLevel = EosCompressLevel.Fine, PrimaryImageFormat = EosImageFormat.Jpeg, PrimaryImageSize = EosImageSize.Middle, SecondaryCompressLevel = EosCompressLevel.Unknown, SecondaryImageFormat = EosImageFormat.Unknown, SecondaryImageSize = EosImageSize.Unknown }.ToBitMask());
CompressionSetting.AddValues("Medium Normal JPEG", (int)new EosImageQuality() { PrimaryCompressLevel = EosCompressLevel.Normal, PrimaryImageFormat = EosImageFormat.Jpeg, PrimaryImageSize = EosImageSize.Middle, SecondaryCompressLevel = EosCompressLevel.Unknown, SecondaryImageFormat = EosImageFormat.Unknown, SecondaryImageSize = EosImageSize.Unknown }.ToBitMask());
CompressionSetting.AddValues("Small Fine JPEG", (int)new EosImageQuality() { PrimaryCompressLevel = EosCompressLevel.Fine, PrimaryImageFormat = EosImageFormat.Jpeg, PrimaryImageSize = EosImageSize.Small2, SecondaryCompressLevel = EosCompressLevel.Unknown, SecondaryImageFormat = EosImageFormat.Unknown, SecondaryImageSize = EosImageSize.Unknown }.ToBitMask());
CompressionSetting.AddValues("Small Normal JPEG", (int)new EosImageQuality() { PrimaryCompressLevel = EosCompressLevel.Normal, PrimaryImageFormat = EosImageFormat.Jpeg, PrimaryImageSize = EosImageSize.Small2, SecondaryCompressLevel = EosCompressLevel.Unknown, SecondaryImageFormat = EosImageFormat.Unknown, SecondaryImageSize = EosImageSize.Unknown }.ToBitMask());
CompressionSetting.AddValues("Smaller JPEG", (int)new EosImageQuality() { PrimaryCompressLevel = EosCompressLevel.Fine, PrimaryImageFormat = EosImageFormat.Jpeg, PrimaryImageSize = EosImageSize.Small3, SecondaryCompressLevel = EosCompressLevel.Unknown, SecondaryImageFormat = EosImageFormat.Unknown, SecondaryImageSize = EosImageSize.Unknown }.ToBitMask());
CompressionSetting.AddValues("Tiny JPEG", (int)new EosImageQuality() { PrimaryCompressLevel = EosCompressLevel.Fine, PrimaryImageFormat = EosImageFormat.Jpeg, PrimaryImageSize = EosImageSize.Small4, SecondaryCompressLevel = EosCompressLevel.Unknown, SecondaryImageFormat = EosImageFormat.Unknown, SecondaryImageSize = EosImageSize.Unknown }.ToBitMask());
CompressionSetting.AddValues("RAW + Large Fine JPEG", (int)new EosImageQuality() {PrimaryImageFormat =EosImageFormat.Cr2,PrimaryCompressLevel = EosCompressLevel.Lossless, PrimaryImageSize = EosImageSize.Large, SecondaryImageSize =EosImageSize.Large,SecondaryCompressLevel = EosCompressLevel.Fine, SecondaryImageFormat = EosImageFormat.Jpeg }.ToBitMask());
CompressionSetting.AddValues("RAW", (int)new EosImageQuality() { PrimaryImageFormat = EosImageFormat.Cr2, PrimaryCompressLevel = EosCompressLevel.Lossless, PrimaryImageSize = EosImageSize.Large, SecondaryCompressLevel = EosCompressLevel.Unknown, SecondaryImageFormat = EosImageFormat.Unknown, SecondaryImageSize = EosImageSize.Unknown}.ToBitMask());
CompressionSetting.Filter(data);
CompressionSetting.SetValue((int) Camera.ImageQuality.ToBitMask());
CompressionSetting.ValueChanged += CompressionSetting_ValueChanged;
}