1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 <2016> 2017 2018 2019 2020 2021 2022 2023 2024 | Index | 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 <2016> 2017 2018 2019 2020 2021 2022 2023 2024 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: areaDetector with 'empty' array output |
From: | Phil Atkin <[email protected]> |
To: | Mark Rivers <[email protected]>, "[email protected]" <[email protected]> |
Date: | Mon, 25 Jul 2016 15:16:56 +0100 |
Perhaps a better example: suppose we want to plot the events as each camera frame is processed? If there are no events, we want to clear the display. Phil On 25/07/2016 13:44, Mark Rivers wrote:
I'm not sure I understand the question. If count is 0 then is there any point in allocating the NDArray and doing callbacks? Do you still want to pass NDAttributes to downstream plugins? If not, then why not just skip the NDArray allocation and callbacks when count is 0? Mark ________________________________ From: [email protected] [[email protected]] on behalf of Phil Atkin [[email protected]] Sent: Monday, July 25, 2016 5:35 AM To: [email protected] Subject: areaDetector with 'empty' array output Hi, My areaDetector plugin has an option to generate an array containing a 'list' of events. In pseudocode, it does something like the following in the processCallbacks method: if (this->pArrays[0]) { this->pArrays[0]->release(); this->pArrays[0] = NULL; } this->unlock(); // Copy the events list to the output array size_t count = events.size(); dims[xDim] = count; dims[yDim] = 3; // x, y and type this->pArrays[0] = pNDArrayPool->alloc(2, dims, NDFloat32, 0, nullptr); this->pArrays[0]->timeStamp = pArray->timeStamp; this->pArrays[0]->epicsTS = pArray->epicsTS; this->pArrays[0]->uniqueId = pArray->uniqueId; pArray->pAttributeList->copy(this->pArrays[0]->pAttributeList); this->lock(); // [Set some parameter values, including NDArraySizeX,Y,Z] this->getAttributes(this->pArrays[0]->pAttributeList); this->unlock(); doCallbacksGenericPointer(this->pArrays[0], NDArrayData, 0); this->lock(); callParamCallbacks(); Currently I'm experiencing a crash if there are no events in the list. pNDArrayPool->alloc returns null if count is zero. I guess this is neither surprising nor unreasonable, but it leaves me with the question of what I should (and should not) do if the list is empty. I somehow need to 'output' something, otherwise plugins downstream won't be called, will they? Thanks in advance, Phil -- [cid:[email protected]]Pixel Analytics is a limited company registered in England. Company number: 7747526; Registered office: 93A New Road, Haslingfield, Cambridge CB23 1LP --
Pixel Analytics is a limited company registered in England. Company number: 7747526; Registered office: 93A New Road, Haslingfield, Cambridge CB23 1LP |