Skip to content
This repository has been archived by the owner on Jul 14, 2024. It is now read-only.

Commit

Permalink
閉塞を計算する
Browse files Browse the repository at this point in the history
  • Loading branch information
n4o847 committed May 17, 2024
1 parent 608ec63 commit 7e6b1d0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ptcs/ptcs_control/components/section.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def is_blocked(self) -> bool:

@is_blocked.setter
def is_blocked(self, value: bool):
self.control.logger.info(f"{self.id}.is_blocked = {value}")
# self.control.logger.info(f"{self.id}.is_blocked = {value}")
self._is_blocked = value

def block(self) -> None:
Expand Down
9 changes: 9 additions & 0 deletions ptcs/ptcs_control/control/fixed_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,20 @@ def update(self) -> None:
状態に変化が起こった後、すべてを再計算する。
"""

self._calc_block()
self._calc_direction()
self._calc_stop()
self._calc_speed()
self.event_queue.clear()

def _calc_block(self) -> None:
for section_id, section in self.sections.items():
section.is_blocked = False

for train_id, train in self.trains.items():
train.head_position.section.is_blocked = True
train.compute_tail_position().section.is_blocked = True

def _calc_direction(self) -> None:
"""
ポイントをどちら向きにするかを計算する。
Expand Down

0 comments on commit 7e6b1d0

Please sign in to comment.