Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional commands #5

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Additional commands #5

wants to merge 2 commits into from

Conversation

RamyTalal
Copy link
Owner

Adding additional commands for the printer.

@RamyTalal RamyTalal changed the title Work in progress Additional commands Mar 7, 2018
@vincentckk
Copy link

namespace Talal\LabelPrinter\Command;

class CharColor implements CommandInterface
{
const BLACK = 1;
const RED = 2;

/**
 * @var int
 */
protected $color;

/**
 * @param int $style
 */
public function __construct($color = self::BLACK)
{
    $this->color = $color;
}

/**
 * @inheritdoc
 */
public function read()
{
    return chr(27) . 'iW' . chr($this->color);
}

}

{
$this->addOption(new Format($this->format), 0);
$this->addOption(new Character(Character::OFF), 1);
$this->addOption(new Height(48), 2);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$this->addOption(new Height(48), 2);
$this->addOption(new Height(48), 3);

$this->addOption(new Format($this->format), 0);
$this->addOption(new Character(Character::OFF), 1);
$this->addOption(new Height(48), 2);
$this->addOption(new Width(Width::SMALL), 3);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$this->addOption(new Width(Width::SMALL), 3);
$this->addOption(new Width(Width::SMALL), 4);

$this->addOption(new Character(Character::OFF), 1);
$this->addOption(new Height(48), 2);
$this->addOption(new Width(Width::SMALL), 3);
$this->addOption(new Parenthesis(Parenthesis::ON), 4);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$this->addOption(new Parenthesis(Parenthesis::ON), 4);
$this->addOption(new Parenthesis(Parenthesis::ON), 2);

Copy link

@kcasarez kcasarez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed some extra characters that I don't know why they were added.


public function read()
{
return 't' . $this->value . 'sp';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return 't' . $this->value . 'sp';
return 't' . $this->value;


public function read()
{
return 'r' . $this->value . 'uxy';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return 'r' . $this->value . 'uxy';
return 'r' . $this->value;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants