本文整理汇总了C#中HTuple.TupleStrrstr方法的典型用法代码示例。如果您正苦于以下问题:C# HTuple.TupleStrrstr方法的具体用法?C# HTuple.TupleStrrstr怎么用?C# HTuple.TupleStrrstr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTuple
的用法示例。
在下文中一共展示了HTuple.TupleStrrstr方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadCamParamButton_Click
/// <summary>Loads HALCON calibration data.</summary>
private void LoadCamParamButton_Click(object sender, System.EventArgs e)
{
HTuple buttonType, valType;
string file;
string [] val;
bool isCalFile;
StatusLabel.Text = "";
buttonType = new HTuple(sender.ToString());
valType = buttonType.TupleStrrstr(new HTuple("CamPar"));
if (valType[0].I > 0)
openCamparFileDialog.FilterIndex = 1;
else
openCamparFileDialog.FilterIndex = 2;
openCamparFileDialog.FileName = "";
if (openCamparFileDialog.ShowDialog() == DialogResult.OK)
{
file = openCamparFileDialog.FileName;
StatusLabel.Text = "";
if ((isCalFile = file.EndsWith(".cal")) || file.EndsWith(".dat"))
{
try
{
if (valType[0].I > 0)
{
mAssistant.LoadCamParFile(file);
val = file.Split(new Char[] { '\\' });
file = val[val.Length - 1];
CalibCamTextBox.Text = file;
}
else
{
mAssistant.LoadCamPoseFile(file);
val = file.Split(new Char[] { '\\' });
file = val[val.Length - 1];
CalibPoseTextBox.Text = file;
}
}
catch (HOperatorException)
{
if (valType[0].I > 0)
CalibCamTextBox.Text = "*.cal";
else
CalibPoseTextBox.Text = "*.dat";
StatusLabel.Text = mAssistant.exceptionText;
valType = mAssistant.exceptionText.TupleSplit(":");
MessageBox.Show("File is corrupted or has a wrong format:\nPlease check if you chose a valid calibration file (or format)!",
"Measure Assistant",
MessageBoxButtons.OK,
MessageBoxIcon.Information);
}
}
else
{
MessageBox.Show("Fileformat is wrong: Data is not a calibration file!",
"Measure Assistant",
MessageBoxButtons.OK,
MessageBoxIcon.Information);
}
if (mAssistant.mIsCalibValid)
{
TransWCoordCheckBox.Enabled = true;
}
else
{
TransWCoordCheckBox.Enabled = false;
TransWCoordCheckBox.Checked = false;
}
}
}