661 views
in GUI Development by

Hello,

for my project I want to show some values in a chart. For this reason I have to transfer an array from my system to my gui. I looked at the EW guide how to do this. I use a slot method to do this and added the following code,

/* 'C' function for method : 'Application::SpecScreen.AddRecords()' */
void ApplicationSpecScreen_AddRecords( ApplicationSpecScreen _this, XObject sender )
{
  XInt32 size;
  XInt32 i;

  /* Dummy expressions to avoid the 'C' warning 'unused argument'. */
  EW_UNUSED_ARG( sender );

  felder = 10;
  i = 0;
  ChartsRecordList_ClearList( &_this->Records );

  for (; i < size; i = i + 1 )
  {
    XInt32 val;
    val= pixel_readout_values[i];
    _this->pixelvalues_gui[ EwCheckIndex( i, 4 )] = val;
  }
}

But it seems that there is something wrong with my for loop. Because GUI stops working and it's never leaving the loop.

 

Have a nice weekend.

Alex

1 Answer

0 votes
by

Hello,

the code above is generated by Embedded Wizard or have you written the code manually? I ask this because the local variable size is not initialized. Accordingly the condition in the for-loop will not work as expected.

Best regards

Paul Banach

by

Hello Paul,

this code is generadted by Embedded Wizard. You can see the code I wrote in EW below.

 

var int32 felder =10;
var int32 i =0;

Records.ClearList();

for (; i < felder; i = i + 1)
{
  var int32 val;

  native(i, val)
  {
    val= pixel_readout_values[i];

  }
pixelvalues_gui[i] = val;
}

Best regards

Alex

by

Hello Alex,

hmm ... the source code seems to not to match the generated code. The generated code has a local variable size while the source code has a local variable felder. Usually Embedded Wizard takes over the original variable names as defined in the source code. Can you check, whether the generated code file is actual?

Best regards

Paul Banach

by
Oh, yes that are different versions. In Ew and at the code, it's the same variable.

Now it works. It seems that I messed it up with the array size, but I didn't got any error.

Thank you
by
Are you able to restore the erroneous code? It would be interesting for us to verify whether there is problem in code generation?

Thanks

Paul Banach

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

...