Added new rove features, swirling, render.

This commit is contained in:
Sandy Noble 2013-04-28 10:47:01 +01:00
parent aa92a55359
commit 6f87e2fabf
5 changed files with 43 additions and 12 deletions

View File

@ -382,8 +382,8 @@ class DisplayMachine extends Machine
float aspectRatio = (rotateWebcamImage) ? 480.0/640.0 : 640.0/480.0; // rotated, remember float aspectRatio = (rotateWebcamImage) ? 480.0/640.0 : 640.0/480.0; // rotated, remember
float h = height - getPanel(PANEL_NAME_GENERAL).getOutline().getTop() -10; float h = height - getPanel(PANEL_NAME_GENERAL).getOutline().getTop() -10;
float w = h * (480.0/640.0); float w = h * (480.0/640.0);
println("height: " + h + ", width: " + w); // println("height: " + h + ", width: " + w);
println("origin x: " + ox + ", y: " + oy); // println("origin x: " + ox + ", y: " + oy);
if (rotateWebcamImage) if (rotateWebcamImage)
{ {

View File

@ -650,6 +650,20 @@ void button_mode_sendRoveArea()
} }
} }
void button_mode_selectRoveImageSource()
{
addToCommandQueue(CMD_SELECT_ROVE_SOURCE_IMAGE+",w1.pbm,END");
}
void button_mode_startMarking()
{
// C47,<start (1) or stop (0)>,<mark style>,END
addToCommandQueue(CMD_RENDER_ROVE+",1,1,END");
}
void button_mode_stopMarking()
{
addToCommandQueue(CMD_RENDER_ROVE+",0,0,END");
}
void toggle_mode_sendStartText(boolean flag) void toggle_mode_sendStartText(boolean flag)
{ {
if (flag) if (flag)

View File

@ -710,13 +710,17 @@ List<String> getControlNamesForRovingPanel()
controlNames.add(MODE_SEND_START_TEXT); controlNames.add(MODE_SEND_START_TEXT);
controlNames.add(MODE_CHANGE_GRID_SIZE); controlNames.add(MODE_CHANGE_GRID_SIZE);
controlNames.add(MODE_SHOW_WRITING_DIALOG); controlNames.add(MODE_SHOW_WRITING_DIALOG);
// controlNames.add(MODE_START_SWIRLING); controlNames.add(MODE_START_SWIRLING);
// controlNames.add(MODE_STOP_SWIRLING); controlNames.add(MODE_STOP_SWIRLING);
// controlNames.add(MODE_START_SPRITE); controlNames.add(MODE_START_MARKING);
// controlNames.add(MODE_START_RANDOM_SPRITES); controlNames.add(MODE_STOP_MARKING);
// controlNames.add(MODE_STOP_RANDOM_SPRITES); controlNames.add(MODE_SELECT_ROVE_IMAGE_SOURCE);
controlNames.add(MODE_START_SPRITE);
controlNames.add(MODE_START_RANDOM_SPRITES);
controlNames.add(MODE_STOP_RANDOM_SPRITES);
controlNames.add(MODE_DRAW_NORWEGIAN_DIALOG); controlNames.add(MODE_DRAW_NORWEGIAN_DIALOG);
return controlNames; return controlNames;
} }
@ -924,11 +928,14 @@ Map<String, String> buildControlLabels()
result.put(MODE_SEND_PEN_LIFT_RANGE_PERSIST, "Upload lift range"); result.put(MODE_SEND_PEN_LIFT_RANGE_PERSIST, "Upload lift range");
result.put(MODE_SEND_ROVE_AREA, "Send Roving Area"); result.put(MODE_SEND_ROVE_AREA, "Send Roving Area");
result.put(MODE_SELECT_ROVE_IMAGE_SOURCE, "Choose source image");
result.put(MODE_SEND_START_TEXT, "Start text at point"); result.put(MODE_SEND_START_TEXT, "Start text at point");
result.put(MODE_SHOW_WRITING_DIALOG, "Render writing..."); result.put(MODE_SHOW_WRITING_DIALOG, "Render writing...");
result.put(MODE_START_SWIRLING, "Swirl"); result.put(MODE_START_SWIRLING, "Swirl");
result.put(MODE_STOP_SWIRLING, "Stop swirl"); result.put(MODE_STOP_SWIRLING, "Stop swirl");
result.put(MODE_START_MARKING, "Mark");
result.put(MODE_STOP_MARKING, "Stop marking");
result.put(MODE_START_SPRITE, "Choose sprite..."); result.put(MODE_START_SPRITE, "Choose sprite...");
result.put(MODE_START_RANDOM_SPRITES, "Random sprites"); result.put(MODE_START_RANDOM_SPRITES, "Random sprites");
result.put(MODE_STOP_RANDOM_SPRITES, "Stop sprites"); result.put(MODE_STOP_RANDOM_SPRITES, "Stop sprites");
@ -1063,10 +1070,13 @@ Set<String> buildControlNames()
result.add(MODE_SEND_PEN_LIFT_RANGE_PERSIST); result.add(MODE_SEND_PEN_LIFT_RANGE_PERSIST);
result.add(MODE_SEND_ROVE_AREA); result.add(MODE_SEND_ROVE_AREA);
result.add(MODE_SELECT_ROVE_IMAGE_SOURCE);
result.add(MODE_SEND_START_TEXT); result.add(MODE_SEND_START_TEXT);
result.add(MODE_SHOW_WRITING_DIALOG); result.add(MODE_SHOW_WRITING_DIALOG);
result.add(MODE_START_SWIRLING); result.add(MODE_START_SWIRLING);
result.add(MODE_STOP_SWIRLING); result.add(MODE_STOP_SWIRLING);
result.add(MODE_START_MARKING);
result.add(MODE_STOP_MARKING);
result.add(MODE_START_SPRITE); result.add(MODE_START_SPRITE);
result.add(MODE_START_RANDOM_SPRITES); result.add(MODE_START_RANDOM_SPRITES);
result.add(MODE_STOP_RANDOM_SPRITES); result.add(MODE_STOP_RANDOM_SPRITES);

