Home > Back-end >  Strives for the array subscript change query records
Strives for the array subscript change query records

Time:01-04

Recently to do a computer drawing program, a machine under a frame data and drawing depth information to the upper machine, general idea is to share a data array, when drawing program full screen record label under array at the moment, and then move into the array, behind the acquisition of data from the drawing at the bottom of the box drawing array data below label above,
 
//below is the main acquisition dialog
Float arr [10000] [13].//main program using the global variable array is used to draw all data
Int dat_num=0; Many frames//said collected data;

//main program acquisition data given array
Void CoilDlg: : convert_data

Dbv1 [12]=deep_nm;//12th is depth information, front 0
- 11 is a collection of datafor(int i=0; i<13; I++)
Arr [dat_num] [I]=dbv1 [I];//12 drawing data

//the following is a separate new mapping dialog box, use the message mechanism, main dialog box every frame data mapping dialog box drawing time,
Void Ccurve: : addcurve

Extern float arr [10000] [13].//use the dialog to array
Int turn_page=0; How many times//said drawing page
Int aa=0;//said the current page need graphics data in the array subscript

W=rect1. Width ();//drawing size dialog
H=rect1. Height ();
for(int i=0; i<=data - aa; I++)/here/data is the data acquisition frames dat_num;
{
(point [I]). X=(arr [data - I] [j] - picline [j]. J return_min ())/(picline [j]. J return_max () - picline [j]. J return_min ()) * 6 + Tite_W Tite_W/* (z - 3)/6 + left_W;
(point [I]) Y=H - (deepth - 400 * turn_page - arr [data - 1 - I] [12]) * H/400;//set the mapping coordinates sure
}
G.D rawCurve (pen point, data - aa, 1.0 f);//drawing,
//the part separate operation no problem, can realize the normal dynamic drawing,

//the following a few words to achieve paging capabilities, drawing from the bottom of the dialog box to draw up, full screen, 400 points, when painting the top again from the bottom to painting, at this time I want to record the depth data array subscript data, but can't record, once the aa=data process error; No it can run normally, but after the full screen can't draw!
Int xx=H - (deepth - 400 * turn_page - arr [data - 1] to [12]) * H/400;//data in the drawing box Y pixel coordinate
If (xx<=H/400//400 points, one screen at the last point coordinates has been to the top when one point is ready to turn screen
{
Turn_page + +;
Aa=data;//want to record screen when subscript position, again drawing collection of data will only be back above the subscript
part of data}


Depth information is below to read an array subscript when assignment error problem, normal I this is 6 seconds a frame data, access conflict should not be, I am drawing messages sent back in data into an array and array assignment is 6 seconds after the next to, how should be finished drawing,

CodePudding user response:

This is usually an array, you two dimensional array of dat_num on the top of the cycle is the assignment? You of I, j loop there feel there is a problem, the first layer of the for loop is your first dimensional array arr, equivalent to your page number, the second is your drawing of a previous page data, i CodePudding user response:

reference 1st floor み し つ か ん response:
this is usually an array, you two dimensional array of dat_num on the top of the cycle is the assignment? You of I, j loop there feel there is a problem, the first layer of the for loop is your first dimensional array arr, equivalent to your page number, the second is your drawing of a previous page data, i

The question now is I can't record aa=data; As long as there is this sentence even if i
  • Related