~virbinarus/openlp/expandserviceitem

« back to all changes in this revision

Viewing changes to openlp/core/lib/projector/db.py

  • Committer: Tim Bentley
  • Author(s): Ken Roberts
  • Date: 2017-05-22 16:26:45 UTC
  • mfrom: (2737.1.2 pjlink2-c)
  • Revision ID: tim.bentley@gmail.com-20170522162645-zwqjgezvl6jsw4ig
-- Update test data for Class 2 tests
-- Update Projector() db class with new data
-- Update test_projectordb tests
-- Rename PJLink1 class to PJLink
-- Fix/update power on/off tests (Qt error not caught properly during test)
-- Remove skip from projector constants test

--------------------------------
lp:~alisonken1/openlp/pjlink2-c (revision 2739)
[SUCCESS] https://ci.openlp.io/job/Branch-01-Pull/2020/
[SUCCESS] https://ci.openlp.io/job/Branch-02-Functional-Tests/1930/
[SUCCESS] https://ci...

Show diffs side-by-side

added added

removed removed

Lines of Context:
150
150
        name:           Column(String(20))
151
151
        location:       Column(String(30))
152
152
        notes:          Column(String(200))
153
 
        pjlink_name:    Column(String(128))  # From projector (future)
154
 
        manufacturer:   Column(String(128))  # From projector (future)
155
 
        model:          Column(String(128))  # From projector (future)
156
 
        other:          Column(String(128))  # From projector (future)
157
 
        sources:        Column(String(128))  # From projector (future)
 
153
        pjlink_name:    Column(String(128))  # From projector
 
154
        manufacturer:   Column(String(128))  # From projector
 
155
        model:          Column(String(128))  # From projector
 
156
        other:          Column(String(128))  # From projector
 
157
        sources:        Column(String(128))  # From projector
 
158
        serial_no:      Column(String(30))   # From projector (Class 2)
 
159
        sw_version:     Column(String(30))   # From projector (Class 2)
 
160
        model_filter:   Column(String(30))   # From projector (Class 2)
 
161
        model_lamp:     Column(String(30))   # From projector (Class 2)
158
162
 
159
163
        ProjectorSource relates
160
164
    """
164
168
        """
165
169
        return '< Projector(id="{data}", ip="{ip}", port="{port}", pin="{pin}", name="{name}", ' \
166
170
            'location="{location}", notes="{notes}", pjlink_name="{pjlink_name}", ' \
167
 
            'manufacturer="{manufacturer}", model="{model}", other="{other}", ' \
168
 
            'sources="{sources}", source_list="{source_list}") >'.format(data=self.id,
169
 
                                                                         ip=self.ip,
170
 
                                                                         port=self.port,
171
 
                                                                         pin=self.pin,
172
 
                                                                         name=self.name,
173
 
                                                                         location=self.location,
174
 
                                                                         notes=self.notes,
175
 
                                                                         pjlink_name=self.pjlink_name,
176
 
                                                                         manufacturer=self.manufacturer,
177
 
                                                                         model=self.model,
178
 
                                                                         other=self.other,
179
 
                                                                         sources=self.sources,
180
 
                                                                         source_list=self.source_list)
 
171
            'manufacturer="{manufacturer}", model="{model}", serial_no="{serial}", other="{other}", ' \
 
172
            'sources="{sources}", source_list="{source_list}", model_filter="{mfilter}", ' \
 
173
            'model_lamp="{mlamp}", sw_version="{sw_ver}") >'.format(data=self.id,
 
174
                                                                    ip=self.ip,
 
175
                                                                    port=self.port,
 
176
                                                                    pin=self.pin,
 
177
                                                                    name=self.name,
 
178
                                                                    location=self.location,
 
179
                                                                    notes=self.notes,
 
180
                                                                    pjlink_name=self.pjlink_name,
 
181
                                                                    manufacturer=self.manufacturer,
 
182
                                                                    model=self.model,
 
183
                                                                    other=self.other,
 
184
                                                                    sources=self.sources,
 
185
                                                                    source_list=self.source_list,
 
186
                                                                    serial=self.serial_no,
 
187
                                                                    mfilter=self.model_filter,
 
188
                                                                    mlamp=self.model_lamp,
 
189
                                                                    sw_ver=self.sw_version)
181
190
    ip = Column(String(100))
182
191
    port = Column(String(8))
183
192
    pin = Column(String(20))
189
198
    model = Column(String(128))
190
199
    other = Column(String(128))
191
200
    sources = Column(String(128))
 
201
    serial_no = Column(String(30))
 
202
    sw_version = Column(String(30))
 
203
    model_filter = Column(String(30))
 
204
    model_lamp = Column(String(30))
192
205
    source_list = relationship('ProjectorSource',
193
206
                               order_by='ProjectorSource.code',
194
207
                               backref='projector',
359
372
        old_projector.model = projector.model
360
373
        old_projector.other = projector.other
361
374
        old_projector.sources = projector.sources
 
375
        old_projector.serial_no = projector.serial_no
 
376
        old_projector.sw_version = projector.sw_version
 
377
        old_projector.model_filter = projector.model_filter
 
378
        old_projector.model_lamp = projector.model_lamp
362
379
        return self.save_object(old_projector)
363
380
 
364
381
    def delete_projector(self, projector):