Exemplo n.º 1
0
def add_gauge():
    data = query(Standards.Gauge, 'all', order=Standards.Gauge.thickness)
    name = outputList(data, 'gauge')
    thick = outputList(data, 'thickness')
    gauge = []
    for i, j in zip(name, thick):
        gauge.append(f'{i} : {j}')
    items = [{
        'type': 'print',
        'name': 'material',
        'elements': gauge
    }, {
        'type': 'input',
        'name': 'gaugeName',
        'elements': 'ADD GAUGE NAME: '
    }, {
        'type': 'input',
        'name': 'gaugeThickness',
        'elements': 'ADD GAUGE THICKNESS: '
    }]
    v = View(title='ADD MATERIAL', version='input', items=items)

    gauge = Standards.Gauge(gauge=v.answer[0], thickness=v.answer[1])
    insert(gauge)

    add_material_standards()
Exemplo n.º 2
0
def add_material():
    data = query(Standards.Material, 'all')
    material = outputList(data, 'name')
    data = query(Standards.MaterialType, 'all')
    materialType = outputList(data, 'name')
    items = [{
        'type': 'print',
        'name': 'material',
        'elements': material
    }, {
        'type': 'list',
        'name': 'materialType',
        'message': 'MATERIAL TYPE: ',
        'elements': materialType
    }, {
        'type': 'input',
        'name': 'materialName',
        'elements': 'MATERIAL NAME: '
    }, {
        'type': 'input',
        'name': 'materialDensity',
        'elements': 'MATERIAL DENSITY: '
    }]
    v = View(title='ADD MATERIAL', version='input', items=items)

    materialType = query(Standards.MaterialType, 'first', name=v.answer[0])
    material = Standards.Material(materialType_id=materialType,
                                  materialType=materialType,
                                  name=v.answer[1],
                                  density=v.answer[2])

    insert(material)

    add_material_standards()
Exemplo n.º 3
0
def add_work_center():
    data = query(Standards.ProcessCategory,
                 'all',
                 order=Standards.ProcessCategory.name)
    elements = outputList(data, 'name')
    items = [{
        'type': 'input',
        'name': 'workCenterID',
        'elements': 'WORK CENTER ID NUMBER: '
    }, {
        'type': 'input',
        'name': 'workCenterName',
        'elements': 'WORK CENTER NAME: '
    }, {
        'type': 'list',
        'name': 'processCategory',
        'message': 'WORK CENTER PROCESS: ',
        'elements': elements
    }, {
        'type': 'input',
        'name': 'hourlyRate',
        'elements': 'HOURLY RATE: '
    }, {
        'type': 'input',
        'name': 'hourlyOverhead',
        'elements': 'HOURLY OVERHEAD: '
    }, {
        'type': 'input',
        'name': 'estimatedTP',
        'elements': 'ESTIMATED THROUGH-PUT: '
    }, {
        'type': 'input',
        'name': 'estimatedSetup',
        'elements': 'ESTIMATED SETUP TIME: '
    }]
    v = View(title='ADD PROCESS MENU', version='input', items=items)

    workCenter = Standards.WorkCenter(workCenterID=v.answer[0],
                                      name=v.answer[1],
                                      category=v.answer[2],
                                      rate=v.answer[3],
                                      overhead=v.answer[4],
                                      throughput=v.answer[5],
                                      setup=v.answer[6])

    insert(workCenter)

    maintenance()
Exemplo n.º 4
0
def add_proccess_category():
    data = query(Standards.ProcessCategory,
                 'all',
                 order=Standards.ProcessCategory.name)
    elements = outputList(data, 'name')
    items = [{
        'type': 'print',
        'name': 'processes',
        'elements': elements
    }, {
        'type': 'input',
        'name': 'processCategoryName',
        'elements': 'PROCESS NAME: '
    }, {
        'type': 'input',
        'name': 'defaultRate',
        'elements': 'DEFAULT RATE: '
    }, {
        'type': 'input',
        'name': 'defaultOverhead',
        'elements': 'DEFAULT OVERHEAD: '
    }, {
        'type': 'input',
        'name': 'defaultTP',
        'elements': 'DEFAULT THROUGH-PUT: '
    }, {
        'type': 'input',
        'name': 'unitsTP',
        'elements': 'THROUGH-PUT UNITS: '
    }, {
        'type': 'input',
        'name': 'defaultSetup',
        'elements': 'DEFAULT SETUP TIME (h): '
    }]
    v = View(title='ADD PROCESS CATEGORY', version='input', items=items)

    processCategory = Standards.ProcessCategory(name=v.answer[0],
                                                rate=v.answer[1],
                                                overhead=v.answer[2],
                                                throughput=v.answer[3],
                                                setup=v.answer[5])

    insert(processCategory)

    maintenance()
Exemplo n.º 5
0
def add_material_type():
    data = query(Standards.MaterialType, 'all')
    elements = outputList(data, 'name')
    items = [{
        'type': 'print',
        'name': 'materialTypes',
        'elements': elements
    }, {
        'type': 'input',
        'name': 'materialType',
        'elements': 'MATERIAL TYPE: '
    }]
    v = View(title='ADD MATERIAL TYPE', version='input', items=items)

    materialType = Standards.MaterialType(name=v.answer[0])
    insert(materialType)

    add_material_standards()
Exemplo n.º 6
0
def add_command():
    server.insert(title_text.get(), author_text.get(), year_text.get(),
                  isbn_text.get())
    list1.delete(0, END)
    list1.insert(END, (title_text.get(), author_text.get(), year_text.get(),
                       isbn_text.get()))
Exemplo n.º 7
0
                              setup=0.25)
]

workCenter = [
    Standards.WorkCenter(workCenterID=11015,
                         name='PRIMA LASER',
                         category=processCategory[0],
                         rate=42,
                         overhead=120,
                         throughput=200,
                         setup=0.15)
]

# standards = [materialType, material, gauge, processCategory, workCenter]

insert(*materialType)
insert(*material)
insert(*gauge)
insert(*processCategory)
insert(*workCenter)

# STANDARDS

# standardsSeed['materialType'] = ['sheet metal', 'bar stock']
# standardsSeed['material'] = [{
#     'materialType': 'sheet metal',
#     'materialName': 'carbon steel',
#     'materialDensity': 4000
# },{
#     'materialType': 'sheet metal',
#     'materialName': 'stainless steel',