%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/share/hplip/base/__pycache__/
Upload File :
Create Path :
Current File : //usr/share/hplip/base/__pycache__/maint.cpython-312.pyc

�

=	fn����ddl�ddl�ddlmZmZddlmZmZmZddl	Z	ddl
mZmZdZ
dZd	Zd
Zd�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z!d�Z"d�Z#d�Z$da%d�Z&d �Z'd!�Z(d"�Z)d#�Z*d$�Z+d%�Z,d&�Z-d'�Z.d(�Z/d)�Z0d*�Z1d+�Z2d,�Z3d-�Z4d.�Z5d/�Z6d0�Z7d1�Z8d2�Z9d3�Z:d4�Z;d5�Z<d6�Z=d7�Z>d8�Z?d9�Z@d:�ZAd;�ZBd<�ZCd=�ZDd>�ZEd?�ZFeFfd@�ZGdA�ZHdB�ZIdC�ZJdD�ZKdE�ZLdF�ZMdG�ZNdH�ZOdI�ZPdJ�ZQdK�ZRdL�ZSdM�ZTdgdN�ZUdO�ZVdP�ZWdQ�ZXdR�ZYdS�ZZdT�Z[dU�Z\dV�Z]dW�Z^dX�Z_dY�Z`dZ�Zad[�Zbd\�Zcd]�Zdd^�Zed_�Zfd`�Zgda�Zhdb�Zidc�Zjdd�Zkde�Zldf�Zmy)h�)�*)�status�pml�)�pcl�ldl�colorcalN)�
to_bytes_utf8�StringIOa`<?xml version="1.0" encoding="UTF-8"?>
<!--  THIS DATA SUBJECT TO DISCLAIMER(S)INCLUDED WITH THE PRODUCT OF ORIGIN. -->
<ipcap:InternalPrintCap xmlns:ipcap="http://www.hp.com/schemas/imaging/con/ledm/internalprintcap/2008/03/21" xmlns:ipdyn="http://www.hp.com/schemas/imaging/con/ledm/internalprintdyn/2008/03/21" xmlns:dd="http://www.hp.com/schemas/imaging/con/dictionaries/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.hp.com/schemas/imaging/con/ledm/internalprintcap/2008/03/21 ../schemas/InternalPrintCap.xsd http://www.hp.com/schemas/imaging/con/ledm/internalprintdyn/2008/03/21 ../schemas/InternalPrintDyn.xsd http://www.hp.com/schemas/imaging/con/dictionaries/1.0/ ../schemas/dd/DataDictionaryMasterLEDM.xsd">
                                <ipdyn:JobType>%s</ipdyn:JobType>
</ipcap:InternalPrintCap>"

        z/DevMgmt/InternalPrintDyn.xmlz/DevMgmt/InternalPrintCap.xmlz7<ipdyn:JobType>cleaningVerificationPage</ipdyn:JobType>c��|�}|rA|jtjtjdd��|j	�|S)NrT)�style�direct)�writeEmbeddedPMLr�OID_AUTO_ALIGNMENT�AUTO_ALIGNMENT�
closePrint��dev�loadpaper_ui�oks   �/usr/share/hplip/base/maint.py�
AlignType1r0sF��	��B�	����S�3�3� �/�/�q�$(�	�	*�	����
�I�c��|�}|r>|jtjtj�|j	�|S�N��setPMLrrr�closePMLrs   r�
AlignType1PMLr:s4��	��B�	��
�
�3�)�)�3�+=�+=�>�����
�Irc�n�d\}}}}}d}	|dk7�r|dk(rYd}|j�d}
tt|
��D�cgc]}|
|��	}}t|vr�tjd�d}n�|dk(rd}|�}	|	r�d	}n�|d	k(r!d}t
|�|d
ddd	d
�\}	}|	r�d}n�|dk(rd}|dddd	d
�\}	}|	rid}nf|dk(rd}|dddd	d�\}	}|	rNd}nK|dk(rd}|dddd	d�\}	}|	r3d}n0|dk(r|�}	|	rt|||||�d}n|dk(rd}	|�d}|dk7r��|	Scc}w)N)r�r!�r"F���rr�agentsz3Cannot perform alignment with 0 or 1 pen installed.�d��A�h�kc�r"�B�v��C��D�cr!)�getStatusFromDeviceID�range�len�AGENT_TYPE_NONE�log�error�alignType2Phase1�alignType2Phase2)
rr�align_ui�bothpens_ui�state�a�br1�dr�pens�x�	pen_typess
             r�
AlignType2rCDs���%��E�1�a��A�	�B�
�2�+��A�:��E��,�,�.�x�8�D�*/��D�	�*:�;�Q��a��;�I�;��)�+��	�	�O�P���
�a�Z��E���B����
�a�Z��E��S�!��S�#�t�Q��3�E�B�����
�a�Z��E��S�#�t�Q��3�E�B�����
�a�Z��E��S�#�t�Q��2�E�B�����
�a�Z��E��S�#�s�A�q�1�E�B�����
�a�Z���B�� ��a��A�q�1��E�
�c�\��B��M��E�c�2�+�f�I��_<s�D2c��d\}}}}}	}
d}|dk7r�|dk(rd}|�}|r�t|�d}n�|dk(rd}|dddd	d
�\}}|r�d	}n�|d	k(rd}|dddd	d
�\}}|r�d
}n�|d
k(rd}|dddd	d
�\}}|r�d}n�|dk(rd}|dddd	d
�\}}	|rkd}nh|dk(r%d}t|||||	�|dk(rd}nJ|�}|rAd}n>|dk(rd}t|�|d�\}}
|rd}n|dk(r|�}|rt||
�d}|dk7r��|S)N)rr!r!r"r"r!Fr#rrr'r(r)r&r*r+r,r"r.�kr-r0r/�	�r!�
)�alignType3Phase1�alignType3Phase2�alignType3Phase3�alignType3Phase4)rrr:�paperedge_ui�
align_typer<r=r>r1r?�zcars            r�
AlignType3rP~s~��-��E�1�a��A�s�	�B�
�2�+��A�:��E���B�� ��%���
�a�Z��E��S�#�t�Q��3�E�B�����
�a�Z��E��S�#�t�Q��3�E�B�����
�a�Z��E��S�#�s�A�r�2�E�B�����
�a�Z��E��S�#�t�Q��3�E�B�����
�a�Z��E��S�!�Q��1�-��Q����!�^����E�
�a�Z��E��S�!�"�2�&�G�B�����
�a�Z���B�� ��c�*��E�k�2�+�n�Irc
���d\}}ddg}	d\}
}}}
}}}dg}d}tj|j��|_|jtt
fvrddg}}n�|jtk(rdgd�}}ng|jtk(rdgd�}}nM|jtk(rdgd	�}}n3|jtk(rdgd
�}}n|jtk(rdgd�}}|dk7�r|dk(rK|�}|r<|dk(r
t|��n�|d
k(r
t|��n�|dk(r
t|��n�d|}}�n�d|	}}�n�|dk(r|d�\}}
|�s�d|	}}�n�|dk(rD|dk(rt||
|||
|��nn|d
k(rt||
|||
|||��nUt!||
|||
|||��nA|dk(r?|�}|r1|dk(r
t#|��n!|d
k(r
t%|��nt'|��nd|	}}n�|dk(r
|�d}n�|dk(r|ddddd�\}}|s�d|	}}n�|dk(r|ddddd�\}}|s�d|	}}n�|dk(r|ddddd�\}}|s�d|	}}n�|dk(r|ddddd�\}}|s�d|	}}n�|dk(r|ddddd�\}}
|sld|	}}ng|d k(r|d!dddd�\}}|sQd|	}}nL|d"k(r|d#d$�\}}|s9d|	}}n4|d%k(r|d&d$�\}}|s!d|	}}n|dk(rd}t(j+d'�|}|d(z
}|dk7r��|S))N)rri�r#)rrrrrrrFr%r)r&��r"r#)r&�,r"r#)r&����X�r"r-r#)
r&rTrUrVrW� �r"r-r#r-r/rGr&rHr"rRr+r,rEr*rSr)rTr(�rUr.rVr0rW�ErX�F�rY�Gz#Alignment canceled at user request.r)r�getPenConfigurationr2�
pen_config�AGENT_CONFIG_NONE�AGENT_CONFIG_INVALID�AGENT_CONFIG_BLACK_ONLY�AGENT_CONFIG_PHOTO_ONLY�AGENT_CONFIG_COLOR_ONLY�AGENT_CONFIG_COLOR_AND_BLACK�AGENT_CONFIG_COLOR_AND_PHOTO�alignType4Phase1�alignType5Phase1�alignType7Phase1�alignType4Phase2�alignType5Phase2�alignType7Phase2�alignType4Phase3�alignType5Phase3�alignType7Phase3r6�warning)rrNrr:rM�
invalidpen_ui�coloradj_uir<�statepos�user_cancel_statesr=r>r1r?�e�f�g�error_statesr�statess                    r�	AlignxBowr{�s����O�E�8�����-��A�q�!�Q��1�a��4�L�	�B��/�/��0I�0I�0K�L�C�N�
�~�~�+�-A�B�B��b�T�v��	���2�	2��?�v��	���2�	2��?�v��	���2�	2��?�v��	���7�	7��<�v��	���7�	7��F�v��
�2�+��A�:���B����?�$�S�)��1�_�$�S�)��1�_�$�S�)�'(�,�f�H�#$�&8�&���a�Z� ��$�E�B���#$�&8�&��
�a�Z��Q�� ��a��A�q�!�4��q�� ��a��A�q�!�Q��:� ��a��A�q�!�Q��:�
�a�Z���B����?�$�S�)��1�_�$�S�)�$�S�)�#$�&8�&��
�c�\��O��E�
�c�\��S�#�s�A�r�2�E�B���#$�&8�&��
�c�\��S�#�t�Q��3�E�B���#$�&8�&��
�c�\��S�#�t�Q��3�E�B���#$�&8�&��
�c�\��S�#�t�Q��3�E�B���#$�&8�&��
�c�\��S�#�s�A�r�2�E�B���#$�&8�&��
�c�\��S�#�t�Q��3�E�B���#$�&8�&��
�c�\���R�(�E�B���#$�&8�&��
�c�\���R�(�E�B���#$�&8�&��
�d�]��B��K�K�=�>��x� ���A�
��w�2�+�z�Irc��d}d}|dk7rE|dk(rd}|�}|s/d}n,|dk(rd}|�}|rt|�d}n|dk(r	|�d}|dk7r�E|S)NrFr#r&r)�alignType6Phase1)r�ui1�ui2rr<r�accepts       r�
AlignType6r�8sr��
�E�	�B�
�2�+��A�:��E��U�F����
�a�Z��E���B�� ��%���
�a�Z��E��E�#�2�+�(�Irc�r�d\}}}}}d}|dk7r�|dk(rd}|�}|r�t|�}	d}n�|dk(rd}|dddd	d
�\}}|rkd}nh|dk(rd}|ddd
d	d
�\}}|rPd	}nM|d	k(rd}|dddd	d
�\}}|r5d}n2|dk(rd}|dddd	d
�\}}|rd}n|dk(rt|	||||�d}|dk7r��|S)N)rr/r/r/r/Fr#rrr'r,rEr"rFr&r+r1r.r)r-r0r(r/)�alignType8Phase1�alignType8Phase2)
rrr:r<r=r>r1r?r�num_inkss
          r�
AlignType8r�Rs��%��E�1�a��A�	�B�
�2�+��A�:��E���B��+�C�0����
�a�Z��E��S�#�s�A�q�1�E�B�����
�a�Z��E��S�#�s�A�q�1�E�B�����
�a�Z��E��S�#�t�Q��2�E�B�����
�a�Z��E��S�#�t�Q��2�E�B�����
�a�Z��S�(�A�q�!�Q�7��E�G�2�+�J�Irc��t|�}d}|dk7rw|dk(rd}|�}|r`t|�d}nR|dk(r2||t�}tj	|�t|||�d}n|dk(rd}|�}|rt
|�|dk7r�vyy�Nrr#rr&)�alignType10SetPattern�alignType10Phase1�ALIGN_TYPE_LBOWr6�debug�alignType10Phase2�alignType10Phase3)rrr:�patternr<r�valuess       r�AlignType10r�~s���#�C�(�G�
�E�
�2�+��A�:��E���B��!�#�&���
�a�Z��g��7�F��I�I�f���c�6�7�3��E�
�a�Z��E���B��!�#�&�%�2�+rc��d}tj|j��}tj	d|z�|t
k(rd}n|tk(rd}n|ttfvrd}tj	d|z�|S�Nz
Pen config=%drr&r"z
Pattern=%d)	rr_r2r6r�rcrfrg�AGENT_CONFIG_COLOR_AND_GREY)rr�r`s   rr�r��sw���G��+�+�C�,E�,E�,G�H�J��I�I�o�
�*�+��,�,���	�3�	3���	�4�6Q�R�	R����I�I�l�W�$�%��Nrc��|jtjtj�|j	�yr)rr�OID_PRINT_INTERNAL_PAGE�"PRINT_INTERNAL_PAGE_ALIGNMENT_PAGEr�rs rr�r��s.������4�4��?�?�A��N�N�rc�r�ddjtjdg�}}|D]M}|dz
}|snDdj|tjdt	|�dt	|�t	|�dg�}�Odj|tjg�}|j|�|j
�y)Nr��
rz*o5W�)�joinr�UEL�ESC�chr�	printDatar)rr�r��i�prAs      rr�r��s����b�g�g�s�w�w��o�&�q�A�
�Z��	�Q������G�G�Q�����S��V�V�S��\�3�q�6�SW�X�Y��	Z�	����C�G�G���A��M�M�!���N�N�rc��|jtjtj�|j	�yr)rrr��/PRINT_INTERNAL_PAGE_ALIGNMENT_PAGE_VERIFICATIONrr�s rr�r��s.������4�4��L�L�N��N�N�rc
�b�|tk(r6|dk(r
ddddddddd�}|S|dk(r
ddddddddd�}|S|dk(rddddddddd�}S|tk(r2|dk(rddd	�}|S|dk(rdd
ddd
d
d
ddd�	}|S|dk(rdddddddddd�	}S|dk(r
ddddddddd�}|S|dk(r
ddddddddd�}|S|dk(rddddddddd�}S)Nr)T�)TrF)Fr)r'r+r.r0r[r\r^�Hr&)TrZr")r'r+)Tr*)	r'r+r.r0r[r\r^r��I)�ALIGN_TYPE_LIDIL_0_5_4�ALIGN_TYPE_LIDIL_DJ_D1600)r�rN�controlss   r�align10and11and14Controlsr��s����+�+��a�<�)�(�(�)�)�)�)�)�,�H�h�O�Y��\�)�)�)�)�(�(�(�(�+�H�V�O�E��\�(�)�)�)�(�(�(�(�+�H�B�O�q
�0�	0��a�<�)�(�+�H�l�O�i��\�)�)�)�)�)�)�)�(�(�+�H�f�O�S��\�(�)�)�)�(�(�(�(�(�+�H�P�O�;�a�<�(�(�(�)�)�)�)�)�,�H�8�O�)��\�(�(�)�)�(�(�(�(�+�H�&�O���\�(�(�)�)�(�(�(�(�+�H��Orc�@�t|�}|�|�yd}|dk7r�|dk(rd}|�}|rkt|�d}n]|dk(r=||t�}tj	|�t||||j�d}n|dk(rd}|�}|rt|�|dk7r��yyr�)�alignType11SetPattern�alignType11Phase1r�r6r��alignType11Phase2r`�alignType11Phase3�rrr:rrr�r<rr�s        r�AlignType11r� s���#�C�(�G������
�E�
�2�+��A�:��E���B��!�#�&���
�a�Z��g�'=�>�F��I�I�f���c�6�7�C�N�N�C��E�
�a�Z��E���B��!�#�&�%�2�+rc��d}tj|j��|_tjd|jz�|jttfvrd}|jtk(rd}n*|jtk(rd}n|jtk(rytjd|z�|Sr��rr_r2r`r6r�rcrerfrgrd�rr�s  rr�r�<����G��/�/��0I�0I�0K�L�C�N��I�I�o����.�/�
�~�~�1�3J�K�K���
�~�~�5�5���	���7�	7���	���2�	2���I�I�l�W�$�%��Nrc���|jtj��|jtjtj��|j�yr�r�r�buildResetPacket�buildReportPagePacket�#COMMAND_REPORT_PAGE_PEN_CALIBRATIONrr�s rr�r�Q�>���M�M�#�&�&�(�)��M�M�#�+�+�C�,S�,S�T�U��N�N�rc���d}|tk(rtj}|dd}nt|tk(rtj}|dd}nU|t
k(r"tjtjz}n*|tk(r!tjtjz}tjd||fz�|jtj||��|j�y)Nrr"�Active colors=0x%x Values=%s�
rcr�COMMAND_SET_PEN_ALIGNMENT_3_Kre�!COMMAND_SET_PEN_ALIGNMENT_3_COLORrfrg�!COMMAND_SET_PEN_ALIGNMENT_3_PHOTOr6r�r��buildSetPenAlignment3Packetr�rr�r�r`�
active_colorss     rr�r�W����M��,�,��9�9�
������	�.�	.��=�=�
������	�3�	3��9�9�C�<a�<a�a�
�	�3�	3��=�=��@e�@e�e�
��I�I�,�
�v�/F�F�G��M�M�#�1�1�-��H�I��N�N�rc���|jtj��|jtjtj��|j�yr�r�rr�r��*COMMAND_REPORT_PAGE_PEN_CALIBRATION_VERIFYrr�s rr�r�m�>���M�M�#�&�&�(�)��M�M�#�+�+�C�,Z�,Z�[�\��N�N�rc�<�|�}|rt|�|�}|Sr)�alignType13Phase1)rr�scanner_align_load_uirs    r�AlignType13r�ss!��	��B�	��#��
"�
$��
�Irc��|jtjtj�|j	�yrrr�s rr�r�{s%���J�J�s�%�%�s�'9�'9�:��L�L�Nrc�4�tj|d�}|stj|d�}|s&tjd�|j	�ytd�|vr&tj
d�|j	�ytd�|vr&tj
d�|j	�ytd	�|vr&tjd
�|j	�ytj|d�}td�|vr&tj
d�|j	�ytd
�|vr=tjd�tj|dd�|j	�ytd�|vrCtjd�tj|dd�|j	�|�Std�|vr�tjd�tj|dd�}ddl}|j|d�d}|j|d�d}d|z}tj||�}|j|d�d}|j|d�d}d|zdz}|a
|j	�y)N�/Calibration/Statez$Unable to retrieve calibration stater�ParmsRequestedz"Restart device and start alignmentrz
404 Not Foundz Device may not support Alignmentz	Printing<z$Previous alignment job not completedz /DevMgmt/ConsumableConfigDyn.xml�
AlignmentMode�	automaticz%Device supports automatic calibrationz/Calibration/Sessionz�<cal:CalibrationState xmlns:cal=\"http://www.hp.com/schemas/imaging/con/cnx/markingagentcalibration/2009/04/08\" xmlns:dd=\"http://www.hp.com/schemas/imaging/con/dictionaries/1.0/\">Printing</cal:CalibrationState>�
semiAutomaticz)Device supports semiAutomatic calibration�manualz"Device supports manual calibrationz/Jobsz
zSession/�<z/Calibration/Session/z/ManualSelectedPatterns.xml)r�StatusType10FetchUrlr6r��closer
r7�warn�string�split�calibrationSession)r�funcr�datar�s     r�dataModelHelperr��sD���&�&�t�-A�B�D���*�*�4�1E�F����	�	�8�9��	�	����%�&�$�.��	�	�6�7��	�	����_�%��-��	�	�4�5��	�	����[�!�T�)����7�8��	�	����&�&�t�-O�P�D��_�%�T�1��	�	�4�5��	�	����[�!�T�)��	�	�9�:��#�#�D�*@�Cb�	c��	�	����_�%��-��	�	�=�>��#�#�D�*@�Cb�	c��	�	���u���X��$�&��	�	�6�7��*�*�4�1G�Ji�j����|�|�D�'�*�1�-���|�|�D�&�)�!�,����~���*�*�4��6���|�|�D�*�-�a�0���|�|�D�#�&�q�)��&��-�0M�M��!���	�	��rc��tjd|�d|�d|�d|�d|�d|�d|�d|�d	|	�d
|
���|j}tj|d�}|syd
|vr d|vrytj|d�}d
|vr� d|�d|�d|�d|�d|�d|�d|�d|�d|	�d|
�d�}dt
�dt
|��d�|z}tj|t
|�}y)Nza=z b=z c=z d=z e=z f=z g=z h=z i=z j=r�rr��CalibrationValida�<?xml version="1.0" encoding="UTF-8"?>
<!-- THIS DATA SUBJECT TO DISCLAIMER(S) INCLUDED WITH THE PRODUCT OF ORIGIN. -->
<ManualSelectedPatterns xmlns="http://www.hp.com/schemas/imaging/con/cnx/markingagentcalibration/2009/04/08" xmlns:locid="http://www.hp.com/schemas/imaging/con/ledm/localizationids/2007/10/31/" xmlns:psdyn="http://www.hp.com/schemas/imaging/con/ledm/productstatdyn/2007/10/31"><SelectedPattern><Identifier><Id>1</Id></Identifier><Choice><Identifier><Id>zy</Id></Identifier></Choice></SelectedPattern><SelectedPattern><Identifier><Id>2</Id></Identifier><Choice><Identifier><Id>zy</Id></Identifier></Choice></SelectedPattern><SelectedPattern><Identifier><Id>3</Id></Identifier><Choice><Identifier><Id>zy</Id></Identifier></Choice></SelectedPattern><SelectedPattern><Identifier><Id>4</Id></Identifier><Choice><Identifier><Id>zy</Id></Identifier></Choice></SelectedPattern><SelectedPattern><Identifier><Id>5</Id></Identifier><Choice><Identifier><Id>zy</Id></Identifier></Choice></SelectedPattern><SelectedPattern><Identifier><Id>6</Id></Identifier><Choice><Identifier><Id>zy</Id></Identifier></Choice></SelectedPattern><SelectedPattern><Identifier><Id>7</Id></Identifier><Choice><Identifier><Id>zy</Id></Identifier></Choice></SelectedPattern><SelectedPattern><Identifier><Id>8</Id></Identifier><Choice><Identifier><Id>zy</Id></Identifier></Choice></SelectedPattern><SelectedPattern><Identifier><Id>9</Id></Identifier><Choice><Identifier><Id>z�</Id></Identifier></Choice></SelectedPattern></SelectedPattern><SelectedPattern><Identifier><Id>10</Id></Identifier><Choice><Identifier><Id>zE</Id></Identifier></Choice></SelectedPattern></ManualSelectedPattern>zPUT z� HTTP/1.1
Host: localhost
User-Agent: hp
Accept: text/plain
Accept-Language: en-us,en
Accept-Charset:utf-8
Content-Type: text/xml
Content-Length: z

)r6r��getEWSUrl_LEDMrr�r�r4)
rr=r>r1r?rvrwrxr(r��jr�r�s
             r�AlignType16Manualr��s���I�I�Q��1�a�QR�TU�WX�Z[�]^�`a�c�d����D��&�&�t�-A�B�D���
�$�
&���%���*�*�4�1E�F���$�
&��ef�hi�kl�no�qr�tu�wx�z{�}~�@A�C�D�J\�^a�bf�^g�h�ko�o�D��&�&�t�-?��F�Drc�@�|�syt||j|�Sr�r�r��rrrs   r�AlignType15r��s���>���3�� 2� 2�C�8�8rc�0�t||j|�Srr��rrs  r�AlignType15Phase1r��s���3�� 2� 2�C�8�8rc�@�|�syt||j|�Sr�r��getUrl_LEDMr�s   r�AlignType17r��s���>���3�����5�5rc�0�t||j|�Srr�r�s  r�AlignType17Phase1r��s���3�����5�5rc
���|�syt||j|�d\}}}}}}}	}
}}}
d}|dk7�r|dk(rd}|ddddd	�\}}|r�d
}n�|d
k(rd}|ddddd
�\}}|r�d}n�|dk(rd}|ddddd	�\}}|r�d}n�|dk(rd}|ddddd	�\}}|r�d}n�|dk(rd}|ddddd�\}}|r�d}n�|dk(rd}|ddddd�\}}	|rvd}ns|dk(rd}|ddddd�\}}
|r[d}nX|dk(rd}|ddddd�\}}|r@d}n=|dk(rd}|ddddd�\}}|r%d}n"|dk(rd}|d dddd�\}}
|r
d!}n|d!k(rd}|dk7r��t|||||||	|
|||
�|S)"N)rr!r!r"r"r!r!r!r!r!r!Fr#rr'r,r)r"r�rr+r(rZr&r.rEr0r1r-r[r*r/r\r!r^rGr��r��rF�J�
)r�r�r�)rrr:r<r=r>r1r?rvrwrxr(r�r�rs               r�AlignType16r��s"���>���C��+�+�X�6�*I�'�E�1�a��A�q�!�Q��1�a�	�B�
�2�+��A�:��E��S�#�t�Q��3�E�B�����
�a�Z��E��S�#�t�Q��3�E�B�����
�a�Z��E��S�#�s�A�r�2�E�B�����
�a�Z��E��S�#�s�A�r�2�E�B�����
�a�Z��E��S�#�s�A�r�2�E�B�����
�a�Z��E��S�#�s�A�r�2�E�B�����
�a�Z��E��S�#�s�A�r�2�E�B�����
�a�Z��E��S�#�s�A�r�2�E�B�����
�a�Z��E��S�#�s�A�r�2�E�B�����
�a�Z��E��S�#�s�A�r�2�E�B�����
�b�[��E�}�2�+�@�c�1�a��A�q�!�Q��1�a�8�
�Irc
�.�t||||||||||	|
�yr)r�)rr=r>r1r?rvrwrxr(r�r�s           r�AlignType16Phase1r�'s���c�1�a��A�q�!�Q��1�a�8rc�@�t|�}|�|�yd}|dk7r�|dk(rd}|�}|rkt|�d}n]|dk(r=||t�}tj	|�t||||j�d}n|dk(rd}|�}|rt|�|dk7r��yyr�)�alignType14SetPattern�alignType14Phase1r�r6r��alignType14Phase2r`�alignType14Phase3r�s        r�AlignType14r*s���#�C�(�G������
�E�
�2�+��A�:��E���B��!�#�&���
�a�Z��g�'@�A�F��I�I�f���c�6�7�C�N�N�C��E�
�a�Z��E���B��!�#�&�%�2�+rc��d}tj|j��|_tjd|jz�|jttfvrd}|jtk(rd}n*|jtk(rd}n|jtk(rytjd|z�|Sr�r�r�s  rr�r�Fr�rc���|jtj��|jtjtj��|j�yrr�r�s rr�r�[r�rc���d}|tk(rtj}|dd}nt|tk(rtj}|dd}nU|t
k(r"tjtjz}n*|tk(r!tjtjz}tjd||fz�|jtj||��|j�y)Nrr&r�r�r�s     rrrar�rc���|jtj��|jtjtj��|j�yrr�r�s rrrwr�rc��|jtjd�|jtjd�|jtjd�|jtj
d�|j
�|jtjjtjddd��y)Nrr�rzalign1_8xx.pcl.gz�
rr�OID_AGENT2_VERTICAL_ALIGNMENT�OID_AGENT2_HORIZONTAL_ALIGNMENT�OID_AGENT1_BIDIR_ADJUSTMENT�OID_AGENT2_BIDIR_ADJUSTMENTr�
printGzipFile�os�pathr��prop�home_dirr�s rr8r8}�������:�:�A�>�����<�<�a�@�����8�8�!�<�����8�8�!�<��N�N�����b�g�g�l�l�4�=�=�&�%�AT�U�Vrc��|jtj|dz
dz�|jtj|dz
dz�|jtj|dz
dz�|jtj
|dz
dz�|jtjd�|j�|jtjjtjddd��y)Nr!�r"r�rzalign2_8xx.pcl.gz)rrr	r
rr�OID_MARKING_AGENTS_INITIALIZEDrr
rrr�rr�rr=r>r1r?s     rr9r9�s�������:�:�Q��U�b�L�I�����<�<�q�1�u��l�K�����8�8�1�q�5�B�,�G�����8�8�1�q�5�B�,�G�����;�;�Q�?��N�N�����b�g�g�l�l�4�=�=�&�%�AT�U�Vrc��|jtjd�|jtjd�|jtjd�|jtj
d�|j
�|jtjjtjddd��y)Nrr�rzalign1_9xx.pcl.gzrr�s rrIrI�rrc�T�|jtj|dz
dz�|jtjd|z
dz�|jtjd|z
dz�|jtj
d|z
dz�|j
�y)Nr!r)rrr	r
rrrrs     rrJrJ�s�������:�:�Q��U�b�L�I�����<�<�q�1�u��l�K�����8�8�1�q�5�B�,�G�����8�8�1�q�5�A�+�F��N�N�rc��|j�|jtjj	t
jddd��y)Nr�rzalign3_9xx.pcl.gz�rr
rrr�rrr�s rrKrK�s2���N�N�����b�g�g�l�l�4�=�=�&�%�AT�U�Vrc���|jtjd�|j�|j	t
jjtjddd��y)Nr"r�rzalign2_9xx.pcl.gz)
rrrrr
rrr�rr)rrOs  rrLrL�sH������;�;�Q�?��N�N�����b�g�g�l�l�4�=�=�&�%�AT�U�Vrc��|jtjtj��|jt
tfvry|jtk(rd}n+|jtk(rd}n|jtk(rd}|jtjdddd��|j�|jtjjt j"dd��y)N�
cbbcal.ldl.gz�
cbccal.ldl.gz�cb2pcal.ldl.gzrr�r)r�r�buildLIDILPacket�#PACKET_TYPE_RESUME_NORMAL_OPERATIONr`rarbrcrerf�buildSetPrinterAlignmentPacketrr
rrr�rr�r�ldl_files  rrhrh�s����M�M�#�&�&�s�'N�'N�O�P�
�~�~�+�-A�B�B��	���2�	2�"��	���2�	2�"��	���7�	7�#���M�M�#�4�4�Q��1�a�@�A��N�N�����b�g�g�l�l�4�=�=�&�%��J�Krc���tjd|||||fz�|jttfvryd|z
dz}|jt
j|��|jtk(r0d|z
dz}|jt
j|ddd��n�|jtk(r0d|z
dz}|jt
jddd|��nZ|jtk(rGd|z
dz}	d|z
dz}
d|z
dz}d|z
dz}|jt
j||
|	|��|jt
j��|j�y)	NzA=%d, B=%d, C=%d, D=%d, E=%drG����r!r&rrF���)r6r�r`rarbr�r�buildZCAPacketrcr"rerf�buildSetPensAlignedPacketr)rr=r>r1r?rvrO�k_bidi�cmy_bidi�vert�horts           rrkrk�sG���I�I�,��1�a��A��>�?�
�~�~�+�-A�B�B��
�q�5�C�-�C��M�M�#�$�$�S�)�*�
�~�~�0�0��a�%�1����
�
�c�8�8���A�q�I�J�	���2�	2���E�Q�;���
�
�c�8�8��A�q�(�K�L�	���7�	7��A���{���A���|���a�%�1�����E�Q�;���
�
�c�8�8���t�X�V�W��M�M�#�/�/�1�2��N�N�rc��|jtk(r@|jtjjtjddd��yy)Nr�r�cb2pcal_done.ldl.gz)r`rfr
rrr�rrr�s rrnrn�s:��
�~�~�5�5����"�'�'�,�,�t�}�}�f�e�EZ�[�\�6rc��|jtjtj��|jt
tfvry|jtk(rd}nW|jtk(rd}nA|jtk(rd}n+|jtk(rd}n|jtk(rd}|jtjd��|jtjd��|jtjd��|jtjd��|jtj d��|jtj"d��|jtj$d��|jtj&d��|jtj(d��|j+�|j-t.j0j3t4j6dd��y)	Nrz
cbpcal.ldl.gzrrzcbcpcal.ldl.gzrr�r)r�rr r!r`rarbrcrdrerfrgr(�buildColorHortPacket�buildColorVertPacket�buildBlackVertPacket�buildBlackHortPacket�buildBlackBidiPacket�buildColorBidiPacket�buildPhotoHuePacket�buildColorHuePacketrr
rrr�rrr#s  rriri�s����M�M�#�&�&�s�'N�'N�O�P�
�~�~�+�-A�B�B��	���2�	2�"��	���2�	2�"��	���2�	2�"��	���7�	7�#��	���7�	7�#���M�M�#�$�$�Q�'�(��M�M�#�*�*�1�-�.��M�M�#�*�*�1�-�.��M�M�#�*�*�1�-�.��M�M�#�*�*�1�-�.��M�M�#�*�*�1�-�.��M�M�#�*�*�1�-�.��M�M�#�)�)�!�,�-��M�M�#�)�)�!�,�-��N�N�����b�g�g�l�l�4�=�=�&�%��J�Krc
���tjd|||||||fz�|jttfvryd|z
dz}|jt
j|��|jtk(r.d|z
dz}	|jt
j|	���n|jtk(r.d|z
dz}
|jt
j|
���n�|jtk(r.d|z
dz}|jt
j|���n�|jtk(r�d|z
dz}d|z
dz}
d|z
dz}	d|z
dz}|jt
jd��|jt
j d��|jt
j"|��|jt
j$|
��|jt
j|	��|jt
j|���n�|jt&k(�rld|z
dz}d|z
dz}
d|z
dz}d|z
dz}
t(j*||}t(j,||}|jt
j.|
��|jt
j0|��|jt
jd��|jt
j d��|jt
j|
��|jt
j|��|jt
j2|��|jt
j4|��|jt
j6��|j9�y)	N�(A=%d, B=%d, C=%d, D=%d, E=%d, F=%d, G=%drGr&r!r&rFr'r)r6r�r`rarbr�rr(rcr5rd�buildPhotoBidiPacketrer6rfr1r2r3r4rgr	�PHOTO_ALIGN_TABLE�COLOR_ALIGN_TABLE�buildPhotoHortPacket�buildPhotoVertPacketr7r8r)r)rr=r>r1r?rvrwrxrOr*�kcm_bidir+r,r-�	photo_adj�	color_adjs                rrlrls���I�I�8�A�q�!�Q��1�a�;P�P�Q�
�~�~�+�-A�B�B��
�q�5�C�-�C��M�M�#�$�$�S�)�*�
�~�~�0�0��a�%�1����
�
�c�.�.�v�6�7�	���2�	2���E�Q�;���
�
�c�.�.�x�8�9�	���2�	2���E�Q�;���
�
�c�.�.�x�8�9�	���7�	7��A���{���A���|���a�%�1�����E�Q�;���
�
�c�.�.�q�1�2��
�
�c�.�.�q�1�2��
�
�c�.�.�t�4�5��
�
�c�.�.�t�4�5��
�
�c�.�.�v�6�7��
�
�c�.�.�x�8�9�	���7�	7��A���{���A���|����E�Q�;����E�Q�;���.�.�q�1�!�4�	��.�.�q�1�!�4�	��
�
�c�.�.�t�4�5��
�
�c�.�.�t�4�5��
�
�c�.�.�q�1�2��
�
�c�.�.�q�1�2��
�
�c�.�.�x�8�9��
�
�c�.�.�x�8�9��
�
�c�-�-�i�8�9��
�
�c�-�-�i�8�9��M�M�#�/�/�1�2��N�N�rc�p�|j�|jtk(r@|jtj
j
tjddd��y|jtk(r@|jtj
j
tjddd��yy)Nr�rr/zcbccal_done.ldl.gz)
rr`rfr
rrr�rrrgr�s rroro@sw���N�N��
�~�~�5�5����"�'�'�,�,�t�}�}�f�e�EZ�[�\�	���7�	7����"�'�'�,�,�t�}�}�f�e�EY�Z�[�
8rc�j�|jtj��|j�yr)r�r�buildPrintInternalPagePacketrr�s rr}r}Is!���M�M�#�2�2�4�5��N�N�rc��|jtjd�|jtjd�|jtjd�|jtj
d�|jtjd�|jtjd�|jtjd�|jtjd�|jttfvry|jtk(rd}nW|jtk(rd}nA|jtk(rd}n+|jt k(rd}n|jt"k(rd}|j%�|j't(j*j-t.j0dd��y)	Nrz
crbcal.pcl.gzz
crpcal.pcl.gzz
crccal.pcl.gzzcrcbcal.pcl.gzzcrcpcal.pcl.gzr�r)rrrr	r
r�OID_AGENT3_VERTICAL_ALIGNMENT�OID_AGENT3_HORIZONTAL_ALIGNMENT�OID_AGENT3_BIDIR_ADJUSTMENT�OID_ZCAr`rarbrcrdrerfrgrr
rrr�rr)r�pcl_files  rrjrjMsO������8�8�!�<�����:�:�A�>�����<�<�a�@�����8�8�!�<�����:�:�A�>�����<�<�a�@�����8�8�!�<�������a�(�
�~�~�+�-A�B�B��	���2�	2�"��	���2�	2�"��	���2�	2�"��	���7�	7�#��	���7�	7�#���N�N�����b�g�g�l�l�4�=�=�&�%��J�Krc
��tjd|||||||fz�d|z
dz}|jtj|�|j
tk(r*d|z
dz}	|jtj|	��n6|j
tk(r*d|z
dz}
|jtj|
��n�|j
tk(r*d|z
dz}|jtj|��n�|j
tk(r�d|z
dz}d|z
dz}
d|z
dz}	d|z
dz}|jtj|	�|jtj|�|jtj|
�|jtj|��n|j
tk(r�d|z
dz}d|z
dz}
d|z
dz}d|z
dz}
t j"||}t j$||}|dz|z}|jtj&|�|jtj|�|jtj|
�|jtj(|
�|jtj*|�|j-�y)Nr:rGi�r!rFi����r�)r6r�rrrJr`rcrrdrIrerrfr
r	rgr	r<r=�OID_COLOR_CALIBRATION_SELECTIONrHrGr)rr=r>r1r?rvrwrxrOr*r@r+r,r-rArBrAs                 rrmrmqs`���I�I�8�A�q�!�Q��1�a�;P�P�Q�
�q�5�C�-�C�������c�*�
�~�~�0�0��a�%�1������S�<�<�f�E�	���2�	2���E�Q�;�����S�<�<�h�G�	���2�	2���E�Q�;�����S�<�<�h�G�	���7�	7��A���{���A���|���a�%�1�����E�Q�;�����S�<�<�f�E����S�<�<�h�G����S�@�@�$�G����S�>�>��E�	���7�	7��A���{���A���|����E�Q�;����E�Q�;���.�.�q�1�!�4�	��.�.�q�1�!�4�	�
�!�^�y�(�����S�@�@�!�D����S�<�<�h�G����S�<�<�h�G����S�@�@�$�G����S�>�>��E��N�N�rc��|j�|jtjj	t
jddd��y)Nr�rzcrcaldone.pcl.gzrr�s rrprp�s2���N�N�����b�g�g�l�l�4�=�=�&�%�AS�T�Urc�H�|j�d}tt|��D�cgc]
}||d��}}t|vrd\}}nd\}}|j	�|jtjjtjdd|��|Scc}w)Nr$�type)zalign6_450.pcl.gzr!)zalign4_450.pcl.gzr-r�r)r2r3r4�AGENT_TYPE_KCMrr
rrr�rr)rr@rArBrwr�s      rr�r��s����$�$�&�x�0�D�*/��D�	�*:�;�Q��a����;�I�;���"�,���8�,���8��N�N�����b�g�g�l�l�4�=�=�&�%��C�D��O��<s�Bc��ddddddddd	d
�	}dddddddd	dd
�	}dddddddd	d
d
�	}|dk(r�djtjdtjtjd||tjd||tjd||tjd||tjd||tjd||tjtjg�}	n�djtjdtjtjd||tjd||tjd||tjd||tjd||tjd||tjtjg�}	|j|	�|j
�y)Nzzzzzzzzz)	rr&r"r-r/r!rGr�rFzz$z$r-r��@PJL ENTER LANGUAGE=PCL3GUI
z*o5Wz*o5Wz*o5Wz*o5Wz*o5Wz*o5Wz*o5Wz*o5Wz*o5W
z*o5W	�r�rr��RESETr�r�r)
rr�r=r>r1r?�
align_values1�
align_values2�
align_values3�ss
          rr�r��s���'�(�(�(�(�(�(�(�(�	�M�(�(�(�(�(�(�(�(�(�	�M�(�(�(�(�(�(�(�(�(�	�M��1�}��G�G�S�W�W�-��i�i��g�g�~�}�Q�'7��g�g�~�}�Q�'7��g�g�~�}�Q�'7��g�g�~�}�Q�'7��g�g�~�}�Q�'7��g�g�~�}�Q�'7��i�i��g�g�
