<root>
<document scada='1' projtype='2' schema='103' license='1,88169790,XQ5X1V' title='Tilt Plotter' description='Using the mobile device tilt sensor to plot onto a canvas' fcversion='720897' target='SCADA.SCADA.WEBEXP' >
	<config data='' clkspd='100000000' simspd='1' usewdt='0' constif='0' Use3V3='0' />
	<plugins >
		<dll_models enabled='1' />
	</plugins>
	<supplement use='0' head='' body='' />
	<debug />
	<traces />
	<ghost >
		<FK2 >
			<data name='FK2D0' port='4294967295' pin='4294967295' />
			<data name='FK2D1' port='4294967295' pin='4294967295' />
			<data name='FK2D2' port='4294967295' pin='4294967295' />
			<data name='FK2D3' port='4294967295' pin='4294967295' />
			<data name='FK2D4' port='4294967295' pin='4294967295' />
			<data name='FK2D5' port='4294967295' pin='4294967295' />
			<data name='FK2D6' port='4294967295' pin='4294967295' />
			<data name='FK2D7' port='4294967295' pin='4294967295' />
			<data name='FK2D8' port='4294967295' pin='4294967295' />
			<data name='FK2D9' port='4294967295' pin='4294967295' />
			<data name='FK2D10' port='4294967295' pin='4294967295' />
			<data name='FK2D11' port='4294967295' pin='4294967295' />
			<data name='FK2D12' port='4294967295' pin='4294967295' />
			<data name='FK2D13' port='4294967295' pin='4294967295' />
			<data name='FK2D14' port='4294967295' pin='4294967295' />
			<data name='FK2D15' port='4294967295' pin='4294967295' />
			<data name='FK2A0' port='4294967295' pin='4294967295' />
			<data name='FK2A1' port='4294967295' pin='4294967295' />
			<data name='FK2A2' port='4294967295' pin='4294967295' />
			<data name='FK2A3' port='4294967295' pin='4294967295' />
			<data name='FK2A4' port='4294967295' pin='4294967295' />
			<data name='FK2A5' port='4294967295' pin='4294967295' />
		</FK2>
		<ICD >
			<data name='AnalogPrescaleValue' value='19' />
			<data name='DigitalSampleRate' value='100000' />
			<data name='BreakpointCount' value='8' />
			<data name='CallStackDepthCount' value='8' />
			<data name='ClockPort' value='4095' />
			<data name='ClockPin' value='0' />
			<data name='DataPort' value='4095' />
			<data name='DataPin' value='0' />
			<data name='UseDefaultPins' value='1' />
			<data name='WrapEnabled' value='1' />
			<data name='CommsDelayOverridden' value='0' />
			<data name='CommsDelay' value='2' />
			<data name='CalculatedCommsDelay' value='2' />
			<data name='AnalogEB2PrescaleValue' value='2' />
			<data name='DigitalEB2SampleRate' value='100000' />
		</ICD>
		<pins >
			<digital A='0' B='0' C='0' D='0' E='0' F='0' G='0' H='0' I='0' J='0' K='0' L='0' M='0' N='0' O='0' P='0' Q='0' R='0' S='0' T='0' U='0' V='0' W='0' X='0' Y='0' Z='0' />
			<analog A='0' B='0' C='0' D='0' E='0' F='0' G='0' H='0' I='0' J='0' K='0' L='0' M='0' N='0' O='0' P='0' Q='0' R='0' S='0' T='0' U='0' V='0' W='0' X='0' Y='0' Z='0' />
		</pins>
	</ghost>
	<components >
		<settings autoimg='1' center='1' unitscale='0' fixedscale='0' fixedx='1' fixedy='1' fixedz='1' headcode='0' />
		<definition guid='09242158-0772-48c9-bce7-a95ed7887815' vstate='40' vmin='0' vmaj='1' srcleaf='' visiblename='' description='' category='' category2='' category3='' bIs2dOnly='0' bIs3dOnly='0' bIsWysiwyg='0' catenable='1' author='' manuname='' manucode='' sysinfo='0' keywords='' dynamic='1' scadaCompatible='1' embeddedCompatible='1' showmacros='1' iconpath='' />
		<component class_type='root' codename='panel' panelId='-1' x='0' y='0' z='0' xsz='1' ysz='1' zsz='1' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' scadavisible='1' interactive='1' solid='1' layer='0' poslock='0' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' comp2dType='0' >
			<resources />
			<properties />
			<values />
			<events />
			<apis />
			<variables >
				<variable public='0' >
					<def class_type='variable' name='false' type='b1' description='' isconst='1' isHidden='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='true' type='b1' description='' isconst='1' isHidden='0' isinit='1' usrinit='1' setinit='1' />
				</variable>
			</variables>
			<macros >
				<macro >
					<flowline name='OrientationCallback' description='Called regularly to provide device orientation' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='Alpha' type='f32' description='The rotation around the z-axis, i.e. twisted anticlockwise around the centre of the screen (in degrees between 0 and 360)' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' />
						<param name='Beta' type='f32' description='The rotation around the x-axis, i.e. tilted forwards/backwards (in degrees between -180 and 180)' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' />
						<param name='Gamma' type='f32' description='The rotation around the y-axis, i.e. tilted left/right (in degrees between -90 and 90)' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' />
						<param name='Absolute' type='b1' description='True if the device is providing data in reference to Earth&apos;s coordinate frame' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='x' type='s32' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
						<local name='y' type='s32' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
						<local name='col' type='s32' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
						<local name='penDown' type='s32' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
						<local name='sInfo' type='T8' description='' isconst='0' isHidden='0' isinit='1' usrinit='&quot;&quot;' setinit='&quot;&quot;' >
							<array size='2000' />
						</local>
						<local name='size' type='s32' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
						<command class_type='call' title='Get the state of the pen switch' component='Switch1' macro='GetState' >
							<return exp='.penDown' />
						</command>
						<command class_type='calculation' title='Calculate the coordinates depending on the tilt sensor' >
							<exp exp='.x = (.Gamma + 90) * 400 / 180' />
							<exp exp='.y = ((2 * .Beta) + 180) * 400 / 360' />
						</command>
						<command class_type='calculation' title='Create the info box text' >
							<exp exp='.sInfo = &quot;x = &quot; + ToString$(.x) + &quot;&lt;br /&gt;\n&quot;' />
							<exp exp='.sInfo = .sInfo + &quot;y = &quot; + ToString$(.y) + &quot;&lt;br /&gt;\n&quot;' />
						</command>
						<command class_type='decision' title='Is the pen down?' exp='.penDown' swap='0' >
							<flowline >
								<command class_type='calculation' title='Add to the info text string' >
									<exp exp='.sInfo = .sInfo + &quot;pen = down&lt;br /&gt;\n&quot;' />
								</command>
								<command class_type='call' title='Get the current colour' component='ChooseColour1' macro='GetColour' >
									<return exp='.col' />
								</command>
								<command class_type='call' title='Plot the point onto the canvas' component='WebCanvas1' macro='PlotPoint' >
									<argument exp='.x' />
									<argument exp='.y' />
									<argument exp='.col' />
								</command>
								<command class_type='call' title='Plot the point onto the canvas' component='WebCanvas1' macro='PlotPoint' >
									<argument exp='.x + 1' />
									<argument exp='.y' />
									<argument exp='.col' />
								</command>
								<command class_type='call' title='Plot the point onto the canvas' component='WebCanvas1' macro='PlotPoint' >
									<argument exp='.x - 1' />
									<argument exp='.y' />
									<argument exp='.col' />
								</command>
								<command class_type='call' title='Plot the point onto the canvas' component='WebCanvas1' macro='PlotPoint' >
									<argument exp='.x' />
									<argument exp='.y + 1' />
									<argument exp='.col' />
								</command>
								<command class_type='call' title='Plot the point onto the canvas' component='WebCanvas1' macro='PlotPoint' >
									<argument exp='.x' />
									<argument exp='.y - 1' />
									<argument exp='.col' />
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Add to the info text string' >
									<exp exp='.sInfo = .sInfo + &quot;pen = up&lt;br /&gt;\n&quot;' />
								</command>
							</flowline>
						</command>
						<command class_type='call' title='Set the info textbox' component='txtInfo' macro='SetText' >
							<argument exp='.sInfo' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='OnbtnClearClick' description='Called when the btnClear button is clicked' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<command class_type='call' title='Clear the canvas' component='WebCanvas1' macro='Clear' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Main' description='' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<command class_type='call' title='Set the text on the info box' component='txtInfo' macro='SetText' >
							<argument exp='&quot;x = 0&lt;br /&gt;\ny = 0&lt;br /&gt;\npen = up&lt;br /&gt;\n&quot;' />
						</command>
						<command class_type='call' title='Begin tracking the device orientation' component='Orientation1' macro='Initialise' />
					</flowline>
				</macro>
			</macros>
			<component class_type='ref' guid='4fc7c04c-c105-4a2b-ba78-27f11d8b2320' vmin='1' vmaj='0' codename='WebCanvas1' panelId='0' x='210' y='-210' z='0' xsz='83.3333' ysz='83.3333' zsz='25' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' scadavisible='1' interactive='1' solid='1' layer='2' poslock='0' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='Canvas::colFill' data='16777215' />
					<value target='bBorder' data='0' />
					<value target='sCustomAttributes' data='' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='32333e38-5975-4078-a873-efdf2975a04e' vmin='0' vmaj='1' codename='Orientation1' panelId='0' x='480' y='-480' z='1' xsz='25' ysz='25' zsz='25' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' scadavisible='1' interactive='1' solid='1' layer='2' poslock='0' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='bUseCallback' data='1' />
					<value target='mCallback' data='OrientationCallback' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='add0cf83-9484-4047-8048-40f00c95972e' vmin='0' vmaj='1' codename='Switch1' panelId='0' x='505' y='-100' z='2' xsz='27.0833' ysz='33.3333' zsz='25' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' scadavisible='1' interactive='1' solid='1' layer='2' poslock='0' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='bState' data='0' />
					<value target='macroOnClick' data='' />
					<value target='sCursor' data='002' />
					<value target='iTransitionSpeed' data='0' />
					<value target='bAutoReturn' data='0' />
					<value target='sOn' data='Pen down' />
					<value target='sOff' data='Pen up' />
					<value target='iStyle' data='000' />
					<value target='bShowThumb' data='1' />
					<value target='shapeOff::iOutlineSize' data='1' />
					<value target='iBorderRadius' data='0' />
					<value target='shapeOff::colOutline' data='0' />
					<value target='txtOn::fntFamily' data='Calibri' />
					<value target='txtOn::iFontSize' data='16' />
					<value target='txtOn::bBold' data='0' />
					<value target='txtOn::bItalic' data='0' />
					<value target='shapeOff::colFill' data='16777215' />
					<value target='shapeOff::colFillGradient' data='12632256' />
					<value target='shapeOff::nGradientStyle' data='2' />
					<value target='txtOff::colTextColour' data='0' />
					<value target='shapeOn::colFill' data='16759906' />
					<value target='shapeOn::colFillGradient' data='16777215' />
					<value target='shapeOn::nGradientStyle' data='2' />
					<value target='txtOn::colTextColour' data='0' />
					<value target='sCustomAttributes' data='' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='46df05de-0544-4c2f-b70a-3d5e40074a0c' vmin='1' vmaj='0' codename='ChooseColour1' panelId='0' x='505' y='-180' z='3' xsz='65' ysz='33.3333' zsz='25' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' scadavisible='1' interactive='1' solid='1' layer='2' poslock='0' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='Shape1::colFill' data='255' />
					<value target='sCustomAttributes' data='' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='c68e35f2-92e3-4a48-abd9-4a1818aa1023' vmin='1' vmaj='0' codename='btnClear' panelId='0' x='506' y='-370' z='4' xsz='25' ysz='31.25' zsz='25' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' scadavisible='1' interactive='1' solid='1' layer='2' poslock='0' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='sText' data='Clear' />
					<value target='Caption::nHorizontalAlignment' data='2' />
					<value target='Caption::fntFamily' data='Calibri' />
					<value target='Caption::iFontSize' data='16' />
					<value target='Caption::colTextColour' data='0' />
					<value target='Caption::bBold' data='0' />
					<value target='Caption::bItalic' data='0' />
					<value target='Caption::bUnderline' data='0' />
					<value target='Caption::bStrikethrough' data='0' />
					<value target='Button::colFill' data='13816530' />
					<value target='iStyle' data='000' />
					<value target='Button::iOutlineSize' data='0' />
					<value target='Button::colOutline' data='0' />
					<value target='bShadow' data='1' />
					<value target='Shadow::colFill' data='7895160' />
					<value target='macroOnClick' data='OnbtnClearClick' />
					<value target='sCursor' data='024' />
					<value target='bShowPress' data='1' />
					<value target='bAutoColour' data='1' />
					<value target='colHover' data='5724159' />
					<value target='colClick' data='5921370' />
					<value target='sCustomAttributes' data='' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='3bd55a33-d9ed-44a0-80d9-76a8d954a335' vmin='1' vmaj='0' codename='txtInfo' panelId='0' x='210' y='-500' z='5' xsz='25' ysz='25' zsz='25' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' scadavisible='1' interactive='1' solid='1' layer='2' poslock='0' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='GdiText1::sText' data='x = 0
