- #include "creatitem.h"
-
- Item *creatItem(const QString &type)
- {
- if (type == "常开") return new Contact(type);
- if (type == "常闭") return new Contact(type);
- if (type == "线圈") return new Coil(type);
- if (type == "比较") return new Comparator(type);
- return nullptr;
- }
|