Re: Advice on how to add the Epson SL-D700

Robert Krawitz <[email protected]>
Newsgroups gmane.linux.printing.gimp-print.devel
Message-ID <[email protected]>
On 8/15/21 8:58 PM, Solomon Peachy wrote:
> On Mon, Aug 02, 2021 at 07:36:10PM -0400, Solomon Peachy wrote:
>>    LB 03 00  00 01 01           # sent before FP
> 
> It turns out this changes based on the media type.
> 
>  Glossy: 00 01 00
>  Luster: 00 01 01
>  Matte:  00 01 32
> 
> I currently have this specified in the model.xml's preInitRemoteSequence 
> but that obviously won't do. 
> 
> I've been trying to add it as a parameter from within a <paper> definition:
> 
>    <parameter type="raw" name="escp2_preinit_remote_sequence">LB\003\000\000\001\001</parameter>
> 
> But it seems pd->preinit_remote_sequence is set in setup_basic(), far 
> before the paper definition is parsed. I added a hack in 
> adjust_density_and_ink_type() to explicitly check for that parameter:
> 
>   if (pv && stp_check_raw_parameter(pv, "escp2_preinit_remote_sequence", STP_PARAMETER_ACTIVE))
>     pd->preinit_remote_sequence = escp2_preinit_remote_sequence(pv);
> 
> but that's a pretty ugly hack IMO. It perhaps makes more sense to add a 
> generic LB command send into escp2_set_remote_sequence() and create a 
> parameter to configure it.  But what should I call it?

Device Drivers Are Ugly (tm)

There are already a bunch of special cases for papers starting at line 289 of print-escp2-data.c.
On the one hand, I hate adding yet one more.  On the other, I don't really want to restructure the
XML data for every existing printer and paper, and it would be a lot of work to rework all of the
existing PaperThickness/FeedSequence/PlatenGap options (there are 566 as it stands), and converting
them to fixed remote mode strings would reduce flexibility for people who want to tune them for
funky media of their own.

As ugly as it is, I'd say either come up with a new integer parameter for this or add an escape
hatch remote sequence per-paper that you can set for the papers for this printer.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.