Warning: session_start(): open(/var/lib/php/sessions/sess_t46hl1e3p01he3hsqtrpvpoj6g, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
!7
cmodule PieceDatabase {
S piece = "white king";
transient MultiMap multiMap;
transient SingleComponentPanel scp;
transient ImageSurface is;
transient JLabel lblCount;
transient ReliableSingleThread rst = dm_rst(module(), r update);
start-thread {
multiMap = pairsToCIMultiMap(chessOCR_squareImagesCollectorFromAGIBlue().allImages());
rst.trigger();
}
void update {
if (multiMap == null || is == null) ret;
scp.setComponent(centerAndSouthWithMargin(jScroll_center(is), lblCount));
L images = multiMap.get(replaceObject(piece, "empty square", "empty"));
is.setImage(mergeBufferedImagesHorizontally(images));
setText(lblCount, nImages(images));
}
visualize {
is = jImageSurface();
lblCount = jCenteredLabel();
ret withComputing(rst, northAndCenterWithMargins(
main.onChange(rst, withLabel("Show images for:", dm_comboBox piece(replace(ai_chessPieces(), "empty", "empty square")))),
scp = singleComponentPanel(jCenteredLabel("Loading..."))));
}
}