在CaseIteratorDriver中设置输入的最佳方法是什么?一个示例显示了直接赋值:self.driver.case_inputs.param_name = [0,1,2]
在并行运行CaseIteratorDriver时似乎没有正确处理。我尝试通过self.driver.setsinputs(CaseArray({'x':[0,1,2]})
设置它们,但也失败了。似乎CaseArray不生成set_inputs期望的'generator'对象。哪些类可以生成正确的对象?
答案 0 :(得分:0)
将其设置为列表应该可以正常工作。您看到的行为是什么让您认为它不能并行工作?
你是如何并行运行的?设置Rectangle currentCrossRect = Rectangle.Empty;
private void tabControl1_DrawItem(object sender, DrawItemEventArgs e)
{
Bitmap cross = yourCloseImage;
int xWidth = cross.Width;
TabPage tp = tabControl1.TabPages[e.Index];
e.DrawBackground();
e.DrawFocusRectangle();
Size size = tabControl1.ItemSize;
using (SolidBrush brush = new SolidBrush(e.ForeColor))
e.Graphics.DrawString(tp.Text, e.Font, brush, e.Bounds.Left + 2 , 5);
if (tabControl1.SelectedTab == tp)
{
currentCrossRect = new Rectangle(
e.Bounds.Left + size.Width - 20, 3, xWidth,xWidth);
e.Graphics.DrawImage(cross, currentCrossRect.X, currentCrossRect.Y);
}
}
private void tabControl1_MouseClick(object sender, MouseEventArgs e)
{
TabPage tp = tabControl1.SelectedTab;
if (currentCrossRect.Contains(e.Location)) tp.Dispose();
}
?