Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/linq/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vb.net 可枚举。计数不工作_Vb.net_Linq_Linq To Objects_Enumerable - Fatal编程技术网

Vb.net 可枚举。计数不工作

Vb.net 可枚举。计数不工作,vb.net,linq,linq-to-objects,enumerable,Vb.net,Linq,Linq To Objects,Enumerable,我正在监测激光器的功率,我想知道n个连续测量值何时超出安全范围。我有一个队列(Double),它在被检查时有n个项目(在我的示例中为2个)。我想检查队列中的所有项目是否满足一个条件,因此我通过带有谓词的Count()传递这些项目。但是,count函数始终返回队列中的项目数,即使它们并不都满足谓词 ElseIf _consecutiveMeasurements.AsEnumerable().Count(Function(m) m <= Me.CriticalLowLevel) = Conse

我正在监测激光器的功率,我想知道n个连续测量值何时超出安全范围。我有一个
队列(Double)
,它在被检查时有n个项目(在我的示例中为2个)。我想检查队列中的所有项目是否满足一个条件,因此我通过带有谓词的
Count()
传递这些项目。但是,count函数始终返回队列中的项目数,即使它们并不都满足谓词

ElseIf _consecutiveMeasurements.AsEnumerable().Count(Function(m) m <= Me.CriticalLowLevel) = ConsecutiveCount Then
    _ownedISetInstrument.Disable()
    ' do other things

ElseIf\u continuentivemeasurements.AsEnumerable().Count(函数(m)m根据调试快照,您的两个度量值似乎都小于598.0的临界级别,因此我希望计数与队列长度匹配


这两个数据点都是我。仍然表现出这种行为的CriticalLowLevel?

我认为你在文本中犯了一个错误-从第三行到最后一行不应该说
,它们都低于CriticalLowLevel
?我想我遗漏了一些简单的东西…Doh!发生在我们当中最好的人身上:-)