*-----------------------------------------------------------------------------
*  Machine Parameter Part File loading
*-----------------------------------------------------------------------------
*  Module Description
*    The value in machine parameter MP4310.5 <NP_W986_color_adjustment>
*    [0..3] actives machine parameters who are allocated in a machine
*    parameter part file.
*
*     <NP_W986_color_adjustment>  MP part file
*              0                  PLC:\MP\MP_Part0.A
*              1                  PLC:\MP\MP_Part1.A
*              2                  PLC:\MP\MP_Part2.A
*              3                  PLC:\MP\MP_Part3.A
*
*-----------------------------------------------------------------------------

#define /s    BL_MP_part_file_identifier               B

#define /s    WL_number_MP_part_file                   W
#define /s    WL_stack_synchronize                     W

#include Mac_Lib.inc

GLOBAL MP_part_file

;----------------------------
LBL MP_part_file
;----------------------------

  L      WL_number_MP_part_file
  ==     NP_W986_color_adjustment
  EMT

  SUBM   MP_part_file_submit
  =      BL_MP_part_file_identifier
  ==     K+0
  S      PN_error_submit_spawn_queue_full

  L      PN_error_submit_spawn_queue_full
  EMT

  L      NP_W986_color_adjustment
  =      WL_number_MP_part_file

EM

;----------------------------
LBL MP_part_file_submit

  L      NP_W986_color_adjustment
  >      K+3
  EMT

  L      NP_W986_color_adjustment
  <      K+0
  EMT

  CASE   NP_W986_color_adjustment
    CM     Part_file_0
    CM     Part_file_1
    CM     Part_file_2
    CM     Part_file_3
  ENDC

  PS     K &SG_MP_part_file
  CM     9034
  PL     WL_stack_synchronize
  M_display_module_error

  LN     MG_commissioning
  EMT

  CM     9019
  PL     BG_bytes_on_stack
  M_display_module_error

  L      BG_bytes_on_stack
  >      K+0
  S      PN_error_stack_not_empty

EM

;----------------------------
LBL Part_file_0

  L      S"PLC:\MP\MP_PART0.A"
  =      SG_MP_part_file

EM

;----------------------------
LBL Part_file_1

  L      S"PLC:\MP\MP_PART1.A"
  =      SG_MP_part_file

EM

;----------------------------
LBL Part_file_2

  L      S"PLC:\MP\MP_PART2.A"
  =      SG_MP_part_file

EM

;----------------------------
LBL Part_file_3

  L      S"PLC:\MP\MP_PART3.A"
  =      SG_MP_part_file

EM