�

��
�G�G�S�W�W�-��i�i��g�g�~�}�Q�'7��g�g�~�}�Q�'7��g�g�~�}�Q�'7��g�g�~�}�Q�'7��g�g�~�}�Q�'7��g�g�~�}�Q�'7��i�i��g�g�
�

���M�M�!���N�N�rc��|�r?|jtjtj�|j	�yyr)rrr�r�r�rrs  r�AlignType12r\�s/���~��
�
�3�.�.��0V�0V�W�����rc��y)NT�r�s r�cleanVerifyPager_�s��rc��d}d}|
|�}
|dk7�r�|dk(r9d}|tk(r|�}|�s�d}�n�|tk(�r�|
dk(�r�|dd�}|�s�d}�n�|dk(r||�|tk(r	|
dk(rd}�nad}�n]|dk(rd}|�}|�rLd}�nH|dk(r'd	}|tk(rt|d|
��n)t|��n|d	k(rd}|
dk(r	|d
�}n|�}|r�d}n�|dk(r||�|tk(r|
dk(rd}n�d
}n�|d
k(rd}|�}|r�d}n�|dk(r%d}|tk(rt|d|
�n�t|�n�|dk(rd}|
dk(r	|d�}n|�}|rd}n||dk(r||�d}|tk(r|
dk(rd}n\d}nY|dk(rd}|�}|rId}nF|dk(r%d}|tk(rt|d|
�n(t|�n|dk(rd}|
dk(r	|d�n|�|dk7r���S)Nrr#rFz"Clean functinality conformation...zClean Conformationr"r&r-zClean Level 1 is Completed.r/rGr!r�zClean Level 2 is Completed.rFr�r*rzjLevel 3 cleaning complete. Check this page to see if the problem was fixed. replace the print cartridge(s))�CLEAN_TYPE_PCL_WITH_PRINTOUT�CLEAN_TYPE_LEDM�cleanTypeVerify�print_clean_test_page)r�
clean_type�level1�level2�level3r�dlg1�dlg2�dlg3�wait_ui�verify_pager<�level�print_verify_pagers               r�cleaningrpsI��
�E�
�E�#�C�(��
�2�+��A�:��E��9�9�!�^����E���.�3D��3M�!�"F�H\�]����E�
�a�Z��3�K��_�,�1B�e�1K�����
�a�Z��E���B����
�a�Z��E��_�,���A�'8�9�%�c�*�
�a�Z��E� �E�)��7�8���V�����
�a�Z��3�K��_�,�1B�e�1K�����
�a�Z��E���B����
�a�Z��E��_�,���A�&7�8�%�c�*�
�a�Z��E� �E�)��7�8���V�����
�a�Z��3�K��E��_�,�1B�e�1K�����
�b�[��E���B����
�b�[��E��_�,���A�&7�8�%�c�*�
�b�[��E� �E�)��B�C���E�2�+�H�Irc��|j�|jtjj	t
jddd�d��y)Nr��pszclean_page.pdf.gzF)�rawrr�s rrdrdns?���N�N�����b�g�g�l�l�4�=�=�&��/�1�6;��=rc��|jtjtj�|j	�yr)rr�	OID_CLEAN�CLEAN_CLEANrr�s r�
cleanType1rws�$�����������8��N�N�rc��|jtjtj�|j	�yr)rrru�CLEAN_PRIMErr�s r�
primeType1r{wrxrc��|jtjtj�|j	�yr)rrru�CLEAN_WIPE_AND_SPITrr�s r�wipeAndSpitType1r~{s&���������(?�(?�@��N�N�rc�
�|jtj��|jtjtjtj
tj��|j�yr)r�rr�r �PACKET_TYPE_COMMAND�COMMAND_HANDLE_PEN�COMMAND_HANDLE_PEN_CLEAN_LEVEL1rr�s r�
cleanType2r��X���M�M�#�&�&�(�)��M�M�#�&�&�s�'>�'>�'*�'=�'=�'*�'J�'J�L�M��N�N�rc�
�|jtj��|jtjtjtj
tj��|j�yr)r�rr�r r�r��COMMAND_HANDLE_PEN_CLEAN_LEVEL2rr�s r�
primeType2r��r�rc�
�|jtj��|jtjtjtj
tj��|j�yr)r�rr�r r�r��COMMAND_HANDLE_PEN_CLEAN_LEVEL3rr�s r�wipeAndSpitType2r��r�rc�p�	t|z}|S#ttf$rtj	d�YSwxYw)Nz
Unicode Error)�CleanXML�UnicodeEncodeError�UnicodeDecodeErrorr6r7)�name�xmls  r�setCleanTyper��s@��!��t��c��J���1�
2�!�	�i�i�� ��J�!�s�	
�$5�5c�Z�t�}|jjdt�}|tk(r
|j
}n/|tk(r
|j}ntjd|z�y|t|�}|r,|jdd�d}|rtj|�}|S)N�status-type�Not an LEDM status-type: %dr�s

