Skip to content
This repository has been archived by the owner on Oct 15, 2022. It is now read-only.

Commit

Permalink
common: move ElevatorData and FloorData to common module
Browse files Browse the repository at this point in the history
  • Loading branch information
M Aiman Ismail committed Feb 14, 2020
1 parent 4906954 commit 1c67317
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions common/cps_common/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,29 @@

import logging
from datetime import datetime
from collections import deque
from typing import Deque


class ElevatorData:
def __init__(self, id: int):
self.id = id
self.floor = 0
self.door = "open"
self.status = "online"
self.actual_capacity = 0
self.max_capacity = 0

# used by controller only
self.queue: Deque[int] = deque()


class FloorData:
def __init__(self, id: int):
self.id = id
self.waiting_count = 0
self.up_pressed = False
self.down_pressed = False


class Passenger:
Expand Down

0 comments on commit 1c67317

Please sign in to comment.