Exemplo n.º 1
0
    def __init__(self, dao, configuration, **kwargs):
        """
        Initialize a Hardware data controller instance.

        :param dao: the RAMSTK Program DAO instance to pass to the Hardware Data
                    Model.
        :type dao: :class:`ramstk.dao.DAO`
        :param configuration: the Configuration instance associated with the
                              current instance of the RAMSTK application.
        :type configuration: :class:`ramstk.Configuration.Configuration`
        """
        RAMSTKDataController.__init__(self,
                                      configuration,
                                      model=dtmHardwareBoM(dao),
                                      ramstk_module='hardware BOM',
                                      **kwargs)

        # Initialize private dictionary attributes.

        # Initialize private list attributes.

        # Initialize private scalar attributes.
        self._dmx_hw_rqrmnt_matrix = RAMSTKDataMatrix(dao, RAMSTKHardware,
                                                      RAMSTKRequirement)
        self._dmx_hw_tstng_matrix = RAMSTKDataMatrix(dao, RAMSTKHardware,
                                                     RAMSTKTest)
        self._dmx_hw_vldtn_matrix = RAMSTKDataMatrix(dao, RAMSTKHardware,
                                                     RAMSTKValidation)
Exemplo n.º 2
0
    def __init__(self, dao, configuration, **kwargs):
        """
        Initialize a Validation data controller instance.

        :param dao: the data access object used to communicate with the
                    connected RAMSTK Program database.
        :type dao: :class:`ramstk.dao.DAO.DAO`
        :param configuration: the RAMSTK configuration instance.
        :type configuration: :class:`ramstk.Configuration.Configuration`
        """
        RAMSTKDataController.__init__(self,
                                      configuration,
                                      model=dtmValidation(dao),
                                      ramstk_module='validation',
                                      **kwargs)

        # Initialize private dictionary attributes.

        # Initialize private list attributes.

        # Initialize private scalar attributes.
        self._dmx_vldtn_rqrmnt_matrix = RAMSTKDataMatrix(
            dao, RAMSTKValidation, RAMSTKRequirement)
        self._dmx_vldtn_hw_matrix = RAMSTKDataMatrix(dao, RAMSTKValidation,
                                                     RAMSTKHardware)
Exemplo n.º 3
0
    def __init__(self, dao, configuration, **kwargs):
        """
        Initialize a Requirement data controller instance.

        :param dao: the RAMSTK Program DAO instance to pass to the Requirement
                    Data Model.
        :type dao: :class:`ramstk.dao.DAO`
        :param configuration: the Configuration instance associated with the
                              current instance of the RAMSTK application.
        :type configuration: :class:`ramstk.Configuration.Configuration`
        """
        RAMSTKDataController.__init__(self,
                                      configuration,
                                      model=dtmRequirement(dao),
                                      ramstk_module='requirement',
                                      **kwargs)

        # Initialize private dictionary attributes.

        # Initialize private list attributes.

        # Initialize private scalar attributes.
        self._dmx_rqmt_hw_matrix = RAMSTKDataMatrix(dao, RAMSTKRequirement,
                                                    RAMSTKHardware)
        self._dmx_rqmt_sw_matrix = RAMSTKDataMatrix(dao, RAMSTKRequirement,
                                                    RAMSTKSoftware)
        self._dmx_rqmt_val_matrix = RAMSTKDataMatrix(dao, RAMSTKRequirement,
                                                     RAMSTKValidation)
Exemplo n.º 4
0
    def setUp(self):
        """Prepare the test fixture for the Matrix class."""
        self.Configuration = Configuration()

        self.Configuration.RAMSTK_BACKEND = 'sqlite'
        self.Configuration.RAMSTK_PROG_INFO = {
            'host': 'localhost',
            'socket': 3306,
            'database': '/tmp/TestDB.ramstk',
            'user': '',
            'password': ''
        }

        self.Configuration.DEBUG_LOG = \
            Utilities.create_logger("RAMSTK.debug", 'DEBUG', '/tmp/RAMSTK_debug.log')
        self.Configuration.USER_LOG = \
            Utilities.create_logger("RAMSTK.user", 'INFO', '/tmp/RAMSTK_user.log')

        # Create a data access object and connect to a test database.
        self.dao = DAO()
        _database = self.Configuration.RAMSTK_BACKEND + ':///' + \
            self.Configuration.RAMSTK_PROG_INFO['database']
        self.dao.db_connect(_database)

        self.dao.RAMSTK_SESSION.configure(bind=self.dao.engine,
                                          autoflush=False,
                                          expire_on_commit=False)
        self.session = scoped_session(self.dao.RAMSTK_SESSION)

        self.DUT = RAMSTKDataMatrix(self.dao, RAMSTKFunction, RAMSTKHardware)
Exemplo n.º 5
0
    def __init__(self, dao, configuration, **kwargs):
        """
        Initialize a Function data controller instance.

        :param dao: the RAMSTK Program DAO instance to pass to the
                    Function Data Model.
        :type dao: :class:`ramstk.dao.DAO`
        :param configuration: the Configuration instance associated with
                              the current instance of the RAMSTK
                              application.
        :type configuration: :class:`ramstk.Configuration.Configuration`
        """
        RAMSTKDataController.__init__(self,
                                      configuration,
                                      model=dtmFunction(dao, **kwargs),
                                      ramstk_module='function',
                                      **kwargs)

        # Initialize private dictionary attributes.

        # Initialize private list attributes.

        # Initialize private scalar attributes.
        self._dmx_fctn_hw_matrix = RAMSTKDataMatrix(dao, RAMSTKFunction,
                                                    RAMSTKHardware)
        self._dmx_fctn_sw_matrix = RAMSTKDataMatrix(dao, RAMSTKFunction,
                                                    RAMSTKSoftware)

        # Initialize public dictionary attributes.

        # Initialize public list attributes.

        # Initialize public scalar attributes.

        # Subscribe to PyPubSub messages.
        pub.subscribe(self.request_do_select_all, 'selected_revision')
        pub.subscribe(self.request_do_delete, 'request_delete_function')
        pub.subscribe(self.request_do_insert, 'request_insert_function')
        pub.subscribe(self.request_do_update, 'request_update_function')
        pub.subscribe(self.request_do_update_all,
                      'request_update_all_functions')
        pub.subscribe(self.request_set_attributes, 'editing_function')