Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
892768447 committed Dec 28, 2018
1 parent 97909c3 commit 880fc81
Show file tree
Hide file tree
Showing 276 changed files with 5,514 additions and 5,775 deletions.
72 changes: 2 additions & 70 deletions .settings/org.eclipse.core.resources.prefs
Original file line number Diff line number Diff line change
@@ -1,84 +1,16 @@
eclipse.preferences.version=1
encoding//QAxWidget/\u663E\u793Aword_excel_pdf.py=utf-8
encoding//QListView/CustomWidgetSortItem.py=utf-8
encoding//QListView/SortItemByRole.py=utf-8
encoding//QProxyStyle/Lib/TabBarStyle.py=utf-8
encoding//QProxyStyle/TabTextDirection.py=utf-8
encoding//QTableView/CopyContent/CopyContent.py=utf-8
encoding//QTableView/CopyContent/__main__.py=utf-8
encoding//QTableWidget/SqlQuery/SqlQuery.py=utf-8
encoding//QTableWidget/SqlQuery/__main__.py=utf-8
encoding//QSplitter/RewriteHandle.py=utf-8
encoding//QThread/moveToThread.py=utf-8
encoding//QTreeWidget/ParsingJson.py=utf-8
encoding//\u5176\u5B83/C\u548CC++\u6269\u5C55/py\u8F6Cpyd/pydmod.py=utf-8
encoding//\u5176\u5B83/QRC\u8D44\u6E90\u6587\u4EF6\u4F7F\u7528/qrctest1.py=utf-8
encoding//\u5176\u5B83/QRC\u8D44\u6E90\u6587\u4EF6\u4F7F\u7528/qrctest2.py=utf-8
encoding//\u5176\u5B83/QRC\u8D44\u6E90\u6587\u4EF6\u4F7F\u7528/res_rc.py=utf-8
encoding//\u5176\u5B83/QRC\u8D44\u6E90\u6587\u4EF6\u4F7F\u7528/textread.py=utf-8
encoding//\u5176\u5B83/\u4E32\u53E3\u8C03\u8BD5\u5C0F\u52A9\u624B/UiSerialPort.py=utf-8
encoding//\u5176\u5B83/\u4E32\u53E3\u8C03\u8BD5\u5C0F\u52A9\u624B/\u4E32\u53E3\u8C03\u8BD5\u5C0F\u52A9\u624B.py=utf-8
encoding//\u5176\u5B83/\u4EBA\u8138\u63CF\u70B9\u68C0\u6D4B/OpencvWidget.py=utf-8
encoding//\u5176\u5B83/\u5168\u5C40\u70ED\u952E/HotKey.py=utf-8
encoding//\u5176\u5B83/\u53F3\u4E0B\u89D2\u5F39\u51FA\u6846/WindowNotify.py=utf-8
encoding//\u5176\u5B83/\u5B57\u4F53\u6D4B\u8BD5/FontAwesome.py=utf-8
encoding//\u5176\u5B83/\u5B57\u4F53\u6D4B\u8BD5/TestFontAwesome.py=utf-8
encoding//\u5176\u5B83/\u5B57\u4F53\u6D4B\u8BD5/TestFontRoboto.py=utf-8
encoding//\u5176\u5B83/\u6D88\u606F\u63D0\u793A/BubbleTips.py=utf-8
encoding//\u5176\u5B83/\u6D88\u606F\u63D0\u793A/Notification.py=utf-8
encoding//\u5176\u5B83/\u7A0B\u5E8F\u91CD\u542F/AutoRestart.py=utf-8
encoding//\u5176\u5B83/\u81EA\u52A8\u66F4\u65B0/mylibs/testlibs.py=utf-8
encoding//\u5176\u5B83/\u81EA\u52A8\u66F4\u65B0/test.py=utf-8
encoding//\u5176\u5B83/\u81EA\u5B9A\u4E49import/IronyImporter.py=utf-8
encoding//\u5176\u5B83/\u81EA\u5B9A\u4E49import/build.py=utf-8
encoding//\u5176\u5B83/\u81EA\u5B9A\u4E49import/main.py=utf-8
encoding//\u5176\u5B83/\u81EA\u5B9A\u4E49import/src/test.py=utf-8
encoding//\u5176\u5B83/\u81EA\u5B9A\u4E49\u5C5E\u6027\u6D4B\u8BD5/\u81EA\u5B9A\u4E49\u5C5E\u6027\u6D4B\u8BD5.py=utf-8
encoding//\u52A8\u753B/\u53F3\u952E\u83DC\u5355\u52A8\u753B.py=utf-8
encoding//\u52A8\u753B/\u591A\u9875\u9762\u5207\u6362\u52A8\u753B/SlidingStackedWidget.py=utf-8
encoding//\u52A8\u753B/\u591A\u9875\u9762\u5207\u6362\u52A8\u753B/UiImageSlider.py=utf-8
encoding//\u52A8\u753B/\u591A\u9875\u9762\u5207\u6362\u52A8\u753B/\u56FE\u7247\u8F6E\u64AD\u52A8\u753B.py=utf-8
encoding//\u52A8\u753B/\u6309\u94AE\u653E\u5927\u7F29\u5C0F\u52A8\u753B.py=utf-8
encoding//\u52A8\u753B/\u70B9\u9635\u7279\u6548/\u70B9\u9635\u7279\u6548.py=utf-8
encoding//\u52A8\u753B/\u7A97\u53E3\u6DE1\u5165\u6DE1\u51FA.py=utf-8
encoding//\u56FE\u5F62\u89C6\u56FE/\u4E16\u754C\u5730\u56FE/WorldMap.py=utf-8
encoding//\u56FE\u5F62\u89C6\u56FE/\u663E\u793A\u56FE\u7247\u53CA\u7F29\u653E.py=utf-8
encoding//\u56FE\u5F62\u89C6\u56FE/\u6DFB\u52A0QWidget.py=utf-8
encoding//\u56FE\u5F62\u89C6\u56FE/\u7B80\u5355\u56FE\u50CF\u5904\u7406/SimpleImagePs.py=utf-8
encoding//\u56FE\u5F62\u89C6\u56FE/\u7B80\u5355\u56FE\u50CF\u5904\u7406/SimpleImageThread.py=utf-8
encoding//\u56FE\u5F62\u89C6\u56FE/\u7B80\u5355\u56FE\u50CF\u5904\u7406/SimpleImageView.py=utf-8
encoding//\u56FE\u7247/\u4EFF\u7F51\u9875\u56FE\u7247\u9519\u4F4D\u7279\u6548.py=utf-8
encoding//\u56FE\u7247/\u56FE\u7247\u52A0\u8F7D/res_rc.py=utf-8
encoding//\u56FE\u7247/\u56FE\u7247\u52A0\u8F7D/xpmres.py=utf-8
encoding//\u56FE\u7247/\u56FE\u7247\u52A0\u8F7D/\u56FE\u7247\u52A0\u8F7D.py=utf-8
encoding//\u56FE\u7247/\u56FE\u7247\u65CB\u8F6C.py=utf-8
encoding//\u56FE\u7247/\u663E\u793A.9\u683C\u5F0F\u56FE\u7247/pyd\u7248\u672C/QtNinePatch/sip/configure.py=utf-8
encoding//\u56FE\u7247/\u663E\u793A.9\u683C\u5F0F\u56FE\u7247/pyd\u7248\u672C/QtNinePatch/sip/testQtNinePatch.py=utf-8
encoding//\u56FE\u7247/\u663E\u793A.9\u683C\u5F0F\u56FE\u7247/\u7EAFpython\u7248\u672C1/NinePatch.py=utf-8
encoding//\u56FE\u7247/\u663E\u793A.9\u683C\u5F0F\u56FE\u7247/\u7EAFpython\u7248\u672C1/testNinePatch.py=utf-8
encoding//\u56FE\u7247/\u663E\u793A.9\u683C\u5F0F\u56FE\u7247/\u7EAFpython\u7248\u672C2/QtNinePatch.py=utf-8
encoding//\u56FE\u7247/\u663E\u793A.9\u683C\u5F0F\u56FE\u7247/\u7EAFpython\u7248\u672C2/testQtNinePatch.py=utf-8
encoding//\u591A\u9875\u9762/QScrollArea/\u4EFFQQ\u8BBE\u7F6E\u9762\u677F/SettingUi.py=utf-8
encoding//\u591A\u9875\u9762/QScrollArea/\u4EFFQQ\u8BBE\u7F6E\u9762\u677F/\u4EFFQQ\u8BBE\u7F6E\u9762\u677F.py=utf-8
encoding//\u591A\u9875\u9762/QStackedWidget/\u5DE6\u4FA7\u9009\u9879\u5361/\u5DE6\u4FA7\u9009\u9879\u5361.py=utf-8
encoding//\u6D4F\u89C8\u5668/QWebView/\u68A6\u5E7B\u6811/\u68A6\u5E7B\u6811.py=utf-8
encoding//\u6ED1\u52A8\u6761/\u6ED1\u52A8\u6761\u70B9\u51FB\u5B9A\u4F4D.py=utf-8
encoding//\u7A97\u53E3/\u5206\u5272\u7A97\u53E3\u7684\u5206\u5272\u6761\u91CD\u5199.py=utf-8
encoding//\u7A97\u53E3/\u65E0\u8FB9\u6846\u81EA\u5B9A\u4E49\u6807\u9898\u680F\u7A97\u53E3/FramelessWindow.py=utf-8
encoding//\u7A97\u53E3/\u65E0\u8FB9\u6846\u81EA\u5B9A\u4E49\u6807\u9898\u680F\u7A97\u53E3/win\u65E0\u8FB9\u6846\u8C03\u6574\u5927\u5C0F.py=utf-8
encoding//\u7A97\u53E3/\u65E0\u8FB9\u6846\u81EA\u5B9A\u4E49\u6807\u9898\u680F\u7A97\u53E3/\u65E0\u8FB9\u6846\u81EA\u5B9A\u4E49\u6807\u9898\u680F\u7A97\u53E3.py=utf-8
encoding//\u7A97\u53E3/\u6D88\u606F\u5BF9\u8BDD\u6846\u5012\u8BA1\u65F6\u5173\u95ED.py=utf-8
encoding//\u7A97\u53E3/\u7A97\u53E3\u91CD\u542F.py=utf-8
encoding//\u7F8E\u5316/Effect/AnimationShadowEffect.py=utf-8
encoding//\u7F8E\u5316/Effect/\u56FE\u7247\u6309\u94AE\u8F93\u5165\u6846\u9634\u5F71.py=utf-8
encoding//\u7F8E\u5316/QLabel/\u5706\u5F62\u56FE\u7247.py=utf-8
encoding//QWebView/DreamTree.py=utf-8
encoding//\u7F8E\u5316/QProgressBar/Metro\u8FDB\u5EA6\u6761.py=utf-8
encoding//\u7F8E\u5316/QProgressBar/\u6C34\u6CE2\u7EB9\u8FDB\u5EA6\u6761/ProgressBar.py=utf-8
encoding//\u7F8E\u5316/QProgressBar/\u6C34\u6CE2\u7EB9\u8FDB\u5EA6\u6761/\u6C34\u6CE2\u7EB9\u8FDB\u5EA6\u6761.py=utf-8
encoding//\u7F8E\u5316/QSlider/PaintQSlider.py=utf-8
encoding//\u7F8E\u5316/QWidget/CustomPaintWidget.py=utf-8
encoding//\u7F8E\u5316/QWidget/CustomWidget.py=utf-8
encoding//\u7F8E\u5316/QWidget/QWidget\u6837\u5F0F\u6D4B\u8BD5.py=utf-8
encoding//\u83DC\u5355/\u83DC\u5355\u591A\u9009\u4E0D\u5173\u95ED.py=utf-8
encoding//\u8868\u683C/QTableView/\u8868\u683C\u5185\u5BB9\u590D\u5236.py=utf-8
encoding//\u8868\u683C/QTableWidget/\u6570\u636E\u5E93\u67E5\u8BE2\u663E\u793A\u8868\u683C/main.py=utf-8
encoding//\u8868\u683C/QTableWidget/\u6570\u636E\u5E93\u67E5\u8BE2\u663E\u793A\u8868\u683C/mainui.py=utf-8
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
#%%cython
import numpy as np
cimport numpy as np
np.import_array()

