Пример #1
0
void
_gogogo() {
	init_begining();
	read_data();
	init_second();
	grid_make();
    // grid_check(10.); 
    // A[0] = 10*M_PI/180;
    // A[1] = 60*M_PI/180;
    // B[0] = 10*M_PI/180;
    // B[1] = 60*M_PI/180;
    // R[0] = 10;
    // R[1] = 250;
    
    ////
	R_max_find_par();
	R_max_find_ort();
	count(); 
    write_cyl(&cyl_par, output_par);
    write_cyl(&cyl_ort, output_ort);

    FILE *F1, *F2, *F3, *F4;
    F1 = fopen("count_par.dat", "w");
    F2 = fopen("count_ort.dat", "w");
    F3 = fopen("rmax.dat", "w");
    F4 = fopen("grid.dat", "w");
    int i, k; 
    for(i=0; i<N; i++) {
        for( k=0; k<grid_n; k++ ) {
            fprintf( F1, " %d ", cyl_par.m[i][k] );
            fprintf( F2, " %d ", cyl_ort.m[i][k] );
        }
        fprintf( F1, "\n" );
        fprintf( F2, "\n" );
    }
    for(i=0; i<N; i++) {
        fprintf( F3, "%lf %lf %lf ", p[i][0], p[i][1], p[i][2] ); 
        fprintf( F3, "%lf ", cyl_ort.R_max[i] );
        fprintf( F3, "%lf ", cyl_par.R_max[i] );
        fprintf( F3, "\n");
    }
    for( k=0; k<grid_n; k++ ) {
        fprintf( F4, "%lf \n", grid[k] );
    }
    fclose(F1);
    fclose(F2);
    fclose(F3);
    fclose(F4);

    // write_rmax();
}
Пример #2
0
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
    switch(msg)
    {
    case WM_CREATE:
    {
        SendMessage(hwnd, (UINT)WM_SETICON, (WPARAM)ICON_BIG, (LPARAM)LoadIcon(hInst, MAKEINTRESOURCE(ICON_MAIN)));
        init(hwnd);
        return 0;
    }
    case WM_INITDIALOG:
    {
    }
    case WM_DESTROY:
    {
        if (tempFolder != NULL) {
          StripSlash(tempFolder);
          DeleteFolder(tempFolder);
        }
        PostQuitMessage(0);
        return 0;
    }
    case WM_COMMAND:
    {
      if (lParam == (LPARAM)CButton->Wnd) {
        pages = NULL;
        SendMessage(hwnd, WM_CLOSE, 0, 0);
      } else if (pages != NULL) {
        if ((DWORD)lParam == (DWORD)langlist->Wnd) {
          if (CBN_SELCHANGE == HIWORD(wParam)) {
            delete language->setCurrentByLabel(langlist->getCurText());
            controls->setCurLanguage();
          }
//      } else if (lParam == (LPARAM)CButton->Wnd) {
//        SendMessage(hwnd, WM_DESTROY, 0, 0);
        } else if (Accept->event(hwnd, wParam, lParam)) {
          return 0;
        } else if (NoAccept->event(hwnd, wParam, lParam)) {
          return 0;
        } else if (pages->nextButton->event(hwnd, wParam, lParam)) {
          return 0;
        } else if (pages->prevButton->event(hwnd, wParam, lParam)) {
          return 0;
        }
      }
    }
   case WM_TIMER:{
     switch (wParam) {
       case TIMER_START: {
         KillTimer(hwnd,TIMER_START);
         init_second(hwnd);
         return 0;
       }
       case TIMER_STEP1: {
         KillTimer(hwnd,TIMER_STEP1);
         runIt(hwnd,1);
         return 0;
       }
       case TIMER_STEP2: {
         KillTimer(hwnd,TIMER_STEP2);
         runIt(hwnd,2);
         return 0;
       }
     }
   }
    }
    return DefWindowProc(hwnd, msg, wParam, lParam);
}