mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-12 02:02:16 +10:00
Add 4PDT On/On/On (#854)
Adds 4PDT On/On/On Type 1 and Type 2 switches. Type 2 models for example the DiMarzio EP1111.
This commit is contained in:
@@ -135,6 +135,8 @@ public class MiniToggleSwitch extends AbstractTransparentComponent<ToggleSwitchT
|
|||||||
break;
|
break;
|
||||||
case _4PDT:
|
case _4PDT:
|
||||||
case _4PDT_off:
|
case _4PDT_off:
|
||||||
|
case _4PDT_ononon_1:
|
||||||
|
case _4PDT_ononon_2:
|
||||||
controlPoints =
|
controlPoints =
|
||||||
new Point2D[] {firstPoint, new Point2D.Double(firstPoint.getX(), firstPoint.getY() + spacing),
|
new Point2D[] {firstPoint, new Point2D.Double(firstPoint.getX(), firstPoint.getY() + spacing),
|
||||||
new Point2D.Double(firstPoint.getX(), firstPoint.getY() + 2 * spacing),
|
new Point2D.Double(firstPoint.getX(), firstPoint.getY() + 2 * spacing),
|
||||||
@@ -368,6 +370,8 @@ public class MiniToggleSwitch extends AbstractTransparentComponent<ToggleSwitchT
|
|||||||
break;
|
break;
|
||||||
case _4PDT:
|
case _4PDT:
|
||||||
case _4PDT_off:
|
case _4PDT_off:
|
||||||
|
case _4PDT_ononon_1:
|
||||||
|
case _4PDT_ononon_2:
|
||||||
body =
|
body =
|
||||||
new RoundRectangle2D.Double(firstPoint.getX() - margin, firstPoint.getY() - margin, 2 * margin + 3 * spacing, 2
|
new RoundRectangle2D.Double(firstPoint.getX() - margin, firstPoint.getY() - margin, 2 * margin + 3 * spacing, 2
|
||||||
* margin + 2 * spacing, margin, margin);
|
* margin + 2 * spacing, margin, margin);
|
||||||
@@ -454,6 +458,8 @@ public class MiniToggleSwitch extends AbstractTransparentComponent<ToggleSwitchT
|
|||||||
case DPDT_off:
|
case DPDT_off:
|
||||||
case _3PDT_off:
|
case _3PDT_off:
|
||||||
case _4PDT_off:
|
case _4PDT_off:
|
||||||
|
case _4PDT_ononon_1:
|
||||||
|
case _4PDT_ononon_2:
|
||||||
case _5PDT_off:
|
case _5PDT_off:
|
||||||
case DPDT_ononon_1:
|
case DPDT_ononon_1:
|
||||||
case DPDT_ononon_2:
|
case DPDT_ononon_2:
|
||||||
@@ -508,6 +514,26 @@ public class MiniToggleSwitch extends AbstractTransparentComponent<ToggleSwitchT
|
|||||||
return (index1 == 1 && index2 == 2) || (index1 == 4 && index2 == 5);
|
return (index1 == 1 && index2 == 2) || (index1 == 4 && index2 == 5);
|
||||||
default: return false;
|
default: return false;
|
||||||
}
|
}
|
||||||
|
case _4PDT_ononon_1:
|
||||||
|
switch (position) {
|
||||||
|
case 0:
|
||||||
|
return (index1 == 0 && index2 == 1) || (index1 == 3 && index2 == 4) || (index1 == 6 && index2 == 7) || (index1 == 9 && index2 == 10);
|
||||||
|
case 1:
|
||||||
|
return (index1 == 0 && index2 == 1) || (index1 == 4 && index2 == 5) || (index1 == 6 && index2 == 7) || (index1 == 10 && index2 == 11);
|
||||||
|
case 2:
|
||||||
|
return (index1 == 1 && index2 == 2) || (index1 == 4 && index2 == 5) || (index1 == 7 && index2 == 8) || (index1 == 10 && index2 == 11);
|
||||||
|
default: return false;
|
||||||
|
}
|
||||||
|
case _4PDT_ononon_2:
|
||||||
|
switch (position) {
|
||||||
|
case 0:
|
||||||
|
return (index1 == 0 && index2 == 1) || (index1 == 3 && index2 == 4) || (index1 == 6 && index2 == 7) || (index1 == 9 && index2 == 10);
|
||||||
|
case 1:
|
||||||
|
return (index1 == 1 && index2 == 2) || (index1 == 3 && index2 == 4) || (index1 == 7 && index2 == 8) || (index1 == 9 && index2 == 10);
|
||||||
|
case 2:
|
||||||
|
return (index1 == 1 && index2 == 2) || (index1 == 4 && index2 == 5) || (index1 == 7 && index2 == 8) || (index1 == 10 && index2 == 11);
|
||||||
|
default: return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ public enum ToggleSwitchType {
|
|||||||
SPST("SPST"), SPDT("SPDT (On/On)"), SPDT_off("SPDT (On/Off/On)"), DPDT("DPDT (On/On)"),DPDT_off("DPDT (On/Off/On)"),
|
SPST("SPST"), SPDT("SPDT (On/On)"), SPDT_off("SPDT (On/Off/On)"), DPDT("DPDT (On/On)"),DPDT_off("DPDT (On/Off/On)"),
|
||||||
DPDT_ononon_1("DPDT (On/On/On Type 1)"), DPDT_ononon_2("DPDT (On/On/On Type 2)"),
|
DPDT_ononon_1("DPDT (On/On/On Type 1)"), DPDT_ononon_2("DPDT (On/On/On Type 2)"),
|
||||||
_DP3T_mustang("DP3T"), _3PDT("3PDT"),_3PDT_off("3PDT (On/Off/On)"), _4PDT("4PDT"), _4PDT_off("4PDT (On/Off/On)"),
|
_DP3T_mustang("DP3T"), _3PDT("3PDT"),_3PDT_off("3PDT (On/Off/On)"), _4PDT("4PDT"), _4PDT_off("4PDT (On/Off/On)"),
|
||||||
|
_4PDT_ononon_1("4PDT (On/On/On Type 1)"), _4PDT_ononon_2("4PDT (On/On/On Type 2)"),
|
||||||
_5PDT("5PDT"), _5PDT_off("5PDT (On/Off/On)");
|
_5PDT("5PDT"), _5PDT_off("5PDT (On/Off/On)");
|
||||||
|
|
||||||
private String label;
|
private String label;
|
||||||
|
|||||||
Reference in New Issue
Block a user