Thread: [Pvmanager-devel] Data conversion from scalar to array
Brought to you by:
carcassi,
epics-jenkins
From: Carcassi, G. <car...@bn...> - 2010-12-07 15:53:29
|
Hi all, Since Epics3 does not distinguish between scalars and array, PVManager does and PVAcces does/will, I am wondering whether we should support (or not) automatic conversion between them. That is: if I ask for a VDouble, but the native type is an array VDoubleArray, should I automatically return a VDouble with the first element or return a type mismatch error? If I ask for a VDoubleArray, but the native type is a VDouble, should I return a VDoubleArray with an array of size 1 or return a type mismatch error? My hunch is to not make these conversions by default, but to provide (if needed), an operation that does such conversion... this way the user can do it but it's an explicit operation. Agree? Disagree? Gabriele |
From: Marty K. <mrk...@co...> - 2010-12-07 17:50:37
|
On 12/07/2010 10:53 AM, Carcassi, Gabriele wrote: > > Hi all, > > Since Epics3 does not distinguish between scalars and array, PVManager > does and PVAcces does/will, I am wondering whether we should support > (or not) automatic conversion between them. That is: if I ask for a > VDouble, but the native type is an array VDoubleArray, should I > automatically return a VDouble with the first element or return a type > mismatch error? If I ask for a VDoubleArray, but the native type is a > VDouble, should I return a VDoubleArray with an array of size 1 or > return a type mismatch error? > > My hunch is to not make these conversions by default, but to provide > (if needed), an operation that does such conversion... this way the > user can do it but it's an explicit operation. > > Agree? Disagree? > I vote for type mismatch error. Marty > > Gabriele > > > ------------------------------------------------------------------------------ > What happens now with your Lotus Notes apps - do you make another costly > upgrade, or settle for being marooned without product support? Time to move > off Lotus Notes and onto the cloud with Force.com, apps are easier to build, > use, and manage than apps on traditional platforms. Sign up for the Lotus > Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d > > > _______________________________________________ > Pvmanager-devel mailing list > Pvm...@li... > https://lists.sourceforge.net/lists/listinfo/pvmanager-devel |
From: Ralph L. <Ral...@be...> - 2010-12-08 09:49:32
|
On 07.12.2010 19:00 Marty Kraimer wrote: > On 12/07/2010 10:53 AM, Carcassi, Gabriele wrote: >> That is: if I ask for a VDouble, but the native type is an array >> VDoubleArray, should I automatically return a VDouble with the first >> element or return a type mismatch error? If I ask for a VDoubleArray, >> but the native type is a VDouble, should I return a VDoubleArray with >> an array of size 1 or return a type mismatch error? >> >> >> >> My hunch is to not make these conversions by default, but to provide >> (if needed), an operation that does such conversion… this way the >> user can do it but it’s an explicit operation. >> >> >> >> Agree? Disagree? >> > > I vote for type mismatch error. +1 ~Ralph |
From: Dalesio, L. <da...@bn...> - 2010-12-08 14:29:11
|
+2 -----Original Message----- From: Ralph Lange [mailto:Ral...@be...] Sent: Wed 12/8/2010 4:49 AM To: pvm...@li... Subject: Re: [Pvmanager-devel] Data conversion from scalar to array On 07.12.2010 19:00 Marty Kraimer wrote: > On 12/07/2010 10:53 AM, Carcassi, Gabriele wrote: >> That is: if I ask for a VDouble, but the native type is an array >> VDoubleArray, should I automatically return a VDouble with the first >> element or return a type mismatch error? If I ask for a VDoubleArray, >> but the native type is a VDouble, should I return a VDoubleArray with >> an array of size 1 or return a type mismatch error? >> >> >> >> My hunch is to not make these conversions by default, but to provide >> (if needed), an operation that does such conversion. this way the >> user can do it but it's an explicit operation. >> >> >> >> Agree? Disagree? >> > > I vote for type mismatch error. +1 ~Ralph ------------------------------------------------------------------------------ What happens now with your Lotus Notes apps - do you make another costly upgrade, or settle for being marooned without product support? Time to move off Lotus Notes and onto the cloud with Force.com, apps are easier to build, use, and manage than apps on traditional platforms. Sign up for the Lotus Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d _______________________________________________ Pvmanager-devel mailing list Pvm...@li... https://lists.sourceforge.net/lists/listinfo/pvmanager-devel |
From: Dalesio, L. <da...@bn...> - 2010-12-08 14:36:33
|
OTOH, a scalar could be brought into a matrix multiplication to enable or disable - a scalar of one or two. I change my vote - it should convert to an array of 1 element. -----Original Message----- From: Dalesio, Leo Sent: Wed 12/8/2010 9:28 AM To: Ralph Lange; pvm...@li... Subject: Re: [Pvmanager-devel] Data conversion from scalar to array +2 -----Original Message----- From: Ralph Lange [mailto:Ral...@be...] Sent: Wed 12/8/2010 4:49 AM To: pvm...@li... Subject: Re: [Pvmanager-devel] Data conversion from scalar to array On 07.12.2010 19:00 Marty Kraimer wrote: > On 12/07/2010 10:53 AM, Carcassi, Gabriele wrote: >> That is: if I ask for a VDouble, but the native type is an array >> VDoubleArray, should I automatically return a VDouble with the first >> element or return a type mismatch error? If I ask for a VDoubleArray, >> but the native type is a VDouble, should I return a VDoubleArray with >> an array of size 1 or return a type mismatch error? >> >> >> >> My hunch is to not make these conversions by default, but to provide >> (if needed), an operation that does such conversion. this way the >> user can do it but it's an explicit operation. >> >> >> >> Agree? Disagree? >> > > I vote for type mismatch error. +1 ~Ralph ------------------------------------------------------------------------------ What happens now with your Lotus Notes apps - do you make another costly upgrade, or settle for being marooned without product support? Time to move off Lotus Notes and onto the cloud with Force.com, apps are easier to build, use, and manage than apps on traditional platforms. Sign up for the Lotus Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d _______________________________________________ Pvmanager-devel mailing list Pvm...@li... https://lists.sourceforge.net/lists/listinfo/pvmanager-devel |
From: Carcassi, G. <car...@bn...> - 2010-12-08 15:52:36
|
Based on feedback and further thinking, here's where I am right now: * Data conversion should not be in the datasource. It's a mess otherwise: people implementing the epics3, epics4, simulation or whatever implement thing differently... (There are caveats in term of performance optimization, but I don't think they change the general rule) * What is a valid conversions is somewhat specific to the task at hand, so it is better to be explicit. Explicit should not mean onerous. So: vDouble("mypv") - means a VDouble and only a VDouble numericScalar("mypv") - means any scalar value and is converted to a VDouble numericValueOf("myPv") - means any scalar, array or multichannel array, take the first element and convert to a VDouble all return VDouble and the user can choose what is more appropriate. So, PVManager user side can choose, DataSource implementor only returns the native type, those operators take care of making the client-side conversion so that it always works regardless of implementation. And everybody is (hopefully) happy... Gabriele |