440 views
in Embedded Wizard Studio by

Hello Paul,

        I have an image problem.

       First,I can find the data right by debugging ,This image can be obtained by excel 

       Then,this is my CalculatePath code..The x.data and y1.data are correct.

       But this figure hasn't shown .and,How should I call the function

 

Best regards,

Tonny

1 Answer

0 votes
by

Hello Tonny,

it is difficult to give you the right advice what is going wrong. What do you mean with 'hasn't shown'? Do you see nothing? Or other shape is shown? As first step I would use the integrated debugging functionality to trace the Path.Begin() and Path.AddLine() invocations. For this purpose adapt the code as shown below:

[...]

if ( x == 0.0 )
{
  Path.Begin( 0, 20, 350 );
  trace "Execute: Begin()", 20, 350;
}

Path.AddLine( 0, x + 96.0, y1 );
trace "Execute: AddLine()", x + 96.0, y1;

[...]

The trace outputs appear in Log window. Analyse the outputs. Do the outputs confirm, the values are really correct? You can also copy the contents from the Log window and post these in this thread so I can take a look at it.

Regarding the method Begin(), it is intended to set the position for the first point in the path. Please see the documentation Store data in a sub-path. Usually, this method is invoked only at the begining of the path construction. In your application, you invoke the method each time the value x == 0.0. Doing this discards all the previously stored path data. Maybe, this is your problem? Remove the Begin() invocation from the loop and execute it before the loop enters. For example:

// The start position of the path
Path.Begin( 0, x_start, y_start );

// The positions of the following line segments
for ( ... )
{
  Path.AddLine( 0, x_next, y_next );
}

I assume, you have a Stroked Path view in your GUI component. And this view is connected with the Path data object. Can you verify this? Without the connection, the view has no knowledge what to show. Furthermore, check the property Offset and FlipY of the Stroked Path view. With these properties you determine the position within the view where the Path Data coordinate x=0.0 and y=0.0 are mapped. If not correctly configured, the path may appear 'outside' of the visible Stroked Path View area.

Does it help you further?

Best regards

Paul Banach

by

Hello Paul,

    I tried your way to verify the data ,The data are all correct.In the excel,it can formed this figure.

On the embedded wizard,Just as code ,i will add 96 for x,and magnify the value of y by 100 times,as shownYes,the data are all correct, but the image was never correct,how do i define Path.Begin() and Path.AddLine()? 

  

Best regards,

Tonny

by

Hello Tonny,

Have you tried to move Begin() outside of the while-loop as indicated in my answer? Actually, Begin() is executed for each data containing x == 0.0. As I have explained above, doing this discards all the previously collected path data. Begin() should be called only once for the first coordinate. Then you call AddLine() for each next following coordinate.

Best regards

Paul Banach

by
Hello Paul,

  Thank for your help.Listen to your opinion ,I've solved it .Thank you.

Best regards,

Tonny
by
That sounds good!

Best regards

Paul

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...