r)r�mq�get�STATUS_TYPE_NONE�STATUS_TYPE_LEDMr��STATUS_TYPE_LEDM_FF_CC_0r�r6r7�LEDM_CLEAN_CAP_XMLr�r�ExtractXMLData)r�data_fp�status_typer�r�s     r�getCleanLedmCapacityr��s����j�G��&�&�*�*�]�,<�=�K��&�&�� � �t�	�0�	0��o�o�t��	�	�/�+�=�>���"�G�,�D���z�z�+�q�)�!�,����(�(��.�D��Krc�,�t|�}t|vryy)NTF)r��LEDM_CLEAN_VERIFY_PAGE_JOB)r�
IPCap_datas  r�isCleanTypeLedmWithPrintr��s��%�c�*�J�!�Z�/��rc�f�td�}|jt|�|j�y)N�cleaningPage�r��post�
status_xmlr�rr�s  r�
cleanTypeLedmr��s$��
�~�
&�C��H�H�Z����N�N�rc�f�td�}|jt|�|j�y)N�cleaningPageLevel1r�r�s  r�cleanTypeLedm1r���%��
�+�
,�C��H�H�Z����N�N�rc�f�td�}|jt|�|j�y)N�cleaningPageLevel2r�r�s  r�cleanTypeLedm2r��r�rc�(�d}d}|jjdt�}td�}|tk(r
|j
}n.|tk(r
|j}ntjd|z�td|z�|dk7r�tj�}|dtk(rd}|r1|jt|�nt!j"d�|d	z
}|d
kDr*tjd�t$j'd�|dk7r��yy)Nrr��cleaningVerificationPager�z Performing level %d cleaning....r#zstatus-coder�r�z$Timeout waiting for Clean to finish.)r�r�r�r�r�r�r�r�r6r7�printr�StatusType10Status�STATUS_PRINTER_IDLEr�r��time�sleep�sys�exit)	rrn�print_verification_pager<�timeoutr�r�r��status_blocks	         rrcrc�s���
�E��G��&�&�*�*�]�,<�=�K�
�1�
2�C��&�&�� � �t�	�0�	0��o�o�t�	�	�	�/�+�=�>�	�
,�u�
4�5�
�2�+��/�/��5�|�
�}�
%�)<�
<��U�'����*�c�*�
�Z�Z��]�
��\�W�
�B�,�
�Y�Y�=�
>�
�X�X�a�[��2�+rc��d\}}d}|dk7rt|dk(rt|�rd}n[d}nX|dk(rd}|�}|rHt|�d}n:|dk(rd}|�\}}|r'd}n$|dk(rt||�d}n|dk(rd}|�d}|dk7r�t|S)	N�r-rFr#rrr%r&r")�colorCalType1PenCheck�colorCalType1Phase1�colorCalType1Phase2�rr�colorcal_ui�photopenreq_ui�valuer<rs       r�
colorCalType1r��s����L�E�5�	�B�
�2�+��A�:�$�S�)�����
�a�Z��E���B��#�C�(���
�a�Z��E�#�
�I�B�����
�a�Z���U�+��E�
�c�\��B����E�9�2�+�<�Irc��|j�d}tt|��D�cgc]
}||d��}}t|vrytjd�ycc}w)Nr$rPTz=Cannot perform color calibration with no photo pen installed.F)r2r3r4rQr6r7�rr@rArBs    rr�r�s[���$�$�&�x�0�D�*/��D�	�*:�;�Q��a����;�I�;���"��	�	�	�Q�R���<��Ac��|j�|jtjj	t
jddd��y)Nr�rzcolorcal1_450.pcl.gzrr�s rr�r�s2���N�N�����b�g�g�l�l�4�=�=�&�%�AW�X�Yrc
�R�dddddddd�}d	jtjd
tjtjd||dtjd
||dtjtjg�}|j|�|j
�y)N)�<�)�Ì�|)�\�ì)r�r�)r�r�)r�r�)uœu
¬)rr&r"r-r/r!rGr�rSz*o5Wrz*o5WrrT)rr��	color_calrYs    rr�r�"s���-�.�.�.�.�.�.�
�I�	������1��)�)��'�'�-�y��/?��/B��'�'�-�y��/?��/B��)�)��'�'�
�	�A��M�M�!���N�N�rc��d\}}d}|dk7rt|dk(rt|�rd}n[d}nX|dk(rd}|�}|rHt|�d}n:|dk(rd}|�\}}|r'd}n$|dk(rt||�d}n|dk(r|�d	}d}|dk7r�t|S)
Nr�Tr#rrr%r&r"F)�colorCalType2PenCheck�colorCalType2Phase1�colorCalType2Phase2r�s       r�
colorCalType2r�;s����L�E�5�	
�B�
�2�+��A�:�$�S�)�����
�a�Z��E���B��#�C�(���
�a�Z��E�#�
�I�B�����
�a�Z���U�+��E�
�c�\����B��E�9�2�+�<�Irc��|j�d}tt|��D�cgc]
}||d��}}t|vrytjd�ycc}w)Nr$rPTz3Cannot perform color calibration with pens missing.F)r2r3r4r5r6r7r�s    rr�r�^s[���$�$�&�x�0�D�*/��D�	�*:�;�Q��a����;�I�;��i�'��	�	�	�G�H���<r�c��|jtjtj�|j	�yr�rrr��PRINT_INTERNAL_PAGE_COLOR_CALrr�s rr�r�is-������4�4��:�:�<��N�N�rc�6�tj}djdt||dzdz�t||dzdzdz�t||dzdzdz�t||dzdzdz�dg�}|j	|�|j�y)	Nr�z&b19WPML 	r-r%rr&r"z	%-12345X)r	�COLOR_CAL_TABLEr�r�r�r)rr�r1r�s    rr�r�ps���� � �A�
���J��q��q��z�#�~�&��A�e�A�g�a�i�L��,<�(=��q��q����|�C�'�(�#�a��a���	�l�3�.>�*?�!�#�	$�A�
�M�M�!���N�N�rc�<�d\}}d}|dk7r�|dk(rt|�rd}nvd}ns|dk(rd}|�}|rct|�d}nU|dk(rd}|dd	�\}}|r@d
}n=|d
k(rd}|dd	�\}}|r(d}n%|dk(rt|�d}n|dk(r|�d
}d}|dk7r��|S)Nr�Tr#rrr%r&r'r]r"r+r-F)�colorCalType3PenCheck�colorCalType3Phase1�colorCalType3Phase2)	rrr�r�r�r<r�valueA�valueBs	         r�
colorCalType3r�s����L�E�5�	
�B�
�2�+��A�:�$�S�)�����
�a�Z��E���B��#�C�(���
�a�Z��E�$�S�"�-�J�B�����
�a�Z��E�$�S�"�-�J�B�����
�a�Z���V�V�4��E�
�c�\����B��E�E�2�+�H�Irc���|j�d}tt|��D�cgc]
}||d��}}t|vst|vryt
j
d�ycc}w)Nr$rPTzMCannot perform color calibration with no photo (or photo blue) pen installed.F)r2r3r4rQ�AGENT_TYPE_BLUEr6r7r�s    rr�r��sc���$�$�&�x�0�D�*/��D�	�*:�;�Q��a����;�I�;���"���"��	�	�	�a�b���<s�A"c��|jtjtj�|j	�yrr�r�s rr�r��s+������4�4��:�:�<��N�N�rc���tj|dz
|dz
}tj|dz
|dz
}|dz|z}|jtj
|�|j
�y)Nrr�)r	r<r=rrrMr)rr'r+rArB�	adj_values      rr�r��sj���*�*�1�Q�3�/��!��4�I��*�*�1�Q�3�/��!��4�I��a��9�,�I�����<�<�i�H��N�N�rc���d}d}|dk7rk|dk(rd}|�}|rUt|�d}nG|dk(rd}|�\}}|r4d}n1|dk(rt|�d}n|dk(rd}|�}|r
t|�d}|dk7r�k|S)NrTr#r&r"r-)�colorCalType4Phase1�colorCalType4Phase2�colorCalType4Phase3)rrr�rlr<rr�s       r�
colorCalType4r��s���
�E�	
�B�
�2�+��A�:��E���B��#�C�(���
�a�Z��E�$��J�B�����
�a�Z���V�,��E�
�a�Z��E���B��#�C�(���3�2�+�6�Irc��|jtjtj�|j	�yr�rrr�r�rr�s rr�r��s*���J�J�s�*�*��/�/�1��L�L�Nrc��|dk\ry|dzS)Nr%rRr^)r�s r�colorCalType4AdjValuer��s����|����9�rc	�r�d|vr
d\}}}}}}n�|\}}	}
}tj||	}tj|
|}
t|�}t||
z�}tj||	}tj
|
|}
t|�}t||
z�}ttj||	�}td�}tjd||||||fz�|jtj|�|jtj|�|jtj|�|jtj|�|jtj|�|jtj |�|j#�y)Nr#)��r�r�r�r�r�rz#C=%d, M=%d, Y=%d, c=%d, m=%d, k=%d
)r	�TYPE_4_C_TABLE�TYPE_4_LC_TABLEr��TYPE_4_M_TABLE�TYPE_4_LM_TABLE�TYPE_4_Y_TABLEr6r�rr�OID_COLOR_CALIBRATION_ARRAY_1�OID_COLOR_CALIBRATION_ARRAY_2�OID_COLOR_CALIBRATION_ARRAY_3�OID_COLOR_CALIBRATION_ARRAY_4�OID_COLOR_CALIBRATION_ARRAY_5�OID_COLOR_CALIBRATION_ARRAY_6r)rr��Cadj�Madj�Yadj�cadj�madj�kadj�sel1�sel2�sel3�sel4�tmp1�tmp2s              rr�r��s���	�V�|�-I�*��d�D�$��d�!'���d�D�$��&�&�t�,�T�2���'�'��-�d�3��$�T�*��$�T�$�Y�/���&�&�t�,�T�2���'�'��-�d�3��$�T�*��$�T�$�Y�/��$�X�%<�%<�T�%B�4�%H�I��$�Q�'���I�I�4��d�D�$�PT�VZ�7[�[�\��J�J�s�0�0� �"��J�J�s�0�0� �"��J�J�s�0�0� �"��J�J�s�0�0� �"��J�J�s�0�0� �"��J�J�s�0�0� �"��L�L�Nrc��|jtjtj�|j	�yr)rrr��+PRINT_INTERNAL_PAGE_COLOR_PALETTE_CMYK_PAGErr�s rr�r�s+���J�J�s�*�*��H�H�J��L�L�Nrc�V�|�r"|jd�|j�yy)Nz]%-12345X@PJL ENTER LANGUAGE=PCL3GUI
E%Puifp.multi_button_push 20;
udw.quit;*rCE%-12345X�r�rr[s  r�
colorCalType5r#�)���~��
�
�N�	O�����rc��|�r?|jtjtj�|j	�yyrr�r[s  r�
colorCalType6r)s/���~��
�
�3�.�.��0Q�0Q�R�����rc��|�r?|jtjtj�|j	�yyr)rrr��/PRINT_INTERNAL_PAGE_AUTOMATIC_COLOR_CALIBRATIONrr[s  r�
colorCalType7r.s/���~��
�
�3�.�.��0c�0c�d�����rc�V�|�r"|jd�|j�yy)Nz\%-12345X@PJL ENTER LANGUAGE=PCL3GUI
E%Puifp.multi_button_push 3;
udw.quit;*rCE%-12345Xrr[s  r�linefeedCalType1r5s)���~��
�
�M�	N�����rc��|�r?|jtjtj�|j	�yyr)rrr��(PRINT_INTERNAL_PAGE_LINEFEED_CALIBRATIONrr[s  r�linefeedCalType2r:s/���~��
�
�3�.�.��0\�0\�]�����rc�V�|�r"|jd�|j�yy)Nz]%-12345X@PJL ENTER LANGUAGE=PCL3GUI
E%Puifp.multi_button_push 14;
udw.quit;*rCE%-12345Xrr[s  r�printQualityDiagType1rBrrc��|�r?|jtjtj�|j	�yyr)rrr��,PRINT_INTERNAL_PAGE_PRINT_QUALITY_DIAGNOSTICrr[s  r�printQualityDiagType2r!Gs/���~��
�
�3�.�.��0`�0`�a�����r)T)nrx�codesr�rr�prntrrr	r��sixextr
rr�r�r�r�rrrCrPr{r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr�r�rrr8r9rIrJrKrLrhrkrnrirlror}rjrmrpr�r�r\r_rprdrwr{r~r�r�r�r�r�r�r�r�r�rcr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrr!r^rr�<module>r%s5��2���#�#��+���-�
�4��T��
��6�t:�zz�z�4)�X'�2�$���W�t'�8�*��,�����9
�vG� 9�
9�6�
6�H�T9�'�8�*��,�W�W�W��W�
W�L�(�>]�
 L�F7�t\��!L�H0�dV�
�=�@��
FU�j�Z=�
��������(��
�
�
�J!�H	�Z�
�2!�F	���'�R
��
��D��(�V���
��
��
r

Zerion Mini Shell 1.0