#include "pid.h" #include // 构造函数将接口绑定 void pid_constructor(pid_t *self) { switch (self->type) { case PID_TYPE_COMMON: /* code */ break; case PID_TYPE_NEURAL: pid_neural_constructor(&self->pid_u.neural); break; case PID_TYPE_FUZZY: DBG_ASSERT(self->sub_type != 0 __DBG_LINE); self->pid_u.fuzzy.sub_type = self->sub_type; pid_fuzzy_constructor(&self->pid_u.fuzzy); break; case PID_TYPE_AUTO_TUNE: pid_auto_tune_constructor(&self->auto_tune); break; case PID_TYPE_CUSTOM_CAO: pid_c_constructor(&self->pid_u.cao); break; case PID_TYPE_CUSTOM_GAO: pid_g_constructor(&self->pid_u.gao); break; case PID_TYPE_CUSTOM_XU: pid_x_constructor(&self->pid_u.xu); break; case PID_TYPE_CUSTOM_ZHANG: // pid_zh_constructor(&self->pid_u.zhang); pid_zh_constructor1(&self->pid_u.zhang1); break; case PID_TYPE_CUSTOM_HANGDIAN: pid_hd_constructor(&self->pid_u.hd); break; default: break; } self->is_init = TRUE; }