本文整理汇总了C#中PropertyValue.ReloadValues方法的典型用法代码示例。如果您正苦于以下问题:C# PropertyValue.ReloadValues方法的具体用法?C# PropertyValue.ReloadValues怎么用?C# PropertyValue.ReloadValues使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PropertyValue
的用法示例。
在下文中一共展示了PropertyValue.ReloadValues方法的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", 3);
res.AddValues("2 sec", 2);
res.AddValues("1 sec", 1);
res.AddValues("OFF", 0);
res.ReloadValues();
res.ValueChanged +=
(sender, key, val) => SetProperty(CONST_CMD_SetDevicePropValue, new[] {(byte) val}, res.Code);
return res;
}
示例2: 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);
}
示例3: InitCompressionSetting
protected override void InitCompressionSetting()
{
try
{
byte datasize = 1;
CompressionSetting = new PropertyValue<int>();
CompressionSetting.ValueChanged += CompressionSetting_ValueChanged;
var result = StillImageDevice.ExecuteReadData(CONST_CMD_GetDevicePropDesc,
CONST_PROP_CompressionSetting);
byte defval = result.Data[datasize + 5];
for (int i = 0; i < result.Data.Length - ((2 * datasize) + 6 + 2); i += datasize)
{
byte val = result.Data[((2 * datasize) + 6 + 2) + i];
CompressionSetting.AddValues(_csTable.ContainsKey(val) ? _csTable[val] : val.ToString(), val);
}
CompressionSetting.ReloadValues();
CompressionSetting.SetValue(defval);
}
catch (Exception)
{
}
}
示例4: 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;
}
示例5: 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;
}
示例6: InitExposureCompensation
public void InitExposureCompensation()
{
try
{
DeviceReady();
byte datasize = 2;
NormalExposureCompensation = new PropertyValue<int>();
NormalExposureCompensation.Name = "ExposureCompensation";
NormalExposureCompensation.ValueChanged += ExposureCompensation_ValueChanged;
MTPDataResponse result = ExecuteReadDataEx(CONST_CMD_GetDevicePropDesc,
CONST_PROP_ExposureBiasCompensation);
Int16 defval = BitConverter.ToInt16(result.Data, datasize + 5);
for (int i = 0; i < result.Data.Length - ((2*datasize) + 6 + 2); i += datasize)
{
Int16 val = BitConverter.ToInt16(result.Data, ((2*datasize) + 6 + 2) + i);
decimal d = val;
string s = Decimal.Round(d/1000, 1).ToString("0.0", CultureInfo.CreateSpecificCulture("en-US"));
if (d > 0)
s = "+" + s;
NormalExposureCompensation.AddValues(s, val);
}
NormalExposureCompensation.ReloadValues();
NormalExposureCompensation.SetValue(defval, false);
ExposureCompensation = NormalExposureCompensation;
}
catch (Exception)
{
}
try
{
DeviceReady();
byte datasize = 2;
MovieExposureCompensation = new PropertyValue<int>();
MovieExposureCompensation.Name = "ExposureCompensation";
MovieExposureCompensation.ValueChanged += MovieExposureCompensation_ValueChanged;
MTPDataResponse result = ExecuteReadDataEx(CONST_CMD_GetDevicePropDesc,
CONST_PROP_MovieExposureBiasCompensation);
Int16 defval = BitConverter.ToInt16(result.Data, datasize + 5);
for (int i = 0; i < result.Data.Length - ((2 * datasize) + 6 + 2); i += datasize)
{
Int16 val = BitConverter.ToInt16(result.Data, ((2 * datasize) + 6 + 2) + i);
decimal d = val;
string s = Decimal.Round(d / 1000, 1).ToString("0.0", CultureInfo.CreateSpecificCulture("en-US"));
if (d > 0)
s = "+" + s;
MovieExposureCompensation.AddValues(s, val);
}
MovieExposureCompensation.ReloadValues();
MovieExposureCompensation.SetValue(defval, false);
}
catch (Exception)
{
}
}
示例7: InitWhiteBalance
private void InitWhiteBalance()
{
try
{
DeviceReady();
byte datasize = 2;
WhiteBalance = new PropertyValue<long>();
WhiteBalance.Name = "WhiteBalance";
WhiteBalance.ValueChanged += WhiteBalance_ValueChanged;
var result = ExecuteReadDataEx(CONST_CMD_GetDevicePropDesc, CONST_PROP_WhiteBalance);
if (result.Data != null && result.Data.Length > 0)
{
int type = BitConverter.ToInt16(result.Data, 2);
byte formFlag = result.Data[(2*datasize) + 5];
UInt16 defval = BitConverter.ToUInt16(result.Data, datasize + 5);
for (int i = 0; i < result.Data.Length - ((2*datasize) + 6 + 2); i += datasize)
{
UInt16 val = BitConverter.ToUInt16(result.Data, ((2*datasize) + 6 + 2) + i);
WhiteBalance.AddValues(_wbTable.ContainsKey(val) ? _wbTable[val] : val.ToString(), val);
}
WhiteBalance.ReloadValues();
WhiteBalance.SetValue(defval, false);
}
else
{
}
}
catch (Exception ex)
{
Log.Error("Error init white balance", ex);
}
}
示例8: InitMode
private void InitMode()
{
try
{
DeviceReady();
byte datasize = 2;
Mode = new PropertyValue<uint>();
Mode.Name = "Mode";
Mode.IsEnabled = false;
Mode.ValueChanged += Mode_ValueChanged;
var result = StillImageDevice.ExecuteReadData(CONST_CMD_GetDevicePropDesc,
CONST_PROP_ExposureProgramMode);
int type = BitConverter.ToInt16(result.Data, 2);
byte formFlag = result.Data[(2 * datasize) + 5];
UInt16 defval = BitConverter.ToUInt16(result.Data, datasize + 5);
for (int i = 0; i < result.Data.Length - ((2 * datasize) + 6 + 2); i += datasize)
{
UInt16 val = BitConverter.ToUInt16(result.Data, ((2 * datasize) + 6 + 2) + i);
Mode.AddValues(_exposureModeTable.ContainsKey(val) ? _exposureModeTable[val] : val.ToString(), val);
}
Mode.ReloadValues();
Mode.SetValue(defval);
}
catch (Exception)
{
}
}
示例9: LensSort
protected virtual PropertyValue<long> LensSort()
{
PropertyValue<long> res = new PropertyValue<long>()
{
Name = "Lens Sort",
IsEnabled = false,
Code = 0xD0E1,
SubType = typeof(sbyte)
};
res.AddValues("Not mounted", 0);
res.AddValues("CPU lens mounted", 1);
res.ReloadValues();
res.ValueChanged +=
(sender, key, val) => SetProperty(CONST_CMD_SetDevicePropValue, BitConverter.GetBytes(val), res.Code);
return res;
}
示例10: InitWbColorTemp
protected virtual PropertyValue<long> InitWbColorTemp()
{
PropertyValue<long> res = new PropertyValue<long>()
{
Name = "Temperature",
IsEnabled = WhiteBalance.NumericValue == 32786,
Code = CONST_PROP_WbColorTemp,
SubType = typeof (byte),
DisableIfWrongValue = false
};
res.AddValues("2500 K", 0);
res.AddValues("2560 K", 1);
res.AddValues("2630 K", 2);
res.AddValues("2700 K", 3);
res.AddValues("2780 K", 4);
res.AddValues("2860 K", 5);
res.AddValues("2940 K", 6);
res.AddValues("3030 K", 7);
res.AddValues("3130 K", 8);
res.AddValues("3230 K", 9);
res.AddValues("3330 K", 10);
res.AddValues("3450 K", 11);
res.AddValues("3570 K", 12);
res.AddValues("3700 K", 13);
res.AddValues("3850 K", 14);
res.AddValues("4000 K", 15);
res.AddValues("4170 K", 16);
res.AddValues("4350 K", 17);
res.AddValues("4550 K", 18);
res.AddValues("4760 K", 19);
res.AddValues("5000 K", 20);
res.AddValues("5260 K", 21);
res.AddValues("5560 K", 22);
res.AddValues("5880 K", 23);
res.AddValues("6250 K", 24);
res.AddValues("6670 K", 25);
res.AddValues("7140 K", 26);
res.AddValues("7690 K", 27);
res.AddValues("8330 K", 28);
res.AddValues("9090 K", 29);
res.AddValues("10000 K", 30);
res.ReloadValues();
res.ValueChanged +=
(sender, key, val) => SetProperty(CONST_CMD_SetDevicePropValue, BitConverter.GetBytes(val),
res.Code);
return res;
}
示例11: InitRawQuality
protected virtual PropertyValue<long> InitRawQuality()
{
PropertyValue<long> res = new PropertyValue<long>()
{
Name = "Raw Compression",
IsEnabled = true,
Code = CONST_PROP_RawCompressionType,
SubType = typeof (byte),
DisableIfWrongValue = true
};
res.AddValues("Lossless compressed RAW", 0);
res.AddValues("Compressed RAW", 1);
res.AddValues("Uncompressed RAW", 2);
res.ReloadValues();
res.ValueChanged +=
(sender, key, val) => SetProperty(CONST_CMD_SetDevicePropValue, BitConverter.GetBytes(val), res.Code);
return res;
}
示例12: InitColorSpace
protected virtual PropertyValue<long> InitColorSpace()
{
PropertyValue<long> res = new PropertyValue<long>()
{
Name = "Color space",
IsEnabled = true,
Code = CONST_PROP_ColorSpace,
SubType = typeof (byte)
};
res.AddValues("sRGB", 0);
res.AddValues("Adobe RGB", 1);
res.ReloadValues();
res.ValueChanged +=
(sender, key, val) => SetProperty(CONST_CMD_SetDevicePropValue, BitConverter.GetBytes(val), res.Code);
return res;
}
示例13: InitBurstNumber
protected virtual PropertyValue<long> InitBurstNumber()
{
PropertyValue<long> res = new PropertyValue<long>()
{
Name = "Burst Number",
IsEnabled = true,
Code = 0x5018,
SubType = typeof (UInt16)
};
for (int i = 1; i < 100; i++)
{
res.AddValues(i.ToString(), i);
}
res.ReloadValues();
res.ValueChanged +=
(sender, key, val) => SetProperty(CONST_CMD_SetDevicePropValue, BitConverter.GetBytes(val),
res.Code);
return res;
}
示例14: HDRSmoothing
protected virtual PropertyValue<long> HDRSmoothing()
{
PropertyValue<long> res = new PropertyValue<long>()
{
Name = "HDR intensity",
IsEnabled = true,
Code = 0xD132,
SubType = typeof(sbyte)
};
res.AddValues("High", 0);
res.AddValues("Normal", 1);
res.AddValues("Low", 2);
res.AddValues("Auto", 3);
res.AddValues("Extra high", 4);
res.ReloadValues();
res.ValueChanged +=
(sender, key, val) => SetProperty(CONST_CMD_SetDevicePropValue, BitConverter.GetBytes(val), res.Code);
return res;
}
示例15: HDRMode
protected virtual PropertyValue<long> HDRMode()
{
PropertyValue<long> res = new PropertyValue<long>()
{
Name = "HDRMode",
IsEnabled = true,
Code = 0xD130,
SubType = typeof(sbyte)
};
res.AddValues("OFF", 0);
res.AddValues("ON (single)", 1);
res.AddValues("ON (sequence)", 2);
res.ReloadValues();
res.ValueChanged +=
(sender, key, val) => SetProperty(CONST_CMD_SetDevicePropValue, BitConverter.GetBytes(val), res.Code);
return res;
}