Forked from reversaal / OhmPi
Source project has a limited visibility.
Point.py 730 bytes
# -*- coding: utf-8 -*-

from Model.Except import NotImplementedMethodeError

class Point(object):
    def __init__(self, name:str = "", status = None):
        super(Point, self).__init__()

        self._status = status

        self._name = name

    @property
    def name(self):
        return self._name

    @name.setter
    def name(self, name):
        self._name = name
        self._status.modified()

    def point_is_named(self):
        """
        Returns:
            True if the point is named.
        """
        return self._name.strip() != ""

    def is_nan(self):
        raise NotImplementedMethodeError(self, self.is_nan)

    def dist(self, p2):
        raise NotImplementedMethodeError(self, self.dist)