风力发电机组仿真软件源代码后_第1页
风力发电机组仿真软件源代码后_第2页
风力发电机组仿真软件源代码后_第3页
风力发电机组仿真软件源代码后_第4页
风力发电机组仿真软件源代码后_第5页
已阅读5页,还剩25页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

//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());//创建GDI+对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;//试验设置#include"TestSet.h"#include"Afxmt.h"#include"CurveDlg.h"//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///风车六度坐标staticfloatobs_x=(ORIGINX+RADIUS),obs_y=ORIGINY,obs_z=ZSTART,obs_h=0.0f,obs_p=0.0f,obs_r=0.0f;//staticfloat//风车六度坐标值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);//设置位置CStringwind_ang;wind_ang.Format("%10.2f",wind_ang风机角度:wind_ango/s"; terPos2d(r-width*0.15,height/2.0f280.0f);//设置位置CStringyi1_ang;yi1_angA角度:yi1_ang;m_pGlFont-gterPos2d(r-width*0.15,height/2.0f+260.0f);//设置位置CStringyi2_ang;yi2_ang.Format("%10.2f",LB);yi2_angB角度:yi2_ang;m_pGlFont-gterPos2d(r-width*0.15,height/2.0f+240.0f);//设置位置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");//按当前时间建立保存数据的文件intindex=0;if{fprintf(fp,"序号,仿真时间,风机偏航角,叶片旋转位置1,叶片旋转位置2,叶片旋转位置3,叶片的实际桨距角1,叶片的实际桨距角2,叶片的实际桨距角3,叶片的期望桨距角1,叶片的期望桨距角2,叶片的期望桨距角3,叶片的变桨控制输出1,叶片的变桨控制输出2,叶片的变桨控制输出3,风机轴的转角,风机轴的转速,发电机轴的转角,发电机轴的转速,有功功率输出,}{return0;}while(1)//试验开{{}({}{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("引擎启动失败!");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);//风的类{}}//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];//%用于标定1#叶片旋转到的位置,[0,360]度,程序设定界面视景显dp=(double*)mxGetPr(ArrayTest);LA=dp[0];用于标定dp=(double*)mxGetPr(ArrayTest);LB=dp[0];用于标定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]度,程序设定界面视景虚线显示ArrayTest=engGetVariable(ep,"P_Blade1_expected_pitch_angle");dp=(double*)mxGetPr(ArrayTest);2#叶片与期望桨距角,[-5,30]度,程序设定界面视景虚线显示ArrayTest=engGetVariable(ep,"P_Blade2_expected_pitch_angle");dp=(double*)mxGetPr(ArrayTest);3#叶片与期望桨距角,[-5,30]度,程序设定界面视景虚线显示ArrayTest=engGetVariable(ep,"P_Blade3_expected_pitch_angle");dp=(double*)mxGetPr(ArrayTest);dp=(double*)mxGetPr(ArrayTest);dp=(double*)mxGetPr(ArrayTest);//%3#叶片的变桨控制输出,程序设定界面文字显示dp=(double*)mxGetPr(ArrayTest);风机轴的转角,[0,360]度,程序设定界面视景显示ArrayTest=engGetVariable(ep,"P_windturbine_angle");dp=(double*)mxGetPr(ArrayTest);dp=(double*)mxGetPr(ArrayTest);发电机轴的转角,[0,360]度,程序设定界面视景显示ArrayTest=engGetVariable(ep,"P_generator_angle");dp=(double ArrayTest=engGetVariable(ep,"P_generator_angle_velocity");dp=(double有功功率输出,[0,10]兆瓦,程序设定界面文字显示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)}//调用试验设置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结点->摆头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);//风车头偏航//风车三翼DOF结点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. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论