@Override
	public void nextStep() {
		Resource res;
		switch (this.step) {
		case (0):
			// Blokuotas, laukiam "Eilutė atmintyje" resurso
			res = Core.resourceList.searchResource(ResourceType.LI_IN_MEM);
			if (res != null) {
				PrintDescriptor descriptor = (PrintDescriptor) res.getDescriptor();
				res.setParent(this);
				this.startAddress = descriptor.getStartAddress();
				this.endAddress = descriptor.getEndAddress();
				this.changeStep(1);
			}
			else {
				this.changeStep(0);
			}
			break;
		case (1):
			// Blokuotas, laukiam "Kanalų įrenginio" resurso
			res = Core.resourceList.searchResource(ResourceType.CH_DEV);
			if (res != null) {
				if (res.getParent() == null || res.getParent() == this) {
					res.setParent(this);
					this.changeStep(this.step + 1);
				}
				else {
					this.changeStep(2);
				}
			}
			else {
				this.changeStep(2);
			}
			break;
		case (2):
			// Nustatinėjami įrenginio registra ir įvygdoma komanda XCHG
			ChannelsDevice.ST = 2;
			ChannelsDevice.DT = 4;
			ChannelsDevice.startAddress = this.startAddress;
			ChannelsDevice.endAddress = this.endAddress;
			if (ChannelsDevice.XCHG()) {
				this.changeStep(3);
			} else {
				this.changeStep(2);
			}
			break;
		case (3):
			// Atlaisvinamas "Kanalų įrenginys" resursas
			res = Core.resourceList.searchResource(ResourceType.CH_DEV);
			res.removeParent();
			Core.resourceList.deleteChildResource(this, ResourceType.LI_IN_MEM);
			this.changeStep(0);
			break;
		}
	}