y = 0
pen = up' />
					<value target='GdiText1::fntFamily' data='Arial' />
					<value target='iFontSize' data='12' />
					<value target='GdiText1::iFontSize' data='12' />
					<value target='GdiText1::nHorizontalAlignment' data='  0' />
					<value target='GdiText1::bWordWrap' data='1' />
					<value target='bHideOverflow' data='0' />
					<value target='GdiText1::bBold' data='0' />
					<value target='GdiText1::bItalic' data='0' />
					<value target='GdiText1::bUnderline' data='0' />
					<value target='GdiText1::bStrikethrough' data='0' />
					<value target='GdiText1::colTextColour' data='0' />
					<value target='GdiText1::colBackgroundColour' data='-1' />
					<value target='sCustomAttributes' data='' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
		</component>
	</components>
	<scadaresourcelookup />
	<keymap />
	<panel2d shadows='0' lighting='2' brightness='0' >
		<background rgb='7292207' img='' style='0' />
		<camera xe='0' ye='0' ze='242' xt='0' yt='0' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
		<viewport dx='200' dy='693' zoom='100' fix_topleft='0' />
		<page x='1000' y='1000' show='1' rgb='16777215' />
		<winpos ID='7005' RectRecentFloat='980,0,1630,450' RectRecentDocked='0,0,200,716' RecentFrameAlignment='16384' RecentRowIndex='0' IsFloating='0' MRUWidth='32767' PinState='0' IsMaximized='0' IsVisible='0' />
	</panel2d>
	<panel3d shadows='0' lighting='2' brightness='0' perspective='1' >
		<background rgb='8409120' img='' style='0' />
		<table rgb='7360576' img='' style='0' size='0' />
		<camera xe='0' ye='0' ze='300' xt='0' yt='0' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
		<camerakey0 xe='0' ye='0' ze='300' xt='0' yt='0' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
		<camerakey1 xe='-3.67394e-14' ye='0' ze='-300' xt='0' yt='0' zt='0' xquat='0' yquat='1' zquat='0' wquat='6.12323e-17' />
		<camerakey2 xe='0' ye='-300' ze='6.66134e-14' xt='0' yt='0' zt='0' xquat='-0.707107' yquat='0' zquat='0' wquat='0.707107' />
		<camerakey3 xe='-3.67394e-14' ye='300' ze='6.66134e-14' xt='0' yt='0' zt='0' xquat='-4.32978e-17' yquat='0.707107' zquat='0.707107' wquat='4.32978e-17' />
		<camerakey4 xe='-300' ye='-6.66134e-14' ze='6.66134e-14' xt='0' yt='0' zt='0' xquat='-0.5' yquat='0.5' zquat='0.5' wquat='0.5' />
		<camerakey5 xe='300' ye='-6.66134e-14' ze='6.66134e-14' xt='0' yt='0' zt='0' xquat='-0.5' yquat='-0.5' zquat='-0.5' wquat='0.5' />
		<camerakey6 xe='-173.205' ye='-173.205' ze='173.205' xt='0' yt='0' zt='0' xquat='-0.424708' yquat='0.17592' zquat='0.339851' wquat='0.820473' />
		<winpos ID='7004' RectRecentFloat='0,425,654,1002' RectRecentDocked='0,0,287,716' RecentFrameAlignment='16384' RecentRowIndex='0' IsFloating='0' MRUWidth='32767' PinState='0' IsMaximized='0' IsVisible='0' />
	</panel3d>
	<panels2d count='1' >
		<panel2d_0 id='0' name='Webpage Design' type='0' >
			<winpos ID='1171' RectRecentFloat='112,154,762,760' RectRecentDocked='0,0,650,450' RecentFrameAlignment='16384' RecentRowIndex='0' IsFloating='1' MRUWidth='32767' PinState='0' IsMaximized='0' IsVisible='1' />
			<background fill='288230376151053813' showgrid='1' gridstyle='1' gridsize='10' gridbrush='71776119075691740' snaptogrid='1' fitcomp='0' disp_x='300' disp_y='400' scale='100' disp_col='16777215' />
		</panel2d_0>
	</panels2d>
	<layout >
		<view type='0' name='Main' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAxQIAAMcCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='OrientationCallback' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAxQIAAMcCAAA' zoom='100' scrollx='0' scrolly='260' flags='0' />
		<view type='0' name='OnbtnClearClick' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAxQIAAMcCAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
	</layout>
</document>
</root>
