風(fēng)力發(fā)電機(jī)組仿真軟件源代碼后_第1頁(yè)
風(fēng)力發(fā)電機(jī)組仿真軟件源代碼后_第2頁(yè)
風(fēng)力發(fā)電機(jī)組仿真軟件源代碼后_第3頁(yè)
風(fēng)力發(fā)電機(jī)組仿真軟件源代碼后_第4頁(yè)
風(fēng)力發(fā)電機(jī)組仿真軟件源代碼后_第5頁(yè)
已閱讀5頁(yè),還剩25頁(yè)未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

//WindmillWork.cpp:Definestheclassbehaviorsforthe#include"stdafx.h"#include#ifdef#definenewDEBUG_NEW#undefTHIS_FILEstaticcharTHIS_FILE[]=FILE;//CWindmillWorkApp//NOTE-theClassWizardwilladdandremovemapmacros DONOTEDITwhatyouseeintheseblocksofgenerated//CWindmillWorkAppconstruction{//TODO:addconstructioncode//Placeallsignificantinitializationin}//TheoneandonlyCWindmillWorkAppobjectCWindmillWorkApptheApp;//CWindmillWorkAppinitialization{ Gdiplus::GdiplusStartupInputgdiplusStartupInput;Gdiplus::GdiplusStartup(&m_gdiplusToken,&gdiplusStartupInput,NULL); returnCWinApp::InitInstance();//Standard//Ifyouarenotusingthesefeaturesandwishtoreducethe ofyourfinalexecutable,youshouldremovefromthe thespecificinitializationroutinesyoudonotneed.#ifdef_AFXDLL //CallthiswhenusingMFCinasharedDLL //CallthiswhenlinkingtoMFCm_pMainWnd=&dlg;intnResponse=dlg.DoModal();if(nResponse==IDOK){//TODO:Placecodeheretohandlewhenthedialog dismissedwith}elseif(nResponse=={//TODO:Placecodeheretohandlewhenthedialog dismissedwith}//Sincethedialoghasbeenclosed,returnFALSEsothatweexit application,ratherthanstarttheapplication'smessagepump.returnFALSE;}int{//TODO:Addyourspecializedcodehereand/orcallthebaseclassreturn}//TitleClass.cpp:implementationfile#include"stdafx.h"#include"TitleClass.h"#ifdef_DEBUG#definenewDEBUG_NEW#undefTHIS_FILEstaticcharTHIS_FILE[]=FILE;//CTitleClass{}{}BEGIN_MESSAGE_MAP(CTitleClass,//CTitleClassmessagevoid{CPaintDCdc(this);//devicecontextfor//TODO:AddyourmessagehandlercodehereCRectrect;CBrushbrush;//HBITMAPm_Mybitmap;//背景 m_Mybitmap= CDCmemDC;CBitmappatibleBitmap(&dc,rect.Width(),rect.Height());//創(chuàng)建GDI+對(duì)GraphicsLinearGradientBrushlinGrBrush(ValRect,Color(255,32,115,Color(255,177,206,250),LinearGradientModeVertical);gc.FillRectangle(&linGrBrush,ValRect);StringFormatstrFormat(StringFormatFlagsNoClip);SolidBrushstringPen(Color(255,0,0,0));FontFamilyff(L"宋體");Fontf(&ff,(float)(rect.Height()/1.5),UnitPixel);wchar_twstr[50]={0}; //DonotcallCStatic::OnPaint()forpainting}//WindmillWorkDlg.cpp:implementation#include"stdafx.h"#include"GLFont.h"#include#include"vgwin.h"#include"vgfx.h"#ifdef#definenewDEBUG_NEW#undefTHIS_FILEstaticcharTHIS_FILE[]=FILE;//試驗(yàn)設(shè)置#include"TestSet.h"#include"Afxmt.h"#include"CurveDlg.h"http://CAboutDlgdialogusedforAppAboutCCriticalSectioncs;CGLFont WM_MY_VGSHOWWM_USER+1#defineORIGINX0.0f#defineORIGINY0.0f ZSTART=100.0f; RADIUS=250.0f;#defineH_RATE0.25f#defineZ_RATE(RADIUS*H_RATE*6.2831853f///風(fēng)車六度坐標(biāo)staticfloatobs_x=(ORIGINX+RADIUS),obs_y=ORIGINY,obs_z=ZSTART,obs_h=0.0f,obs_p=0.0f,obs_r=0.0f;//staticfloat//風(fēng)車六度坐標(biāo)值staticfloathsin,hcos;staticfloatpsin,pcos;//staticfloatsin_h,staticfloathead_x,head_y,head_z,head_h,head_p,staticfloathead_all_x,head_all_y,head_all_z,head_all_h,head_all_p,head_all_r;staticfloathead11_x,head11_y,head11_z,head11_h,head11_p,head11_r;staticfloathead12_x,head12_y,head12_z,head12_h,head12_p,head12_r;staticfloathead13_x,head13_y,head13_z,head13_h,head13_p,head13_r;staticfloathead21_x,head21_y,head21_z,head21_h,head21_p,head21_r;staticfloathead22_x,head22_y,head22_z,head22_h,head22_p,head22_r;staticfloathead23_x,head23_y,head23_z,head23_h,head23_p,head23_r;staticfloathead31_x,head31_y,head31_z,head31_h,head31_p,head31_r;staticfloathead32_x,head32_y,head32_z,head32_h,head32_p,head32_r;staticfloathead33_x,head33_y,head33_z,head33_h,head33_p,head33_r;staticfloathead41_x,head41_y,head41_z,head41_h,head41_p,head41_r;staticfloathead42_x,head42_y,head42_z,head42_h,head42_p,head42_r;staticfloathead43_x,head43_y,head43_z,head43_h,head43_p,head43_r;staticfloathead51_x,head51_y,head51_z,head51_h,head51_p,staticfloathead52_x,head52_y,head52_z,head52_h,head52_p,head52_r;staticfloathead53_x,head53_y,head53_z,head53_h,head53_p,head53_r;staticfloathead61_x,head61_y,head61_z,head61_h,head61_p,head61_r;staticfloathead62_x,head62_y,head62_z,head62_h,head62_p,head62_r;staticfloathead63_x,head63_y,head63_z,head63_h,head63_p,head63_r;staticfloathead71_x,head71_y,head71_z,head71_h,head71_p,head71_r;staticfloathead72_x,head72_y,head72_z,head72_h,head72_p,head72_r;staticfloathead73_x,head73_y,head73_z,head73_h,head73_p,head73_r;staticfloathead81_x,head81_y,head81_z,head81_h,head81_p,head81_r;staticfloathead82_x,head82_y,head82_z,head82_h,head82_p,head82_r;staticfloathead83_x,head83_y,head83_z,head83_h,head83_p,head83_r;staticfloatyi1_x,yi1_y,yi1_z,yi1_h,yi1_p,yi1_r;staticfloatyi2_x,yi2_y,yi2_z,yi2_h,yi2_p,yi2_r;staticfloatyi3_x,yi3_y,yi3_z,yi3_h,yi3_p,staticfloat vgFx*pRainFx;voidvoidvoidInitRainFX(){floatpRainFx=vgNewFx(VGFX_CUSTOM);vgName(pRainFx,"Rain");vgProp(pRainFx,VGFX_ALPHA,1.0vgProp(pRainFx,VGFX_AUTO,VGFX_RESTART);//VG_OFFvgProp(pRainFx,VGFX_DURATION,VGFX_ALWAYS);vgProp(pRainFx,VGFX_FADEDUR,1);vgPosition*pos=NULL;pos=vgNewPos();vgFxScale(pRainFx,2.5,2.5,2.5vgProp(pRainFx,VGFX_STARTTIME,VGFX_NOW);vgProp(pRainFx,VGFX_XFORMDLIST,VGFX_NOHPR);vgProp(pRainFx,VGFX_NPARTICLES,5000);vgProp(pRainFx,VGFX_SRCRAD,50.0);vgProp(pRainFx,VGFX_SIZEVAR,0.18);vgProp(pRainFx,VGFX_COLORVAR,0.09);vgProp(pRainFx, , _SQUAREfloatct[5]={0.0,0.5,0.5,0.5,0.5vgAttrList(pRainFx,VGFX_CT,ct,1floatbBox[6]={0.0,0.0,0.0,0.0,0.0,0.0vgAttrList(pRainFx,VGFX_BBOX,bBox,1floatvVector[4]={0.0,0.0,0.0,-1.0};//-10vgAttrList(pRainFx,VGFX_VVECTOR,vVector,1);floatwVector[4]={0.0,10.0,0.0,0.0floatgVector[3]={0.0,0.0,(float)-9.8vgAttrList(pRainFx,VGFX_GVECTOR,gVector,1floatvRnd[2]={0.0,0.0vgAttrList(pRainFx,VGFX_VRANDOM,vRnd,1floatvSphere[2]={0.0,0.0vgAttrList(pRainFx,VGFX_VSPHERE,vSphere,1floatpsz[2]={0.0,0.05fvgAttrList(pRainFx,VGFX_PSZ,psz,1floatpst[2]={0.0,30.0vgAttrList(pRainFx,VGFX_PST,pst,1floattemp[2]={0.0,293.0vgAttrList(pRainFx,VGFX_TEMPERATURE,temp,1vgFxColor(pRainFx,0.627451f,0.627451f,0.627451f);vgProp(pRainFx,VGFX_LCYCLE,2.0);vgProp(pRainFx,VGFX_EMISSION,0.0);vgProp(pRainFx,VGFX_LIGHTING,VG_OFF);vgDelPos(pos);vgAddSceneFx(vgGetScene(0),pRainFx}staticvoid mon*chan,void*udata{ /*originalmatmode*/ wl,wr,wb, cl,cr,cb, *win;win=vgGetChanWin((vgChannel*)chan);vgGetWinSize(win,&wl,&wr,&wb,&wt);vgGetChanViewport((vgChannel*)chan,&cl,&cr,&cb,&ctcw=(cr-cl)*(wr-ch=(ct-cb)*(wt-wb);zbuf=glIsEnabled(GL_DEPTH_TEST);if(zbuf)glDisable(GL_DEPTH_TESTglGetIntegerv(GL_MATRIX_MODE,& mmode);glMatrixMode(GL_PROJECTION);gluOrtho2D(0,cw-1.1,0.0,ch-1.1);glMatrixMode(GL_MODELVIEW);glColor3f(0.5,0.5,0.5);restoredrawingstatebasicallyputitbackthewayitglMatrixMode(GL_PROJECTION); mmodeif(zbuf)glEnable(GL_DEPTH_TEST);}staticvoidCallBackOpenGLDraw(void*chan,void*data{ l,r,t,vgWindow*win=vgGetWin(0);vgGetWinSize(win,&l,&r,&b,&t);intwidth=r-l;intheight=t-zbuff=glIsEnabled(GL_DEPTH_TEST);pfDisable(PFEN_TEXTURE);glMatrixMode(GL_PROJECTION);gluOrtho2D(l,r,b,t);glColor4f(1.0,1.0,1.0,1.0 terPos2d(r-width*0.15,height/2.0f300.0f);//設(shè)置位置CStringwind_ang;wind_ang.Format("%10.2f",wind_ang風(fēng)機(jī)角度:wind_ango/s"; terPos2d(r-width*0.15,height/2.0f280.0f);//設(shè)置位置CStringyi1_ang;yi1_angA角度:yi1_ang;m_pGlFont-gterPos2d(r-width*0.15,height/2.0f+260.0f);//設(shè)置位置CStringyi2_ang;yi2_ang.Format("%10.2f",LB);yi2_angB角度:yi2_ang;m_pGlFont-gterPos2d(r-width*0.15,height/2.0f+240.0f);//設(shè)置位置CStringyi3_ang;yi3_ang.Format("%10.2f",LC);yi3_angC角度:yi3_ang;m_pGlFont-if}//exeCString{chars[256];CStringts,path;returnpath;}//DWORDWINAPIThreadSaveData(LPVOID{CWindmillWorkDlg*WorkDlg=(CWindmillWorkDlg*)v;CTimecTime=CTime::GetCurrentTime();CStringstr WorkDlg->m_DataFileName=GetAppPath()+strFILE*fpfopen(WorkDlg->m_DataFileName,"wb");//按當(dāng)前時(shí)間建立保存數(shù)據(jù)的文件intindex=0;if{fprintf(fp,"序號(hào),仿真時(shí)間,風(fēng)機(jī)偏航角,葉片旋轉(zhuǎn)位置1,葉片旋轉(zhuǎn)位置2,葉片旋轉(zhuǎn)位置3,葉片的實(shí)際槳距角1,葉片的實(shí)際槳距角2,葉片的實(shí)際槳距角3,葉片的期望槳距角1,葉片的期望槳距角2,葉片的期望槳距角3,葉片的變槳控制輸出1,葉片的變槳控制輸出2,葉片的變槳控制輸出3,風(fēng)機(jī)軸的轉(zhuǎn)角,風(fēng)機(jī)軸的轉(zhuǎn)速,發(fā)電機(jī)軸的轉(zhuǎn)角,發(fā)電機(jī)軸的轉(zhuǎn)速,有功功率輸出,}{return0;}while(1)//試驗(yàn)開{{}({}{while(WorkDlg-{fprintf(fp,"%d,",index++);}}}while(WorkDlg-{fprintf(fp,"%d,",index++);}return0;}//VG{CWindmillWorkDlg*dlg=(CWindmillWorkDlgvgInitWinSys(AfxGetInstanceHandle(), vgDefineSys("windmill.adf"vgAddFunc(vgGetChan(1),VGCHAN_POSTDRAW,BorderDrawCallback,NULL); dlg->m_Static_VgShow.ModifyStyle(WS_CLIPCHILDREN,0);while(!dlg->m_ExitType){vgSyncFrame();vgFrame();}return}//DWORDWINAPIThreadModelRun(LPVOID{CWindmillWorkDlg*WorkDlg=(CWindmillWorkDlg*)v;Engine*ep;double*dp=newdouble[1];if(!(ep=engOpen("\0"))){AfxMessageBox("引擎啟動(dòng)失敗!");returnFALSE;}//CStringstrPath=GetAppPath()+"wind_turbine_initialization.m";//初始化的M文strPath="run('"+strPath+"')";mxArrayArrayTest=engGetVariable(ep,"S_simulation_step");ArrayTest=engGetVariable(ep,"S_wind_velocity");ArrayTest=engGetVariable(ep,"S_wind_direction"); ArrayTest= mxSetPr(ArrayTest,&m_wind_type);//風(fēng)的類{}}//if(ep!=NULL){}return}}{{}M