# 参考http://cython.readthedocs.io/en/latest/src/userguide/wrapping_CPlusPlus.html?highlight=cdef%20extern%20from
# 参考https://www.zhihu.com/question/23003213

cdef extern from "CalSpecSpeaLib.h":
void cal_spec_accel(double acc[], int len, double dt, double maxPeriod, double periodStep, double dampRatio, double *Period, double *Fre, double *MAcc, double *MVel, double *MDis, int numt)

def calspecaccel(np.ndarray[double, ndim=1, mode="c"] acc, int length, double dt, double maxPeriod, double periodStep, double dampRatio):
cdef int numt = int(maxPeriod / periodStep) + 1
# 初始化各存储数据
cdef np.ndarray[double, ndim=1] Fre = np.zeros(numt, float)
cdef np.ndarray[double, ndim=1] MDis = np.zeros(numt, float)
cdef np.ndarray[double, ndim=1] MVel = np.zeros(numt, float)
cdef np.ndarray[double, ndim=1] MAcc = np.zeros(numt, float)
#产生501个
cdef np.ndarray[double, ndim=1] Period = np.arange(0.0, maxPeriod + periodStep, periodStep) # 10.0 + 0.02, 0.02
Period[0] = 0.001
# 调用CalSpecSpeaLib.cpp定义的函数对数组进行处理
cal_spec_accel(<double*> np.PyArray_DATA(acc), length, dt, maxPeriod, periodStep, dampRatio,
<double*> np.PyArray_DATA(Period), <double*> np.PyArray_DATA(Fre),
<double*> np.PyArray_DATA(MAcc), <double*> np.PyArray_DATA(MVel),
<double*> np.PyArray_DATA(MDis), numt)
#%%cython
import numpy as np
cimport numpy as np
np.import_array()

