private PageDiffractionInstrument createDiffractionInstrument() {
			PageDiffractionInstrument i = new PageDiffractionInstrument();
			i.setPage(page);
			i.setModelID(modelIndex);
			if (uid != null) {
				i.setUid(uid);
				uid = null;
			}
			if (type != -1) {
				i.setType(type);
				type = -1;
			}
			if (loadScan) {
				i.setLoadScan(true);
				loadScan = false;
			}
			if (scriptScan) {
				i.setScriptScan(true);
				scriptScan = false;
			}
			if (levelOfDetails != 0) {
				i.setLevelOfDetails(levelOfDetails);
				levelOfDetails = 0;
			}
			if (scale != 8) {
				i.setScale((int) scale);
				scale = 8;
			}
			else {
				i.setScale(8);
			}
			if (borderType != null) {
				i.setBorderType(borderType);
				borderType = null;
			}
			i.setChangable(page.isEditable());
			mw2dConnector.linkModelListener(modelIndex, i);
			return i;
		}