CStringstrPath=GetAppPath()+"wind_turbine_control_system.m";//初始 strPath="run('"+strPath+"')";mxArray//

dp=(double*)mxGetPr(ArrayTest);ArrayTest=engGetVariable(ep,"P_yaw_angle");dp=(double*)mxGetPr(ArrayTest);WorkDlg->m_Data.m_yaw_angle=dp[0];L=dp[0];//%用于標(biāo)定1#葉片旋轉(zhuǎn)到的位置,[0,360]度,程序設(shè)定界面視景顯dp=(double*)mxGetPr(ArrayTest);LA=dp[0];用于標(biāo)定dp=(double*)mxGetPr(ArrayTest);LB=dp[0];用于標(biāo)定dp=(double*)mxGetPr(ArrayTest);LC=dp[0];dp=(double*)mxGetPr(ArrayTest);ArrayTest=engGetVariable(ep,"P_Blade2_pitch_angle");dp=(doubleArrayTest=engGetVariable(ep,"P_Blade3_pitch_angle");dp=(double1#葉片的期望槳距角,[-5,30]度,程序設(shè)定界面視景虛線顯示ArrayTest=engGetVariable(ep,"P_Blade1_expected_pitch_angle");dp=(double*)mxGetPr(ArrayTest);2#葉片與期望槳距角,[-5,30]度,程序設(shè)定界面視景虛線顯示ArrayTest=engGetVariable(ep,"P_Blade2_expected_pitch_angle");dp=(double*)mxGetPr(ArrayTest);3#葉片與期望槳距角,[-5,30]度,程序設(shè)定界面視景虛線顯示ArrayTest=engGetVariable(ep,"P_Blade3_expected_pitch_angle");dp=(double*)mxGetPr(ArrayTest);dp=(double*)mxGetPr(ArrayTest);dp=(double*)mxGetPr(ArrayTest);//%3#葉片的變槳控制輸出,程序設(shè)定界面文字顯示dp=(double*)mxGetPr(ArrayTest);風(fēng)機(jī)軸的轉(zhuǎn)角,[0,360]度,程序設(shè)定界面視景顯示ArrayTest=engGetVariable(ep,"P_windturbine_angle");dp=(double*)mxGetPr(ArrayTest);dp=(double*)mxGetPr(ArrayTest);發(fā)電機(jī)軸的轉(zhuǎn)角,[0,360]度,程序設(shè)定界面視景顯示ArrayTest=engGetVariable(ep,"P_generator_angle");dp=(double ArrayTest=engGetVariable(ep,"P_generator_angle_velocity");dp=(double有功功率輸出,[0,10]兆瓦,程序設(shè)定界面文字顯示ArrayTest=engGetVariable(ep,"P_power_output");dp=(double*)mxGetPr(ArrayTest);WorkDlg->m_Data.m_power_output=dp[0]; dp=(double*)mxGetPr(ArrayTest);}}//if(ep!={} deletereturn}classCAboutDlg:public{//Dialog//{{AFX_Denum{IDD=IDD_ABOUTBOX//ClassWizardgeneratedvirtualfunctionvirtualvoidDoDataExchange(CDataExchange* //DDX/DDV//Implementation{}voidCAboutDlg::DoDataExchange(CDataExchange*{}BEGIN_MESSAGE_MAP(CAboutDlg,//Nomessage//CWindmillWorkDlgdialog{//NotethatLoadIcondoesnotrequireasubsequentDestroyIconinWin32m_hIcon=AfxGetApp()->LoadIcon(IDR_MAINFRAME);mFilterGraph=NULL; ="";}voidCWindmillWorkDlg::DoDataExchange(CDataExchange*{DDX_Control(pDX,IDC_STATIC_UNITS,m_InterfaceUnits);DDX_Control(pDX,IDC_STATIC_TITLE,m_InterfaceTitle);}BEGIN_MESSAGE_MAP(CWindmillWorkDlg,ON_BN_CLICKED(IDC_BUTTON_SETTINGS,OnButtonSettings)ON_BN_CLICKED(IDC_BUTTON_RUN,OnButtonRun)ON_BN_CLICKED(IDC_BUTTON_PAUSE,OnButtonPause)ON_BN_CLICKED(IDC_BUTTON_VOER,OnButtonVoer)//CWindmillWorkDlgmessagehandlers{this- //Add itemto //IDM_ABOUTBOXmustbeinthesystemcommandrange.ASSERT((IDM_ABOUTBOX&0xFFF0)==IDM_ABOUTBOX);ASSERT(IDM_ABOUTBOX<0xF000); *pSys =GetSystem if(pSys!=NULL){CStringstrAbout;if(!strAbout.IsEmpty()){pSys->AppendpSys->Append(MF_STRING,IDM_ABOUTBOX,strAbout}}//Settheiconforthis Theframeworkdoesthis whentheapplication'smainwindowisnotadialogSetIcon(m_hIcon,TRUE); //SetbigiconSetIcon(m_hIcon,FALSE); //Setsmallicon//TODO:Addextrainitialization CStdioFilefp;if{returnFALSE;}CRectre;TitleRe.top=TitleRe.bottom=(long)(re.bottom*0.08);TitleRe.left=re.left;TitleRe.right=re.right;CRectUnitsRe;//UnitsRe.top=(long)(re.bottom-re.bottom*0.03);UnitsRe.bottom=(long)re.bottom;UnitsRe.left=re.left;UnitsRe.right=re.right;m_RunState=FALSE;m_ExitType=CRectrButton;rButton.top=TitleRe.bottom+TitleRe.Height()*0.1;rButton.bottom=TitleRe.bottom+TitleRe.Height()*0.5;rButton.left=+50;rButton.right=TitleRe.Height()+50;rButton.left=rButton.right+rButton.right=TitleRe.Height()+rButton.left;rButton.left=rButton.right+rButton.right=TitleRe.Height()+GetDlgItem(IDC_BUTTON_RUN)-rButton.left=rButton.right+rButton.right=TitleRe.Height()+rButton.left;rButton.left=rButton.right+rButton.right=TitleRe.Height()+rButton.left;rButton.left=rButton.right+rButton.right=TitleRe.Height()+rButton.left;rButton.left=rButton.right+rButton.right=TitleRe.Height()+rButton.left;//VGm_pGlFont=newCGLFont();CRectVGShowRe;VGShowRe.top=re.top+re.Height()*0.131;VGShowRe.bottom=re.bottom*0.973;VGShowRe.left=re.left;//+re.Width()*0.005VGShowRe.right=re.right;//-re.Width()*0.005m_Static_VgShow.ModifyStyle(0,WS_CLIPCHILDREN);//按return //return unlessyousetthefocustoa}void {if((nID&0xFFF0)=={}{}}

