HEX
Server: Apache
System: Linux opal14.opalstack.com 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
User: curbgloabal_opal (1234)
PHP: 8.1.29
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //usr/share/inkscape/extensions/plotter.pyc
�
��Yc@s�dZddlZddlZddlZddlZddlZddlZddlZdejfd��YZ	e
dkr�e	�Zej�ndS(s�
Copyright (C) 2013 Sebastian Wüst, sebi@timewaster.de

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
i����NtPlotcBsGeZd�Zd�Zd�Zd�Zd�Zd�Zd�ZRS(cCs*tjj|�|jjddddddd�|jjddddddd	d
ddd
�|jjdddddddd
ddd�|jjdddddddd
ddd�|jjdddddddd
ddd�|jjdddddddd
ddd�|jjdddddddd
d dd!�|jjd"dddddd#d
d$dd%�|jjd&dddd'dd(d
d)dd*�|jjd+dddd'dd,d
d)dd-�|jjd.dddd/dd0d
d1dd2�|jjd3dddd/dd4d
d5dd6�|jjd7dddd/dd8d
d9dd:�|jjd;dddddd<d
d=dd>�|jjd?dddd@ddAd
dBddC�|jjdDdddd@ddEd
dBddF�|jjdGdddd@ddHd
dBddI�|jjdJdddd'ddKd
dLddM�|jjdNdddd'ddOd
dPddQ�|jjdRdddd@ddSd
dTddU�|jjdVdddd'ddWd
dXddY�|jjdZdddd@dd[d
dTdd\�|jjd]dddd@dd^d
dBdd_�dS(`Ns--tabtactiontstorettypetstringtdestttabs--serialPortt
serialPorttdefaulttCOM1thelpsSerial ports--serialBaudRatetserialBaudRatet9600sSerial Baud rates--serialByteSizetserialByteSizeteightsSerial byte sizes--serialStopBitstserialStopBitstonesSerial stop bitss--serialParitytserialParitytnones
Serial paritys--serialFlowControltserialFlowControlt0sFlow controls--commandLanguagetcommandLanguagethpglsCommand Languages
--resolutionXtfloattresolutionXg��@sResolution X (dpi)s
--resolutionYtresolutionYsResolution Y (dpi)s--pentinttpenis
Pen numbers--forcetforceis
Pen force (g)s--speedtspeedisPen speed (cm/s)s
--orientationtorientationt90sRotation (Clockwise)s	--mirrorXtinkbooltmirrorXtFALSEs
Mirror X axiss	--mirrorYtmirrorYs
Mirror Y axiss--centertcentersCenter zero points	--overcuttovercutg�?sOvercut (mm)s--toolOffsett
toolOffsetg�?s#Tool (Knife) offset correction (mm)s--precuttprecuttTRUEs
Use precuts--flattflatg333333�?sCurve flatnesss--autoAlignt	autoAligns
Auto aligns--debugtdebugsShow debug information(tinkextEffectt__init__tOptionParsert
add_option(tself((s)/usr/share/inkscape/extensions/plotter.pyR."s0".....................cCstj|�}y|j�\|_}Wngtk
r�}|jddkrdtjtd��dSt	j
�\}}}td||f|�nX|jj
dkr�|j�n|jj
dkr�|j�n|jj
dkr�|j�n|jjr|j|�n
|j�dS(	NitNO_PATHSsMNo paths where found. Please convert all objects you want to plot into paths.ittHPGLtDMPLtKNK(thpgl_encoderthpglEncodertgetHpglRt	ExceptiontargsR,terrormsgt_tsystexc_infot
ValueErrortoptionsRt
convertToHpglt
convertToDmpltconvertToKNKR+t
showDebugInfotsendHpglToSerial(R1t
myHpglEncodertdebugObjecttinstRtvaluet	traceback((s)/usr/share/inkscape/extensions/plotter.pyteffect<s$


cCspd}|jjdkr/|d|jj7}n|jjdkrX|d|jj7}n||jd|_dS(NtINis;FS%ds;VS%ds;SP0;PU0,0;IN; (RARRR(R1thpglInit((s)/usr/share/inkscape/extensions/plotter.pyRBdscCs�|jjdd�|_|jjdd�|_|jjdd�|_|jjdd�|_d	}|jjd
kr�|d|jj7}n|d7}||jd
d|_dS(Nt;t,tSPtPtPUtUtPDtDs;:HAL0isV%dtEC1is,P0,U0,0,Z (RtreplaceRAR(R1tdmplInit((s)/usr/share/inkscape/extensions/plotter.pyRCms

cCspd}|jjdkr/|d|jj7}n|jjdkrX|d|jj7}n||jd|_dS(NtZGis;FS%ds;VS%ds
;SP0;PU0,0;@ (RARRR(R1RN((s)/usr/share/inkscape/extensions/plotter.pyRD�scCsDyddl}Wngtk
ry}tjtd�dtd�dddtd�dtd�dtd	��dSX|j�}|jj|_|jj	|_
|jjd
kr�|j|_
n|jjdkr�|j|_
n|jjdkr|j|_
n|jjd
kr(|j|_
n|jjdkrI|j|_n|jjdkrj|j|_n|jjdkr�|j|_n|jjdkr�|j|_n|jjdkr�|j|_n|jjdkr�|j|_n|jjdkr|j|_n|jjdkr0|j|_nd|_|jjdkrWt|_ n|jjdks{|jjdkr�t|_!n|jjdkr�t|_"ny|j#�Wnct$k
r}d|j%kr�tjtd��dSt&j'�\}}}t(d||f|�nX|j)|j*�|j+d�|j,�dS(Ni����s5pySerial is not installed. Please follow these steps:s

sA1. Download and extract (unzip) this file to your local harddisk:s
sI   https://pypi.python.org/packages/source/p/pyserial/pyserial-2.7.tar.gzsK2. Copy the "serial" folder (Can be found inside the just extracted folder)sN   into the following Inkscape folder: C:\[Program files]\inkscape\python\Lib\s3. Close and restart Inkscape.tfivetsixtsevenRRtonePointFivettwoRteventoddtmarktspaceg�������?txonxofftrtsctstdsrdtrrtsctssould not open portsgCould not open port. Please check that your plotter is running, connected and the settings are correct.R3i(-tserialtImportErrorR,R<R=tSerialRARtportRtbaudrateR
tFIVEBITStbytesizetSIXBITSt	SEVENBITSt	EIGHTBITSRtSTOPBITS_ONEtstopbitstSTOPBITS_ONE_POINT_FIVEtSTOPBITS_TWORtPARITY_NONEtparitytPARITY_EVENt
PARITY_ODDtPARITY_MARKtPARITY_SPACEttimeoutRtTrueRdRetdsrdtrtopenR:tstrerrorR>R?R@twriteRtreadtclose(R1RgtetmySerialRIRRJRK((s)/usr/share/inkscape/extensions/plotter.pyRF�sfM	$
cCs�tjd�tjd|jj�tjd|jj�tjd|jjd�tjd|jjd�tjd|jj�tjd|jj�tjd	|jj	�tjd
t
|jj��tjdt
|jj��tjdt
|jj
��tjd
t
|jj��tjdt
|jj��tjd|jj�tjdt
|jj��tjdt
|jj��tjdt
|jj��tjdt
|jj��tjdt
|jj��tjdt
|jj��tjdt
|jj��tjdt
|jj��tjdt
|jj��tjd�|jj�jddtj�}|r�tjd|d�n|jj�jddtj�}|r�tjd|d�ntjd |j��tjd!t
|jd"�d#|j��tjd$t
|jd%�d#|j��|jd&d'kr�tjd(�tjd)�n|tjd*t
|j |j!|jd&���d#|j��tjd+t
|j |j!|jd,���d#|j��tjd-|jj	d.�tjd/t
|j |j!t
|jd0����d#|j��tjd1t
|j |j!t
|jd2����d#|j��tjd/t
|jd3�d4�tjd1t
|jd5�d4�tjd6t
|j"�d4�tjd7t
|j"�d4�tjd8t
|j�d4�tjd9t
|j�d4�tjd:t
|j�d4�tjd;t
|j#�d4�tjd-|jj	d<�tj|j$�dS(=Nsa---------------------------------
Debug information
---------------------------------

Settings:
s  Serial Port: s  Serial baud rate: s  Serial byte size: s Bitss  Serial stop bits: s  Serial parity: s  Serial Flow control: s  Command language: s  Resolution X (dpi): s  Resolution Y (dpi): s  Pen number: s  Pen force (g): s  Pen speed (cm/s): s  Rotation (Clockwise): s  Mirror X axis: s  Mirror Y axis: s  Center zero point: s  Overcut (mm): s  Tool offset (mm): s  Use precut: s  Curve flatness: s  Auto align: s  Show debug information: s
Document properties:
s//@inkscape:versiont
namespacess  Inkscape version: is//@sodipodi:docnames  Filename: s  Document unit: s	  Width: tdocWidtht s
  Height: t	docHeighttviewBoxWidtht-s  Viewbox Width: -s  Viewbox Height: -s  Viewbox Width: s  Viewbox Height: t
viewBoxHeights
s
 properties:
s  Drawing width: tdrawingWidthUUs  Drawing height: tdrawingHeightUUtdrawingWidths plotter stepst
drawingHeights  Offset X: s  Offset Y: s  Overcut: s  Tool offset: s  Flatness: s  Tool offset flatness: s data:
(%R,R<RARRR
RRRRtstrRRRRRRR!R#R$R%R&R'R)R*R+tdocumenttgetroottxpathtNSStgetDocumentUnittdebugValuestunittouutaddDocumentUnittoffsetXttoolOffsetFlatR(R1RHtversiontfileName((s)/usr/share/inkscape/extensions/plotter.pyRE�sf

!!,,
>>DD""(	t__name__t
__module__R.RLRBRCRDRFRE(((s)/usr/share/inkscape/extensions/plotter.pyR s		(						Et__main__(
t__doc__treRR>tgettextthpgl_decoderR7R,R-RR�R�taffect(((s)/usr/share/inkscape/extensions/plotter.pyt<module>s