www/js/webcam-ng.js

Tue, 30 Apr 2024 17:26:41 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Tue, 30 Apr 2024 17:26:41 +0200
changeset 714
24749c296a50
parent 710
abe60578d695
permissions
-rw-r--r--

Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.

/*****************************************************************************
 * Copyright (C) 2019
 *   
 * Michiel Broek <mbroek at mbse dot eu>
 *
 * This file is part of ThermFerm
 *
 * This 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, or (at your option) any
 * later version.
 *
 * ThermFerm 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 ThermFerm; see the file COPYING.  If not, write to the Free
 * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
 *****************************************************************************/

var phi = 0, flipped = 0, mirrored = 0;

function setXformClass () {
	$('.xform').each(function(idx,el) {
		el.className = "xform x" +(flipped ? "-flipped":"") + (mirrored ? "-mirrored" : "") + "-rotated-" + phi;
	});
}



$(document).ready(function () {

	// set rotation angle phi and toggle rotate class
	$("#rotate").jqxButton({ template: "info", width: 50, height: 50, theme: theme, imgWidth: 32, imgHeight: 32, imgSrc:"images/object-rotate-right.png" });
	$('#rotate').click(function() {
		phi = (phi + 90) % 360;
		setXformClass();
		if (phi % 180) {
			$('.xform-p').addClass('rotated');
		} else {
			$('.xform-p').removeClass('rotated');
		}
	});
	// toggle mirror class component
	$("#mirror").jqxButton({ template: "info", width: 50, height: 50, theme: theme, imgWidth: 32, imgHeight: 32, imgSrc:"images/object-flip-horizontal.png" });
	$('#mirror').click(function() {
		mirrored = ! mirrored;
		setXformClass();
	});
	// toggle flip class componen
	$("#flip").jqxButton({ template: "info", width: 50, height: 50, theme: theme, imgWidth: 32, imgHeight: 32, imgSrc:"images/object-flip-vertical.png" });
	$('#flip').click(function() {
		flipped = ! flipped;
		setXformClass();
	});

	$("#Close").jqxButton({ template: "success", width: 125, theme: theme });
	$("#Close").click(function () {
		window.close();
	});

});

mercurial