CAboutDlgdlgAbout;mand(nID,//Ifyouaddaminimizebuttontoyourdialog,youwillneedthecode todrawthe ForMFCapplicationsusing /view thisisautomaticallydoneforyoubytheframework.voidCWindmillWorkDlg::OnPaint(){if{CPaintDCdc(this);//devicecontextforpaintingSendMessage(WM_ICONERASEBKGND,( RAM)dc.GetSafeHdc(),0);//CentericoninclientintcxIcon=GetSystemMetrics(SM_CXICON);intcyIcon=GetSystemMetrics(SM_CYICON);CRectrect;intx=(rect.Width()-cxIcon+1)/2;inty=(rect.Height()-cyIcon+1)/}{}}

//Drawtheicondc.DrawIcon(x,y,m_hIcon);//Thesystemcallsthistoobtainthecursortodisplaywhiletheuser theminimizedHCURSOR{return(HCURSOR)}//調(diào)用試驗(yàn)設(shè)置void{//TODO:AddyourcontrolnotificationhandlercodehereCTestSetTestSet(this);{DWORDid;HANDLETID;//1CPU }}void{if(m_pGlFont!=delete//TODO:Addyourmessagehandlercodehere}//void{//TODO:AddyourcontrolnotificationhandlercodeheremSourceFile=GetAppPath()+"\\2.avi";GetDlgItem(IDC_BUTTON_INSTALLATION)-}//void{//TODO:Addyourcontrolnotificationhandlercodeherem_RunState=TRUE;DWORDid;HANDLETID;}voidCWindmillWorkDlg::OnSize(UINype,intcx,int{CDialog::OnSize(nType,cx,//TODO:Addyourmessagehandlercode}void{//TODO:Addyourcontrolnotificationhandlercodeherem_RunState=!m_RunState;if{}{}}

void{//TODO:Addextravalidationherem_ExitType=TRUE;}void{//TODO:Addyourcontrolnotificationhandlercodeherem_ExitType=TRUE;}void{//TODO:AddyourcontrolnotificationhandlercodehereCCurveDlgcruvedlg(m_DataFileName);}voidCWindmillWorkDlg::vgSize(intx,int{vgWindow*win=vgGetWin(0);vgWinSize(win,0, x,0,y);vgProp(win,VGWIN_WINBORDER,0);CRectre;CRectVGShowRe.top=re.top+re.Height()*0.131;VGShowRe.bottom=re.bottom*0.973;VGShowRe.left=re.left;//+re.Width()*0.005VGShowRe.right=re.right;//-re.Width()*0.005}void{static staticvgScene staticvgObject staticvgObject staticvgObject *windmill_11;staticvgObject *windmill_12;staticvgObject *windmill_13;staticvgObject *windmill_21;staticvgObject *windmill_22;staticvgObject *windmill_23;staticvgObject *windmill_31;staticvgObject *windmill_32;staticvgObject *windmill_33;staticvgObject *windmill_41;staticvgObject *windmill_42;staticvgObject *windmill_43;staticvgObject *windmill_51;staticvgObject *windmill_52;staticvgObject *windmill_53;staticvgObject *windmill_61;staticvgObject *windmill_62;staticvgObject *windmill_63;staticvgObject *windmill_71;staticvgObject *windmill_72;staticvgObject *windmill_73;staticvgObject *windmill_81;staticvgObject *windmill_82;staticvgObject *windmill_83;staticvgPlayer staticvgPlayer staticvgPosition staticvgPosition staticvgPosition staticvgPosition staticvgPosition staticvgPosition*heos11;staticvgPosition*heos12;staticvgPosition*heos13;staticvgPosition*heos21;staticvgPosition*heos22;staticvgPosition*heos23;staticvgPosition*heos31;staticvgPosition*heos32;staticvgPosition*hestaticvgPosition staticvgPosition staticvgPosition staticvgPosition staticvgPosition staticvgPosition staticvgPosition staticvgPosition staticvgPosition staticvgPosition staticvgPosition staticvgPosition staticvgPosition staticvgPosition staticvgPosition staticvgPosition staticvgPosition staticvgPosition staticvgPosition staticvgPosition staticvgObserver staticvgObserver *obser_small;static *hestaticvgPart staticvgPart static *hestatic *hestatic *hestatic *hestatic *hestatic *hestatic *hestatic *hestatic *hestatic *hestatic *hestatic *hestatic *hestatic *hestatic *hestatic *hestatic *hestatic *hestatic *hestatic *hestatic *hestatic *hestatic *hestatic *hestatic static static scene=vgFindScene("mainscenes");scene_small=vgFindScene("small_scen");windmill=vgFindObj("windmill");windmill_small=vgFindObj("sm_wind");windmill_11=vgFindObj("small_wind11");windmill_12=vgFindObj("small_wind12");windmill_13=vgFindObj("small_wind13");windmill_21=vgFindObj("small_wind21");windmill_22=vgFindObj("small_wind22");windmill_23=vgFindObj("small_wind23");windmill_31=vgFindObj("small_wind31");windmill_32=vgFindObj("small_wind32");windmill_33=vgFindObj("small_wind33");windmill_41=vgFindObj("small_wind41");windmill_42=vgFindObj("small_wind42");windmill_43=vgFindObj("small_wind43");windmill_51=vgFindObj("small_wind51");windmill_52=vgFindObj("small_wind52");windmill_53=vgFindObj("small_wind53");windmill_61=vgFindObj("small_wind61");windmill_62=vgFindObj("small_wind62");windmill_63=vgFindObj("small_wind63");windmill_71=windmill_72=vgFindObj("small_wind72");windmill_73=vgFindObj("small_wind73");windmill_81=vgFindObj("small_wind81");windmill_82=vgFindObj("small_wind82");windmill_83=vgFindObj("small_wind83");windplay=vgFindPlyr("windmillPlay");windplay_small=vgFindPlyr("small_play");obser=vgFindObserv("obs");obser_small=vgFindObserv("small_obs");heart_all=vgFindPart(windmill,"total",NULL);heart_small_all=vgFindPart(windmill_small,"head_sm",NULL);heart=vgFindPart(windmill,"head",NULL);heart11=vgFindPart(windmill_11,"head",NULL);heart12=vgFindPart(windmill_12,"head",NULL);heart13=vgFindPart(windmill_13,"head",NULL);heart21=vgFindPart(windmill_21,"head",NULL);heart22=vgFindPart(windmill_22,"head",NULL);heart23=vgFindPart(windmill_23,"head",NULL);heart31=vgFindPart(windmill_31,"head",NULL);heart32=vgFindPart(windmill_32,"head",NULL);heart33=vgFindPart(windmill_33,"head",NULL);heart41=vgFindPart(windmill_41,"head",NULL);heart42=vgFindPart(windmill_42,"head",NULL);heart43=vgFindPart(windmill_43,"head",NULL);heart51=vgFindPart(windmill_51,"head",NULL);heart52=vgFindPart(windmill_52,"head",NULL);heart53=vgFindPart(windmill_53,"head",NULL);heart61=vgFindPart(windmill_61,"head",NULL);heart62=vgFindPart(windmill_62,"head",NULL);heart63=vgFindPart(windmill_63,"head",NULL);heart71=vgFindPart(windmill_71,"head",NULL);heart72=vgFindPart(windmill_72,"head",NULL);heart73=vgFindPart(windmill_73,"head",NULL);heart81=vgFindPart(windmill_81,"head",NULL);heart82=vgFindPart(windmill_82,"head",NULL);heart83=vgFindPart(windmill_83,"head",NULL);yi1part=vgFindPart(windmill,"yi1",NULL);yi2part=vgFindPart(windmill,"yi2",NULL);yi3part=vgFindPart(windmill,"yi3",NULL);if(obs_h>360.0f)obs_h-=360.0f;vgGetSinCos(obs_h,&hsin,&hcos);vgGetSinCos(obs_p,&psin,&pcosobs_x=ORIGINX+(RADIUS+BB)*hcos;obs_y=ORIGINY+(RADIUS+BB)*hsin;obs_z+=Z_RATE*psin;vgGetPos(windmill,windpos);vgGetPosVec(windpos,&wind_x,&wind_y,&wind_z,&wind_h,&wind_p, vgGetPos(windmill_small, &wind_small_h,&wind_small_p,&wind_small_r);//vgProp(obser,VGOBS_TETHERSTATE,VGOBS_FIXED);vgPosVec(obspos,obs_x+wind_x,obs_y+wind_y,obs_z,obs_h+90,obs_p,obs_r);vgObservTetherPos(obser,obspos);vgObservPlyr(obser,windplay);//vgProp(obser_small,VGOBS_LOOKAT_VGOBS_L_NONE);vgProp(obser_small,VGOBS_TETHERSTATE,VGOBS_FIXED);vgPosVec(obspos_small,33,0,133,90,-16,0);vgObservPlyr(obser_small,windplay_small);//DOFheos_small_all=vgNewPos();vgGetPos(heart_small_all,heos_small_all); &wind_small_h,&wind_small_p,&wind_small_r);vgPosVec(heos_small_all,wind_small_x,wind_small_y,wind_small_z,wind_small_h,wind_small_p,wind_small_r+m_Data.m_windturbine_angle);//DOF結(jié)點(diǎn)->擺頭heos_all=vgNewPos();vgGetPos(heart_all,heos_all); &head_all_p,&head_all_r);//vgPosVec(heos_all, head_all_h+m_Data.m_yaw_angle,head_all_p,head_all_r);//風(fēng)車頭偏航//風(fēng)車三翼DOF結(jié)點(diǎn)heos=vgNewPos();vgGetPos(heart,heos); vgGetPosVec(heos,&head_x,&head_y,&head_z,&head_h,&head_p,&head_r); head_r+m_Data.m_windturbine_angle);//軸的角//11_DOFheos11=vgNewPos();vgGetPos(heart11,heos11);vgGetPosVec(heos11,&head11_x,&head11_y,&head11_z,&head11_h,&head11_p,vgPosVec(heos11,head11_x,head11_y,head11_z,head11_h,head11_p,head11_r+L);vgDelete(he//12_DOFheos12=vgNewPos();vgGetPos(heart12,heos12);vgGetPosVec(heos12,&head12_x,&head12_y,&head12_z,&head12_h,&head12_p,vgPosVec(heos12,head12_x,head12_y,head12_z,head12_h,head12_p,head12_r+L);vgDelete(he//13_DOFheos13=vgNewPos();vgGetPos(heart13,heos13);vgGetPosVec(heos13,&head13_x,&head13_y,&head13_z,&head13_h,&head13_p,vgPosVec(heos13,head13_x,head13_y,head13_z,head13_h,head13_p,head13_r+L);vgDelete(he//21_DOFheos21=vgNewPos();vgGetPos(heart21,heos21);vgGetPosVec(heos21,&head21_x,&head21_y,&head21_z,&head21_h,&head21_p,vgPosVec(heos21,head21_x,head21_y,head21_z,head21_h,head21_p,head21_r+L);vgDelete(he//22_DOFheos22=vgNewPos();vgGetPos(heart22,heos22);vgGetPosVec(heos22,&head22_x,&head22_y,&head22_z,&head22_h,&head22_p,vgPosVec(heos22,head22_x,head22_y,head22_z,head22_h,head22_p,head22_r+L);vgDelete(he//23_DOFheos23=vgNewPos();vgGetPos(heart23,heos23);vgGetPosVec(heos23,&head23_x,&head23_y,&head23_z,&head23_h,&head23_p,vgPosVec(heos23,head23_x,head23_y,head23_z,head

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論