You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
959B

  1. #include "SubmarineFree.hpp"
  2. struct DS_Module : Module {
  3. float voltage0 = 0.0f;
  4. float voltage1 = 10.0f;
  5. float midpoint();
  6. float output(int);
  7. DS_Module(int p, int i, int o, int l) : Module(p, i, o, l) {}
  8. json_t *toJson() override;
  9. void fromJson(json_t *) override;
  10. void onReset() override;
  11. void appendContextMenu(Menu *);
  12. };
  13. struct DS_MenuItem : MenuItem {
  14. DS_Module *module;
  15. float vh;
  16. float vl;
  17. void onAction(EventAction &e) override;
  18. void step() override;
  19. };
  20. struct DS_Schmitt {
  21. int _state = 0;
  22. static float high(float, float);
  23. static float low(float, float);
  24. void reset();
  25. void set();
  26. void set(int);
  27. int state(float, float, float);
  28. int state(DS_Module *, float);
  29. int edge(float, float, float);
  30. int edge(DS_Module *, float);
  31. int edge(float, float, float, int);
  32. int edge(DS_Module *, float, int);
  33. int redge(float, float, float);
  34. int redge(DS_Module *, float);
  35. int fedge(float, float, float);
  36. int fedge(DS_Module *, float);
  37. };