本文整理汇总了C#中MAVLink.ContainsKey方法的典型用法代码示例。如果您正苦于以下问题:C# MAVLink.ContainsKey方法的具体用法?C# MAVLink.ContainsKey怎么用?C# MAVLink.ContainsKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MAVLink
的用法示例。
在下文中一共展示了MAVLink.ContainsKey方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: setup
public void setup(List<KeyValuePair<int, string>> source, string paramname, MAVLink.MAVLinkParamList paramlist)
//, string paramname2 = "", Control enabledisable = null)
{
base.SelectedIndexChanged -= MavlinkComboBox_SelectedIndexChanged;
_source2 = source;
this.DisplayMember = "Value";
this.ValueMember = "Key";
this.DataSource = source;
this.ParamName = paramname;
if (paramlist.ContainsKey(paramname))
{
this.Enabled = true;
this.Visible = true;
enableControl(true);
var item = paramlist[paramname];
this.SelectedValue = (int) paramlist[paramname].Value;
}
base.SelectedIndexChanged += new EventHandler(MavlinkComboBox_SelectedIndexChanged);
}
示例2: setup
public void setup(string paramname, MAVLink.MAVLinkParamList paramlist)
{
this.ParamName = paramname;
if (paramlist.ContainsKey(paramname))
{
this.Enabled = true;
list = ParameterMetaDataRepository.GetParameterBitMaskInt(ParamName,
MainV2.comPort.MAV.cs.firmware.ToString());
chkcount = list.Count;
int leftside = 9;
int top = 9;
uint value = (uint) paramlist[paramname].Value;
for (int a = 0; a < chkcount; a++)
{
CheckBox chk = new CheckBox();
chk.AutoSize = true;
chk.Text = list[a].Value.ToString();
chk.Location = new System.Drawing.Point(leftside, top);
chk.CheckedChanged -= MavlinkCheckBoxBitMask_CheckedChanged;
if ((value & (1 << list[a].Key)) > 0)
{
chk.Checked = true;
}
chklist.Add(new KeyValuePair<int, CheckBox>(list[a].Key, chk));
panel1.Controls.Add(chk);
chk.CheckedChanged += MavlinkCheckBoxBitMask_CheckedChanged;
//this.Controls.Add(new Label() { Location = chk.Location, Text = "test" });
leftside += chk.Width + 5;
if (leftside > 500)
{
top += chk.Height + 5;
leftside = 9;
}
}
this.panel1.Height = top + 25;
//this.Height = top + 25;
}
else
{
this.Enabled = false;
}
}
示例3: setup
public void setup(double OnValue, double OffValue, string[] paramname, MAVLink.MAVLinkParamList paramlist,
Control enabledisable = null)
{
foreach (var s in paramname)
{
if (paramlist.ContainsKey(s))
{
setup(OnValue, OffValue, s, paramlist, enabledisable);
return;
}
}
}
示例4: setup
public void setup(Type source, string paramname, MAVLink.MAVLinkParamList paramlist)//, string paramname2 = "", Control enabledisable = null)
{
base.SelectedIndexChanged -= MavlinkComboBox_SelectedIndexChanged;
_source = source;
this.DataSource = Enum.GetNames(source);
this.ParamName = paramname;
if (paramlist.ContainsKey(paramname))
{
this.Enabled = true;
this.Visible = true;
enableControl(true);
this.Text = Enum.GetName(source, (Int32)paramlist[paramname].Value);
}
base.SelectedIndexChanged += new EventHandler(MavlinkComboBox_SelectedIndexChanged);
}
示例5: setup
public void setup(double OnValue, double OffValue, string paramname, MAVLink.MAVLinkParamList paramlist,
Control enabledisable = null)
{
base.CheckedChanged -= MavlinkCheckBox_CheckedChanged;
this.OnValue = OnValue;
this.OffValue = OffValue;
this.ParamName = paramname;
this._control = enabledisable;
if (paramlist.ContainsKey(paramname))
{
this.Enabled = true;
this.Visible = true;
if (paramlist[paramname].Value == OnValue)
{
this.Checked = true;
enableControl(true);
}
else if (paramlist[paramname].Value == OffValue)
{
this.Checked = false;
enableControl(false);
}
else
{
this.CheckState = System.Windows.Forms.CheckState.Indeterminate;
enableControl(false);
}
}
else
{
this.Enabled = false;
}
base.CheckedChanged += new EventHandler(MavlinkCheckBox_CheckedChanged);
}
示例6: setup
public void setup(float Min, float Max, float Scale, float Increment, string[] paramname,
MAVLink.MAVLinkParamList paramlist, Control enabledisable = null)
{
this.ValueChanged -= MavlinkNumericUpDown_ValueChanged;
// default to first item
this.ParamName = paramname[0];
// set a new item is first item doesnt exist
foreach (var paramn in paramname)
{
if (paramlist.ContainsKey(paramn))
{
this.ParamName = paramn;
break;
}
}
// update local name
Name = ParamName;
// set min and max of both are equal
if (Min == Max)
{
double mint = Min, maxt = Max;
ParameterMetaDataRepository.GetParameterRange(ParamName, ref mint, ref maxt,
MainV2.comPort.MAV.cs.firmware.ToString());
Min = (float) mint;
Max = (float) maxt;
}
_scale = Scale;
this.Minimum = (decimal) (Min);
this.Maximum = (decimal) (Max);
this.Increment = (decimal) (Increment);
this.DecimalPlaces = BitConverter.GetBytes(decimal.GetBits((decimal) Increment)[3])[2];
this._control = enabledisable;
if (paramlist.ContainsKey(ParamName))
{
this.Enabled = true;
this.Visible = true;
enableControl(true);
decimal value = (decimal) ((float) paramlist[ParamName]/_scale);
int dec = BitConverter.GetBytes(decimal.GetBits((decimal) value)[3])[2];
if (dec > this.DecimalPlaces)
this.DecimalPlaces = dec;
if (value < this.Minimum)
this.Minimum = value;
if (value > this.Maximum)
this.Maximum = value;
base.Value = value;
}
else
{
this.Enabled = false;
enableControl(false);
}
this.ValueChanged += new EventHandler(MavlinkNumericUpDown_ValueChanged);
}