# 参考http://cython.readthedocs.io/en/latest/src/userguide/wrapping_CPlusPlus.html?highlight=cdef%20extern%20from
# 参考https://www.zhihu.com/question/23003213

cdef extern from "CalSpecSpeaLib.h":
void cal_spec_accel(double acc[], int len, double dt, double maxPeriod, double periodStep, double dampRatio, double *Period, double *Fre, double *MAcc, double *MVel, double *MDis, int numt)

def calspecaccel(np.ndarray[double, ndim=1, mode="c"] acc, int length, double dt, double maxPeriod, double periodStep, double dampRatio):
cdef int numt = int(maxPeriod / periodStep) + 1
# 初始化各存储数据
cdef np.ndarray[double, ndim=1] Fre = np.zeros(numt, float)
cdef np.ndarray[double, ndim=1] MDis = np.zeros(numt, float)
cdef np.ndarray[double, ndim=1] MVel = np.zeros(numt, float)
cdef np.ndarray[double, ndim=1] MAcc = np.zeros(numt, float)
#产生501个
cdef np.ndarray[double, ndim=1] Period = np.arange(0.0, maxPeriod + periodStep, periodStep) # 10.0 + 0.02, 0.02
Period[0] = 0.001
# 调用CalSpecSpeaLib.cpp定义的函数对数组进行处理
cal_spec_accel(<double*> np.PyArray_DATA(acc), length, dt, maxPeriod, periodStep, dampRatio,
<double*> np.PyArray_DATA(Period), <double*> np.PyArray_DATA(Fre),
<double*> np.PyArray_DATA(MAcc), <double*> np.PyArray_DATA(MVel),
<double*> np.PyArray_DATA(MDis), numt)
return Period, Fre, MAcc, MVel, MDis
Original file line number Diff line number Diff line change
@@ -1,63 +1,63 @@
#include "CalSpecSpeaLib.h"

#include <stdio.h>
#include <iostream>
#include <math.h>
using namespace std;


double maxabs(double num[], int len)
{
//
return abs(num[0]);

}
bool isALLvaluezero(double num[], int len)
{
//
return false;

}
void cal_spec_accel(double acc[], int len, double dt, double maxPeriod, double periodStep, double dampRatio, double *Period, double *Fre, double *MAcc, double *MVel, double *MDis, int numt)
{
//
Period[0] = 99.95;
Fre[0] = 99.96;
MAcc[0] = 99.97;
MVel[0] = 99.98;
MDis[0] = 99.99;
}

int main()
{
double acc[20] = { 0.0038,0.0049,0.0061,0.0075,0.0088,0.01,0.0112,0.0123,0.0133,0.0140,0.0146,0.0152,0.0157,0.0162,0.0167,0.0172,0.0175,0.0178,0.0179,0.0179 };
int len = 20;
double dt = 0.005;
double maxPeriod = 10.0;
double periodStep = 0.02;
double dampRatio = 0.05;
int numt = int(maxPeriod / periodStep) + 1;
double *Fre = new double[numt];
double *MDis = new double[numt];
double *MVel = new double[numt];
double *MAcc = new double[numt];
double *Period = new double[numt];
for (int i = 0; i<numt; i++) {
Period[i] = periodStep*i;
Fre[i] = 0;
MDis[i] = 0;
MVel[i] = 0;
MAcc[i] = 0;
}
Period[0] = 0.001;
//cal_spec_accel(double acc[], int len,double dt,double maxPeriod,double periodStep,double dampRatio,double *Period,double *Fre,double *MAcc,double *MVel,double *MDis)
cal_spec_accel(acc, len, dt, maxPeriod, periodStep, dampRatio, Period, Fre, MAcc, MVel, MDis, numt);

for (int i = 0; i<numt; i++)
{
cout << MAcc[i] << endl;
}

delete[] Fre;
return 0;
#include "CalSpecSpeaLib.h"

#include <stdio.h>
#include <iostream>
#include <math.h>
using namespace std;


double maxabs(double num[], int len)
{
//
return abs(num[0]);

}
bool isALLvaluezero(double num[], int len)
{
//
return false;

}
void cal_spec_accel(double acc[], int len, double dt, double maxPeriod, double periodStep, double dampRatio, double *Period, double *Fre, double *MAcc, double *MVel, double *MDis, int numt)
{
//
Period[0] = 99.95;
Fre[0] = 99.96;
MAcc[0] = 99.97;
MVel[0] = 99.98;
MDis[0] = 99.99;
}

int main()
{
double acc[20] = { 0.0038,0.0049,0.0061,0.0075,0.0088,0.01,0.0112,0.0123,0.0133,0.0140,0.0146,0.0152,0.0157,0.0162,0.0167,0.0172,0.0175,0.0178,0.0179,0.0179 };
int len = 20;
double dt = 0.005;
double maxPeriod = 10.0;
double periodStep = 0.02;
double dampRatio = 0.05;
int numt = int(maxPeriod / periodStep) + 1;
double *Fre = new double[numt];
double *MDis = new double[numt];
double *MVel = new double[numt];
double *MAcc = new double[numt];
double *Period = new double[numt];
for (int i = 0; i<numt; i++) {
Period[i] = periodStep*i;
Fre[i] = 0;
MDis[i] = 0;
MVel[i] = 0;
MAcc[i] = 0;
}
Period[0] = 0.001;
//cal_spec_accel(double acc[], int len,double dt,double maxPeriod,double periodStep,double dampRatio,double *Period,double *Fre,double *MAcc,double *MVel,double *MDis)
cal_spec_accel(acc, len, dt, maxPeriod, periodStep, dampRatio, Period, Fre, MAcc, MVel, MDis, numt);

for (int i = 0; i<numt; i++)
{
cout << MAcc[i] << endl;
}

delete[] Fre;
return 0;
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
double maxabs(double num[], int len);
bool isALLvaluezero(double num[], int len);
double maxabs(double num[], int len);
bool isALLvaluezero(double num[], int len);
void cal_spec_accel(double acc[], int len, double dt, double maxPeriod, double periodStep, double dampRatio, double *Period, double *Fre, double *MAcc, double *MVel, double *MDis, int numt);
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cd %~dp0

python setup.py build

python test.py

cd %~dp0

python setup.py build

python test.py

pause
Loading

0 comments on commit 880fc81

Please sign in to comment.