Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Dashboard Help C++ Windriver (http://www.chiefdelphi.com/forums/showthread.php?t=80249)

ranc 15-01-2010 15:26

Dashboard Help C++ Windriver
 
In windriver 2010 image demo, It seems that clusters are created using dash.AddCluster();. Yet in labview, in the image box, the output cluster is divided into 3 parts using the operation unbundle by name. Going back to the windriver code (shown beneath) There is no name assigned to each cluster. There is only a comment on the side, which the compiler can't see.

How does Unbundle by name work if the data doesn't have an assigned name?

-Thanks

void DashboardDataSender::sendVisionData(double joyStickX,
double gyroAngle,
double gyroRate,
double targetX,
vector<Target> targets) {
if (visionTimer->Get() < 0.1)
return;
visionTimer->Reset();
Dashboard &dash = DriverStation::GetInstance()->GetHighPriorityDashboardPacker();
dash.AddCluster(); // wire (2 elements)
{
dash.AddCluster(); // tracking data
{
dash.AddDouble(joyStickX); // Joystick X
dash.AddDouble(((((int)gyroAngle) + 360 + 180) % 360) - 180.0); // angle
dash.AddDouble(0.0); // angular rate
dash.AddDouble(targetX); // other X
}
dash.FinalizeCluster();
dash.AddCluster(); // target Info (2 elements)
{
dash.AddArray(); // targets
{
for (unsigned i = 0; i < targets.size(); i++) {
dash.AddCluster(); // targets
{
dash.AddDouble(targets[i].m_score); // target score
dash.AddCluster(); // Circle Description (5 elements)
{
dash.AddCluster(); // Position (2 elements)
{
dash.AddFloat((float) (targets[i].m_xPos / targets[i].m_xMax)); // X
dash.AddFloat((float) targets[i].m_yPos); // Y
}
dash.FinalizeCluster();

dash.AddDouble(targets[i].m_rotation); // Angle
dash.AddDouble(targets[i].m_majorRadius); // Major Radius
dash.AddDouble(targets[i].m_minorRadius); // Minor Radius
dash.AddDouble(targets[i].m_rawScore); // Raw score
}
dash.FinalizeCluster(); // Position
}
dash.FinalizeCluster(); // targets
}
}
dash.FinalizeArray();

dash.AddU32((int) 0);

}
dash.FinalizeCluster(); // target Info
}
dash.FinalizeCluster(); // wire
dash.Finalize();
}


All times are GMT -5. The time now is 13:46.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi