Page 1 of 2

DC_GetColArray() - suggestion

Posted: Mon Sep 07, 2015 9:30 am
by Tom
Hi, Roger.

I do use DC_GetColArray() intensively in the DATA codeblocks of all my array browers. But if those arrays are empty, maybe in a statistics module, all DC_GetColArray()-calls return empty strings. So now, I have to catch the length of the array source inside all codeblocks (DATA {||IF(Len(oBrowse:dataSource)>0,"--",DtoC(DC_GetColArray(1,oBrowse)))}), which is not very elegant. What about a forth parameter setting a DEFAULT value?

Code: Select all

FUNCTION DC_GetColArray( nElement, oBrowse, xVar, xDefault ) // here

LOCAL aArray, nPointer, xValue

DEFAULT xDefault := '' // here

aArray   := oBrowse:dataSource
nPointer := oBrowse:arrayElement

IF nPointer > Len(aArray) .OR. nPointer = 0
  RETURN xDefault // and here
ENDIF

IF nElement == NIL
  RETURN aArray[nPointer]
ELSEIF nElement <= 0
  RETURN nPointer
ENDIF

xValue := aArray[nPointer,nElement]

IF Valtype(xVar) == Valtype(xValue) // should work anyway
  aArray[nPointer,nElement] := xVar
ENDIF

RETURN aArray[nPointer,nElement]
My codeblocks could changed to this with a default for DC_GetColArray():

Code: Select all

DATA {||DtoC(DC_GetColArray(1,oBrowse,,EmptyDate()))}

Re: DC_GetColArray() - suggestion

Posted: Mon Sep 07, 2015 10:06 am
by rdonnay
Tom -

That sounds like a good idea.
Did you test that code?
If so, I will copy it into my source for the next release.

Roger

BTW - Just upgraded my firmware in my Phantom 3 to support Way Points.
Going out today to test it. Today is a holiday here in the U.S. - Labor Day.

Re: DC_GetColArray() - suggestion

Posted: Mon Sep 07, 2015 10:19 am
by Tom
Hi, Roger.

No, I didn't test this. I will do in the next days.

I'm going to install the P3 update on the weekend. Not only waypoints, but a relative flight mode and, wow!, "follow me". I'm going to find a cool location where I'm going to ride a bike and let the phantom fly behind. By the way, did you recognize that the camera will be able to shoot 2.7-K-videos with the update? That's quite cool!

Re: DC_GetColArray() - suggestion

Posted: Mon Sep 07, 2015 10:27 am
by rdonnay
Not only waypoints, but a relative flight mode and, wow!, "follow me".
I know. This is cool stuff if it works.
By the way, did you recognize that the camera will be able to shoot 2.7-K-videos with the update? That's quite cool!
I saw that. I guess we are professionals now.

Re: DC_GetColArray() - suggestion

Posted: Mon Sep 07, 2015 10:30 am
by Tom
I guess we are professionals now.
We are anyway. ;)

But. Mmh. If you say "She's a professional" in german, that has a very special meaning.

Re: DC_GetColArray() - suggestion

Posted: Mon Sep 07, 2015 10:34 am
by rdonnay
But. Mmh. If you say "She's a professional" in german, that has a very special meaning.
I hadn't thought of that. Ha.

I'm heading out now to my daughter's house. There's a lot of space out there to test out the new features.
Gonna strap the Phantom to my trike.

Re: DC_GetColArray() - suggestion

Posted: Tue Sep 08, 2015 8:16 pm
by RDalzell
I am a big fan of the "Point of Interest"

Nice to see the feature set available to the Phantom 2 being brought forth to the 3.

Also, our Police Department just received our Aircraft Registration number from the FAA and will soon receive our official COA (required for government entity).

Been logging a lot of flight hours between my Phantom 3 and the Walkera Runner 250 (which you actually have to fly compared to the DJI).

Re: DC_GetColArray() - suggestion

Posted: Wed Sep 09, 2015 7:32 am
by rdonnay
Hi Rick -

Well I loaded the software, but haven't had a chance to figure out the waypoint system yet.
No documentation.

I'm leaving on a 3-week trip tomorrow.

Going to see family, then on to Terry Wolfe's place followed by a weekend with Jim Graham on the lake.

Then on to my Navy reunion. I will capture lots of videos of my trip.

Re: DC_GetColArray() - suggestion

Posted: Thu Sep 10, 2015 4:55 pm
by RDalzell
Enjoy your trip, if passing through the Windy City, I would love to have dinner again.

Re: DC_GetColArray() - suggestion

Posted: Fri Sep 11, 2015 4:54 am
by rdonnay
I'm headed to minnesota and on to upstate ny. Not going thru Chicago. Wish you could come to Arizona devcon.