![C語言采樣程序_第1頁](http://file2.renrendoc.com/fileroot_temp3/2021-6/6/8c40704c-2899-4739-b135-0fb5177ab205/8c40704c-2899-4739-b135-0fb5177ab2051.gif)
![C語言采樣程序_第2頁](http://file2.renrendoc.com/fileroot_temp3/2021-6/6/8c40704c-2899-4739-b135-0fb5177ab205/8c40704c-2899-4739-b135-0fb5177ab2052.gif)
![C語言采樣程序_第3頁](http://file2.renrendoc.com/fileroot_temp3/2021-6/6/8c40704c-2899-4739-b135-0fb5177ab205/8c40704c-2899-4739-b135-0fb5177ab2053.gif)
![C語言采樣程序_第4頁](http://file2.renrendoc.com/fileroot_temp3/2021-6/6/8c40704c-2899-4739-b135-0fb5177ab205/8c40704c-2899-4739-b135-0fb5177ab2054.gif)
![C語言采樣程序_第5頁](http://file2.renrendoc.com/fileroot_temp3/2021-6/6/8c40704c-2899-4739-b135-0fb5177ab205/8c40704c-2899-4739-b135-0fb5177ab2055.gif)
下載本文檔
版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領
文檔簡介
1、# in clude# in clude# in clude# in clude#in clude int j=0;char file name20;float b,c,k;/b為根號下的浮點數(shù)據(jù),d為b的雙浮點數(shù)據(jù),e為(根號*電流),c為e的浮點數(shù)據(jù),h為cos里面的數(shù)據(jù),f為時間周期double d,e,f,h,g;int i=0;float m,s; /s為g的浮點數(shù)據(jù)int q;struct data_typefloat num;data1000;FILE *fp;void mai n() dd: time_t time_s;/*系統(tǒng)時間*struct tm *date_time;/
2、 while (1)/ Sleep(1000);time( &time_s);date_time = localtime(&time_s);COORD RD=0,0;SetCo nsoleCursorPositio n(GetStdHa ndle(STD_OUTPUT_HANDLE),RD);prin tf(%04d/%02d/%02d %02d:%02d:%02d”,date_time-tm_year+1900,date_time-tm_ mon+1,date_time-tm_mday,date_time-tm_hour, date_time-tm_mi n,date_time-tm_sec
3、);/ /*系統(tǒng)時間*int a,b, z;void huitu();prin tf(n*);printf(”歡迎使用n);printf(*nn);/# 常用故障檢測 # printf(”請輸入你的選擇:1數(shù)據(jù)生成2數(shù)據(jù)查看n);scan f(%d, &z);if(z=1)/常用故障檢測的選中prin tf(1三相短路故障n);prin tf(2兩相短路故障n);prin tf(3兩相接地故障n);prin tf(4單相接地故障n);prin tf(5三相斷線故障n);prin tf(6兩相斷線故障n);prin tf( 7 ss: scan f(%d,&a);switch(a)case 1:
4、 prin tf(n單相斷線故障nn您的選擇為:);請輸入PSASP提供的故障參數(shù)”);break;case 2: prin tf(n請輸入PSASP提供的故障參數(shù));break;case 3: prin tf(n請輸入PSASP提供的故障參數(shù));break;case 4: prin tf(n請輸入PSASP提供的故障參數(shù));break;case 5: prin tf(n請輸入PSASP提供的故障參數(shù));break;case 6: prin tf(n請輸入PSASP提供的故障參數(shù));break;case 7: prin tf(n請輸入PSASP提供的故障參數(shù));break;default:pr
5、i ntf(! goto ss;huitu();Sleep(IOOO);輸入錯誤!n請重新輸入故障類型:);system(cls);/# 常用故障檢測 #elseif(fp=fope n(stabledata.dat,r)=NULL)prin tf(ca nnot ope n this filen);exit(0);elsewhile(feof(fp)=0)fseek(fp,j*sizeof(struct data_type),O); fread( &dataj,sizeof(struct data_type),1,fp); prin tf(%fn,dataj. nu m);j+;fclose
6、(fp);scan f(%d, &b); system(cls);goto dd;printf(*n);printf(”謝謝使用n);printf(*nn);/ooooooooooooooooooooWI夂I ooooooooooooooooooooooooooo/$丿|7個2| 心 I $void huitu()/ float b,c,k;/b為根號下的浮點數(shù)據(jù),d為b的雙浮點數(shù)據(jù),e為(根號*電流),c為e的浮點數(shù)據(jù),h為cos里面的數(shù)據(jù),f為時間周期/ double d,e,f,h,g;為g的浮點數(shù)據(jù)/ int i;/float m,s;/s/int q;/ struct data_ty
7、pe/ float num;/data1000;/printf(已進入繪圖函數(shù)”);printf(根號下的數(shù)b=);scan f(%f,&b);printf(”scan f(%f,&k);d=(double)b;e=k*sqrt(d);c=(float)e;/*關于采樣時間的處理*prin tf(請輸入您所需的采樣時間:scan f(%f, &m);q=(i nt)(0.02/m);f=0;);故障數(shù)據(jù)電壓或者電流k=);/ char file name20;/ FILE *fp;strcpy(file name,stabledata.dat);fp=fope n(file name,w+);
8、if(fp=fope n(file name,w+)=NULL) prin tf(ca nnot ope n this filen); exit(0);elseprin tf(n數(shù)據(jù)處理結果如下:n);for(i=0;i=q_1;i+)f=f+m;h=314*f;g=e*cos(h);/ prin tf(%fn,g);s=float(g);/*文件*datai. num=s;fseek(fp,i*sizeof(struct data_type),O);/ fread(&datai,sizeof(struct data_type),1,fp);if(fwrite(&datai,sizeof(struct data_type),1,fp)!=1) prin tf(file write error n);/ prin tf(%fn,datai. num);/ fseek(fp,-sizeof(struct data_type),
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 低壓制加熱器行業(yè)深度研究報告
- 2025年高壓電纜項目可行性研究報告
- 2024-2030年中國無人經(jīng)濟行業(yè)市場深度研究及發(fā)展趨勢預測報告
- 2025年家俱部件項目投資可行性研究分析報告
- 2025年度影視特效畫師聘用合同模板
- 小提花紗卡坯布行業(yè)深度研究報告
- 2025年度水利工程管件采購合同范本
- 2025年度汽車救援與維修應急服務合同
- 2021-2026年中國香蕉行業(yè)發(fā)展監(jiān)測及投資戰(zhàn)略規(guī)劃研究報告
- 2025年度食用油產(chǎn)業(yè)鏈上下游協(xié)同發(fā)展合同
- 漢語言文學論文6000字
- 10kV線路施工安全及技術交底
- 血液透析流程圖
- DB11∕T 1653-2019 供暖系統(tǒng)能耗指標體系
- 齒輪箱振動信號和故障診斷
- 小學生急救常識(課件)主題教育班會
- 信息光學試卷試題及答案
- 文化差異及跨文化交際試題集
- PC-Ф800×800錘式破碎機結構設計
- 慢病患者隨訪服務記錄表
- 雙溪課程評量表完整優(yōu)秀版
評論
0/150
提交評論