37 lines
1.2 KiB
TypeScript
37 lines
1.2 KiB
TypeScript
|
// 1x16 pin connection component for the LogicSimulator
|
||
|
// Copyright (C) 2022 Sascha Nitsch
|
||
|
|
||
|
// This program is free software: you can redistribute it and/or modify
|
||
|
// it under the terms of the GNU General Public License as published by
|
||
|
// the Free Software Foundation, either version 3 of the License, or
|
||
|
// (at your option) any later version.
|
||
|
|
||
|
// This program is distributed in the hope that it will be useful,
|
||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
|
// GNU General Public License for more details.
|
||
|
|
||
|
// You should have received a copy of the GNU General Public License
|
||
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||
|
|
||
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||
|
class Conn1x16 extends BaseComponent {
|
||
|
constructor(simulator: Simulator, id: string, param: BaseComponentParam) {
|
||
|
super(simulator, id, param);
|
||
|
for (let i = 0; i < 16; ++i) {
|
||
|
this.pins.set('a' + (i + 1), new TriState(this, -20, (i - 7) * 15 - 1.5));
|
||
|
}
|
||
|
}
|
||
|
|
||
|
setup(canvas: SVGElement) {
|
||
|
super.doSetup('conn1x16', canvas);
|
||
|
}
|
||
|
|
||
|
io() {
|
||
|
for (let i = 1; i <= 16; ++i) {
|
||
|
this.getPin('a' + i).getAndReset();
|
||
|
}
|
||
|
return false;
|
||
|
}
|
||
|
}
|