View File

@ -70,6 +70,8 @@ static final String CMD_DRAW_RANDOM_SPRITE = "C42,";
static final String CMD_DRAW_NORWEGIAN = "C43,"; static final String CMD_DRAW_NORWEGIAN = "C43,";
static final String CMD_DRAW_NORWEGIAN_OUTLINE = "C44,"; static final String CMD_DRAW_NORWEGIAN_OUTLINE = "C44,";
static final String CMD_SETPENLIFTRANGE = "C45,"; static final String CMD_SETPENLIFTRANGE = "C45,";
static final String CMD_SELECT_ROVE_SOURCE_IMAGE = "C46";
static final String CMD_RENDER_ROVE = "C47";
static final int PATH_SORT_NONE = 0; static final int PATH_SORT_NONE = 0;
static final int PATH_SORT_MOST_POINTS_FIRST = 1; static final int PATH_SORT_MOST_POINTS_FIRST = 1;
@ -632,20 +634,22 @@ void sendOutlineOfBox()
tr = getDisplayMachine().asNativeCoords(tr); tr = getDisplayMachine().asNativeCoords(tr);
bl = getDisplayMachine().asNativeCoords(bl); bl = getDisplayMachine().asNativeCoords(bl);
br = getDisplayMachine().asNativeCoords(br); br = getDisplayMachine().asNativeCoords(br);
String cmd = (true) ? CMD_CHANGELENGTHDIRECT : CMD_CHANGELENGTH;
String command = CMD_CHANGELENGTHDIRECT+(int)tl.x+","+(int)tl.y+","+getMaxSegmentLength()+",END"; String command = cmd+(int)tl.x+","+(int)tl.y+","+getMaxSegmentLength()+",END";
addToCommandQueue(command); addToCommandQueue(command);
command = CMD_CHANGELENGTHDIRECT+(int)tr.x+","+(int)tr.y+","+getMaxSegmentLength()+",END"; command = cmd+(int)tr.x+","+(int)tr.y+","+getMaxSegmentLength()+",END";
addToCommandQueue(command); addToCommandQueue(command);
command = CMD_CHANGELENGTHDIRECT+(int)br.x+","+(int)br.y+","+getMaxSegmentLength()+",END"; command = cmd+(int)br.x+","+(int)br.y+","+getMaxSegmentLength()+",END";
addToCommandQueue(command); addToCommandQueue(command);
command = CMD_CHANGELENGTHDIRECT+(int)bl.x+","+(int)bl.y+","+getMaxSegmentLength()+",END"; command = cmd+(int)bl.x+","+(int)bl.y+","+getMaxSegmentLength()+",END";
addToCommandQueue(command); addToCommandQueue(command);
command = CMD_CHANGELENGTHDIRECT+(int)tl.x+","+(int)tl.y+","+getMaxSegmentLength()+",END"; command = cmd+(int)tl.x+","+(int)tl.y+","+getMaxSegmentLength()+",END";
addToCommandQueue(command); addToCommandQueue(command);
} }

View File

@ -294,6 +294,7 @@ static final String MODE_SEND_PEN_LIFT_RANGE = "button_mode_sendPenliftRange";
static final String MODE_SEND_PEN_LIFT_RANGE_PERSIST = "button_mode_sendPenliftRangePersist"; static final String MODE_SEND_PEN_LIFT_RANGE_PERSIST = "button_mode_sendPenliftRangePersist";
static final String MODE_SEND_ROVE_AREA = "button_mode_sendRoveArea"; static final String MODE_SEND_ROVE_AREA = "button_mode_sendRoveArea";
static final String MODE_SELECT_ROVE_IMAGE_SOURCE = "button_mode_selectRoveImageSource";
static final String MODE_SEND_START_TEXT = "toggle_mode_sendStartText"; static final String MODE_SEND_START_TEXT = "toggle_mode_sendStartText";
// controls to do with text start // controls to do with text start
static final String MODE_CHANGE_TEXT_ROW_SIZE = "numberbox_mode_changeTextRowSize"; static final String MODE_CHANGE_TEXT_ROW_SIZE = "numberbox_mode_changeTextRowSize";
@ -302,6 +303,8 @@ static final String MODE_CHANGE_TEXT_ROW_SPACING = "numberbox_mode_changeTextRow
static final String MODE_SHOW_WRITING_DIALOG = "button_mode_drawWritingDialog"; static final String MODE_SHOW_WRITING_DIALOG = "button_mode_drawWritingDialog";
static final String MODE_START_SWIRLING = "button_mode_startSwirling"; static final String MODE_START_SWIRLING = "button_mode_startSwirling";
static final String MODE_STOP_SWIRLING = "button_mode_stopSwirling"; static final String MODE_STOP_SWIRLING = "button_mode_stopSwirling";
static final String MODE_START_MARKING = "button_mode_startMarking";
static final String MODE_STOP_MARKING = "button_mode_stopMarking";
static final String MODE_START_SPRITE = "button_mode_drawSpriteDialog"; static final String MODE_START_SPRITE = "button_mode_drawSpriteDialog";
static final String MODE_START_RANDOM_SPRITES = "button_mode_startRandomSprite"; static final String MODE_START_RANDOM_SPRITES = "button_mode_startRandomSprite";
static final String MODE_STOP_RANDOM_SPRITES = "button_mode_stopRandomSprites"; static final String MODE_STOP_RANDOM_SPRITES = "button_mode_stopRandomSprites";