1 Star 0 Fork 0

tectim/engine-sim

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
camshaft.h 1.44 KB
一键复制 编辑 原始数据 按行查看 历史
#ifndef ATG_ENGINE_SIM_CAMSHAFT_H
#define ATG_ENGINE_SIM_CAMSHAFT_H
#include "part.h"
#include "function.h"
#include "units.h"
class Crankshaft;
class Camshaft : public Part {
public:
struct Parameters {
// Number of lobes
int lobes;
// Camshaft advance in camshaft degrees
double advance = 0;
// Corresponding crankshaft
Crankshaft *crankshaft;
// Lobe profile
Function *lobeProfile;
// Base radius
double baseRadius = units::distance(600, units::thou);
};
public:
Camshaft();
virtual ~Camshaft();
void initialize(const Parameters &params);
virtual void destroy();
double valveLift(int lobe) const;
double sampleLobe(double theta) const;
void setLobeCenterline(int lobe, double crankAngle) { m_lobeAngles[lobe] = crankAngle / 2; }
double getLobeCenterline(int lobe) const { return m_lobeAngles[lobe]; }
double getAngle() const;
Function *getLobeProfile() const { return m_lobeProfile; }
double getAdvance() const { return m_advance; }
double getBaseRadius() const { return m_baseRadius; }
private:
Crankshaft *m_crankshaft;
Function *m_lobeProfile;
double *m_lobeAngles;
double m_advance;
double m_baseRadius;
int m_lobes;
};
#endif /* ATG_ENGINE_SIM_CAMSHAFT_H */
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/tectim/engine-sim.git
git@gitee.com:tectim/engine-sim.git
tectim
engine-sim
engine-sim
master

搜索帮助