/////////////boiler application.mxml/////
<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute" creationComplete="sendService.send()"
backgroundGradientColors="[0x000000,0x323232]"
viewSourceURL="srcview/index.html"
horizontalAlign="center" showStatusBar="false"
title="Boiler Efficency Calculator">
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
import mx.events.ValidationResultEvent;
import flash.net.navigateToURL;
[Bindable]
public var comboArray:ArrayCollection=new ArrayCollection(
[{label:"SelectFuel"},{label:"GAS"},{label:"COAL"},{label:"DIESEL"}]);
[Bindable]
public var steamArray:ArrayCollection=new ArrayCollection();
public var stArray:Array=new Array();
public var vResult:ValidationResultEvent;
public function autoVal(event:Event):void
{
if(stp.text==""||Number(stp.text)>40)
{
theat.text="";
}
else
{
theat.text=String(steamArray.getItemAt(Number(stp.text)).totalheat/4.18);
}
}
public function closeHandler(e:Event):void
{
if(comboCloro.selectedLabel=="GAS")
{
clorotxt.text="18130";
}
if(comboCloro.selectedLabel=="COAL")
{
clorotxt.text="35576";
}
if(comboCloro.selectedLabel=="DIESEL")
{
clorotxt.text="106254";
}
}
public function resultHandler(event:ResultEvent):void
{
steamArray=event.result.steamtable.st;
}
public function faultHandler(event:FaultEvent):void
{
}
private function Format():void
{
vResult = numVal.validate()&&wts.validate()&&wValidator.validate()
&&eValidator.validate()&&effValidator.validate();
if (vResult.type==ValidationResultEvent.VALID)
{
numberFormatter.format(stp.text);
wsFormatter.format(wsteam.text);
wFormatter.format(wfuel.text);
eFormatter.format(entharpy.text);
effFormatter.format(eff.text);//formula to calculate efficency of boiler
eff.text=String(Number(wsteam.text)*(Number(theat.text)
-Number(entharpy.text))
/(Number(wfuel.text)*Number(clorotxt.text))*100);
}
else
{
stp.text= "";
theat.text="";
eff.text="";
}
}
]]>
</mx:Script>
<mx:NumberFormatter id="wFormatter" precision="2" useNegativeSign="false"/>
<mx:NumberValidator id="wValidator" source="{wfuel}" property="text"
allowNegative="false" domain="int"
integerError="Enter Integer value" minValue="0"
maxValue="1000000" required="true"/>
<mx:NumberFormatter id="numberFormatter" precision="2" useNegativeSign="false"/>
<mx:NumberValidator id="numVal" source="{stp}" property="text"
allowNegative="false" domain="int"
integerError="Enter Integer value" minValue="0"
maxValue="40" required="true"/>
<mx:NumberFormatter id="wsFormatter" useNegativeSign="false"/>
<mx:NumberValidator id="wts" source="{wsteam}" property="text" allowNegative="false"
domain="int" minValue="0" maxValue="1000000" required="true"
integerError="Enter Int Value"/>
<mx:NumberFormatter id="eFormatter" precision="2" useNegativeSign="false"/>
<mx:NumberValidator id="eValidator" source="{entharpy}" property="text"
allowNegative="false" domain="int"
integerError="Enter Integer value" minValue="0"
maxValue="1000" required="true"/>
<mx:NumberFormatter id="effFormatter" precision="4" useNegativeSign="false"/>
<mx:NumberValidator id="effValidator" source="{eff}" property="text"
allowNegative="false" domain="real"
integerError="Enter Integer value" minValue="0"
maxValue="10000" required="false"/>
<mx:HTTPService id="sendService" result="resultHandler(event)" fault="faultHandler(event)"
url="data/steamTable.xml"/>
<mx:Panel x="248" y="157" width="526" height="411" title="Boiler Efficiency Calculator"
paddingTop="10" paddingBottom="10" paddingLeft="10" paddingRight="10"
color="0xffffff" borderAlpha="0.15" layout="absolute">
<mx:Label x="10" y="6" text="Steam Pressure" fontSize="14" fontWeight="bold"
fontStyle="normal" color="#060000" height="25"/>
<mx:TextInput x="144" y="8" width="116" fontWeight="bold" fontSize="14"
change="autoVal(event)" id="stp" color="#060000" maxChars="2" borderStyle="inset" backgroundColor="#F7FA05"/>
<mx:Label x="11" y="193" text="Type Of Fuel" fontSize="14" fontWeight="bold"
fontStyle="normal" color="#060000"/>
<mx:ComboBox x="145" y="192" editable="false" width="115" dataProvider="{comboArray}"
change="closeHandler(event)" id="comboCloro" fontWeight="bold"
fontSize="12" color="#060000" selectedIndex="0"/>
<mx:Label x="10" y="58" text="Weight Of Steam" fontWeight="bold" fontStyle="normal"
fontSize="14" color="#060000"/>
<mx:TextInput x="145" y="56" width="115" fontWeight="bold" fontSize="14"
id="wsteam" color="#060000" maxChars="7" backgroundColor="#F7FA05"/>
<mx:Label x="10" y="147" text="Enthalpy" fontSize="14" fontWeight="bold"
fontStyle="normal" color="#060000"/>
<mx:Label x="299" y="10" text="Total Heat" fontWeight="bold" fontStyle="normal"
fontSize="14" color="#060000"/>
<mx:TextInput x="391" y="8" width="63" editable="false" fontWeight="bold"
fontSize="13" id="theat" color="#060000" backgroundColor="#F7FA05"/>
<mx:Label x="311" y="58" text="Calorofic" fontWeight="bold" fontStyle="normal"
fontSize="14" color="#060000"/>
<mx:TextInput x="392" y="56" width="62" id="clorotxt" editable="false"
fontWeight="bold" fontSize="13" color="#060000" backgroundColor="#F7FA05"/>
<mx:TextInput x="182" y="264" width="173" id="eff" fontWeight="bold"
fontSize="14" maxChars="3" editable="false" color="#060000" backgroundColor="#F7FA05"/>
<mx:Label x="87" y="262" text="Efficency" fontWeight="bold" fontStyle="normal"
fontSize="14" color="#060000"/>
<mx:Button x="145" y="328" label="EFFICENCY" fontWeight="bold" fontStyle="normal"
fontSize="14" click="Format()" color="#FC0404" id="myButton"/>
<mx:Label x="10" y="100" text="Weight Of Fuel" fontWeight="bold"
fontSize="14" color="#060000"/>
<mx:TextInput x="145" y="102" width="115" id="wfuel" fontWeight="bold" color="#060000"
fontSize="14" maxChars="7" backgroundColor="#F7FA05"/>
<mx:Label x="259" y="14" text="X5" fontWeight="bold" color="#FD0202"/>
<mx:Label x="260" y="62" text="lbs" fontWeight="bold" color="#FD0202"/>
<mx:Label x="260" y="104" text="m3" fontWeight="bold" color="#FE0202"/>
<mx:Label x="260" y="151" text="C" fontWeight="bold" color="#FA0505"/>
<mx:TextInput x="145" y="145" width="115" fontWeight="bold" fontSize="14" id="entharpy"
color="#060000" maxChars="4" backgroundColor="#F7FA05"/>
<mx:Label x="356" y="268" text="%" color="#FC0202" fontSize="14" fontWeight="bold"/>
<mx:Label x="454" y="61" text="CHU" width="38" color="#FE0505" fontSize="9"/>
<mx:Label x="26" y="21" text="e.g 8x5=40BAR" color="#000000"/>
<mx:Button x="278" y="328" label="CONVERTER" color="#FE0202"
click="navigateToURL(new URLRequest('data/converter.xls'),'_blank');" fontSize="14" fontWeight="bold"/>
<mx:Label x="453" y="12" text="CHU/kg" color="#FD0202"/>
</mx:Panel>
</mx:WindowedApplication>
///////////////////steamtable.xml////////////
<steamtable>
<st>
<pressure>0</pressure>
<totalheat>2501.6</totalheat>
</st>
<st>
<pressure>5</pressure>
<totalheat>2747.5</totalheat>
</st>
<st>
<pressure>10</pressure>
<totalheat>2776.2</totalheat>
</st>
<st>
<pressure>15</pressure>
<totalheat>2789.9</totalheat>
</st>
<st>
<pressure>20</pressure>
<totalheat>2797.2</totalheat>
</st>
<st>
<pressure>25</pressure>
<totalheat>2800.9</totalheat>
</st>
<st>
<pressure>30</pressure>
<totalheat>2802.3</totalheat>
</st>
<st>
<pressure>35</pressure>
<totalheat>2802.0</totalheat>
</st>
<st>
<pressure>40</pressure>
<totalheat>2800.3</totalheat>
</st>
<st>
<pressure>45</pressure>
<totalheat>2797.7</totalheat>
</st>
<st>
<pressure>50</pressure>
<totalheat>2794.2</totalheat>
</st>
<st>
<pressure>55</pressure>
<totalheat>2789.0</totalheat>
</st>
<st>
<pressure>60</pressure>
<totalheat>2785.0</totalheat>
</st>
<st>
<pressure>65</pressure>
<totalheat>2779.0</totalheat>
</st>
<st>
<pressure>70</pressure>
<totalheat>2773.4</totalheat>
</st>
<st>
<pressure>75</pressure>
<totalheat>2766.5</totalheat>
</st>
<st>
<pressure>80</pressure>
<totalheat>2759.9</totalheat>
</st>
<st>
<pressure>85</pressure>
<totalheat>2752.5</totalheat>
</st>
<st>
<pressure>90</pressure>
<totalheat>2744.6</totalheat>
</st>
<st>
<pressure>95</pressure>
<totalheat>2736.5</totalheat>
</st>
<st>
<pressure>100</pressure>
<totalheat>2727.7</totalheat>
</st>
<st>
<pressure>105</pressure>
<totalheat>2718.7</totalheat>
</st>
<st>
<pressure>110</pressure>
<totalheat>2709.3</totalheat>
</st>
<st>
<pressure>115</pressure>
<totalheat>2699.5</totalheat>
</st>
<st>
<pressure>120</pressure>
<totalheat>2698.2</totalheat>
</st>
<st>
<pressure>125</pressure>
<totalheat>2678.4</totalheat>
</st>
<st>
<pressure>130</pressure>
<totalheat>2667.0</totalheat>
</st>
<st>
<pressure>135</pressure>
<totalheat>2655.1</totalheat>
</st>
<st>
<pressure>140</pressure>
<totalheat>2642.4</totalheat>
</st>
<st>
<pressure>145</pressure>
<totalheat>2629.2</totalheat>
</st>
<st>
<pressure>150</pressure>
<totalheat>2615.1</totalheat>
</st>
<st>
<pressure>155</pressure>
<totalheat>2600.4</totalheat>
</st>
<st>
<pressure>160</pressure>
<totalheat>2584.9</totalheat>
</st>
<st>
<pressure>165</pressure>
<totalheat>2568.9</totalheat>
</st>
<st>
<pressure>170</pressure>
<totalheat>2551.6</totalheat>
</st>
<st>
<pressure>175</pressure>
<totalheat>2533.3</totalheat>
</st>
<st>
<pressure>180</pressure>
<totalheat>2513.9</totalheat>
</st>
<st>
<pressure>185</pressure>
<totalheat>2493.0</totalheat>
</st>
<st>
<pressure>190</pressure>
<totalheat>2470.5</totalheat>
</st>
<st>
<pressure>195</pressure>
<totalheat>2445.8</totalheat>
</st>
<st>
<pressure>200</pressure>
<totalheat>2418.2</totalheat>
</st>
<st>
<pressure>205</pressure>
<totalheat>2386.2</totalheat>
</st>
<st>
<pressure>210</pressure>
<totalheat>2347.5</totalheat>
</st>
<st>
<pressure>215</pressure>
<totalheat>2294.6</totalheat>
</st>
<st>
<pressure>220</pressure>
<totalheat>2196.6</totalheat>
</st>
</steamtable>
<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute" creationComplete="sendService.send()"
backgroundGradientColors="[0x000000,0x323232]"
viewSourceURL="srcview/index.html"
horizontalAlign="center" showStatusBar="false"
title="Boiler Efficency Calculator">
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
import mx.events.ValidationResultEvent;
import flash.net.navigateToURL;
[Bindable]
public var comboArray:ArrayCollection=new ArrayCollection(
[{label:"SelectFuel"},{label:"GAS"},{label:"COAL"},{label:"DIESEL"}]);
[Bindable]
public var steamArray:ArrayCollection=new ArrayCollection();
public var stArray:Array=new Array();
public var vResult:ValidationResultEvent;
public function autoVal(event:Event):void
{
if(stp.text==""||Number(stp.text)>40)
{
theat.text="";
}
else
{
theat.text=String(steamArray.getItemAt(Number(stp.text)).totalheat/4.18);
}
}
public function closeHandler(e:Event):void
{
if(comboCloro.selectedLabel=="GAS")
{
clorotxt.text="18130";
}
if(comboCloro.selectedLabel=="COAL")
{
clorotxt.text="35576";
}
if(comboCloro.selectedLabel=="DIESEL")
{
clorotxt.text="106254";
}
}
public function resultHandler(event:ResultEvent):void
{
steamArray=event.result.steamtable.st;
}
public function faultHandler(event:FaultEvent):void
{
}
private function Format():void
{
vResult = numVal.validate()&&wts.validate()&&wValidator.validate()
&&eValidator.validate()&&effValidator.validate();
if (vResult.type==ValidationResultEvent.VALID)
{
numberFormatter.format(stp.text);
wsFormatter.format(wsteam.text);
wFormatter.format(wfuel.text);
eFormatter.format(entharpy.text);
effFormatter.format(eff.text);//formula to calculate efficency of boiler
eff.text=String(Number(wsteam.text)*(Number(theat.text)
-Number(entharpy.text))
/(Number(wfuel.text)*Number(clorotxt.text))*100);
}
else
{
stp.text= "";
theat.text="";
eff.text="";
}
}
]]>
</mx:Script>
<mx:NumberFormatter id="wFormatter" precision="2" useNegativeSign="false"/>
<mx:NumberValidator id="wValidator" source="{wfuel}" property="text"
allowNegative="false" domain="int"
integerError="Enter Integer value" minValue="0"
maxValue="1000000" required="true"/>
<mx:NumberFormatter id="numberFormatter" precision="2" useNegativeSign="false"/>
<mx:NumberValidator id="numVal" source="{stp}" property="text"
allowNegative="false" domain="int"
integerError="Enter Integer value" minValue="0"
maxValue="40" required="true"/>
<mx:NumberFormatter id="wsFormatter" useNegativeSign="false"/>
<mx:NumberValidator id="wts" source="{wsteam}" property="text" allowNegative="false"
domain="int" minValue="0" maxValue="1000000" required="true"
integerError="Enter Int Value"/>
<mx:NumberFormatter id="eFormatter" precision="2" useNegativeSign="false"/>
<mx:NumberValidator id="eValidator" source="{entharpy}" property="text"
allowNegative="false" domain="int"
integerError="Enter Integer value" minValue="0"
maxValue="1000" required="true"/>
<mx:NumberFormatter id="effFormatter" precision="4" useNegativeSign="false"/>
<mx:NumberValidator id="effValidator" source="{eff}" property="text"
allowNegative="false" domain="real"
integerError="Enter Integer value" minValue="0"
maxValue="10000" required="false"/>
<mx:HTTPService id="sendService" result="resultHandler(event)" fault="faultHandler(event)"
url="data/steamTable.xml"/>
<mx:Panel x="248" y="157" width="526" height="411" title="Boiler Efficiency Calculator"
paddingTop="10" paddingBottom="10" paddingLeft="10" paddingRight="10"
color="0xffffff" borderAlpha="0.15" layout="absolute">
<mx:Label x="10" y="6" text="Steam Pressure" fontSize="14" fontWeight="bold"
fontStyle="normal" color="#060000" height="25"/>
<mx:TextInput x="144" y="8" width="116" fontWeight="bold" fontSize="14"
change="autoVal(event)" id="stp" color="#060000" maxChars="2" borderStyle="inset" backgroundColor="#F7FA05"/>
<mx:Label x="11" y="193" text="Type Of Fuel" fontSize="14" fontWeight="bold"
fontStyle="normal" color="#060000"/>
<mx:ComboBox x="145" y="192" editable="false" width="115" dataProvider="{comboArray}"
change="closeHandler(event)" id="comboCloro" fontWeight="bold"
fontSize="12" color="#060000" selectedIndex="0"/>
<mx:Label x="10" y="58" text="Weight Of Steam" fontWeight="bold" fontStyle="normal"
fontSize="14" color="#060000"/>
<mx:TextInput x="145" y="56" width="115" fontWeight="bold" fontSize="14"
id="wsteam" color="#060000" maxChars="7" backgroundColor="#F7FA05"/>
<mx:Label x="10" y="147" text="Enthalpy" fontSize="14" fontWeight="bold"
fontStyle="normal" color="#060000"/>
<mx:Label x="299" y="10" text="Total Heat" fontWeight="bold" fontStyle="normal"
fontSize="14" color="#060000"/>
<mx:TextInput x="391" y="8" width="63" editable="false" fontWeight="bold"
fontSize="13" id="theat" color="#060000" backgroundColor="#F7FA05"/>
<mx:Label x="311" y="58" text="Calorofic" fontWeight="bold" fontStyle="normal"
fontSize="14" color="#060000"/>
<mx:TextInput x="392" y="56" width="62" id="clorotxt" editable="false"
fontWeight="bold" fontSize="13" color="#060000" backgroundColor="#F7FA05"/>
<mx:TextInput x="182" y="264" width="173" id="eff" fontWeight="bold"
fontSize="14" maxChars="3" editable="false" color="#060000" backgroundColor="#F7FA05"/>
<mx:Label x="87" y="262" text="Efficency" fontWeight="bold" fontStyle="normal"
fontSize="14" color="#060000"/>
<mx:Button x="145" y="328" label="EFFICENCY" fontWeight="bold" fontStyle="normal"
fontSize="14" click="Format()" color="#FC0404" id="myButton"/>
<mx:Label x="10" y="100" text="Weight Of Fuel" fontWeight="bold"
fontSize="14" color="#060000"/>
<mx:TextInput x="145" y="102" width="115" id="wfuel" fontWeight="bold" color="#060000"
fontSize="14" maxChars="7" backgroundColor="#F7FA05"/>
<mx:Label x="259" y="14" text="X5" fontWeight="bold" color="#FD0202"/>
<mx:Label x="260" y="62" text="lbs" fontWeight="bold" color="#FD0202"/>
<mx:Label x="260" y="104" text="m3" fontWeight="bold" color="#FE0202"/>
<mx:Label x="260" y="151" text="C" fontWeight="bold" color="#FA0505"/>
<mx:TextInput x="145" y="145" width="115" fontWeight="bold" fontSize="14" id="entharpy"
color="#060000" maxChars="4" backgroundColor="#F7FA05"/>
<mx:Label x="356" y="268" text="%" color="#FC0202" fontSize="14" fontWeight="bold"/>
<mx:Label x="454" y="61" text="CHU" width="38" color="#FE0505" fontSize="9"/>
<mx:Label x="26" y="21" text="e.g 8x5=40BAR" color="#000000"/>
<mx:Button x="278" y="328" label="CONVERTER" color="#FE0202"
click="navigateToURL(new URLRequest('data/converter.xls'),'_blank');" fontSize="14" fontWeight="bold"/>
<mx:Label x="453" y="12" text="CHU/kg" color="#FD0202"/>
</mx:Panel>
</mx:WindowedApplication>
///////////////////steamtable.xml////////////
<steamtable>
<st>
<pressure>0</pressure>
<totalheat>2501.6</totalheat>
</st>
<st>
<pressure>5</pressure>
<totalheat>2747.5</totalheat>
</st>
<st>
<pressure>10</pressure>
<totalheat>2776.2</totalheat>
</st>
<st>
<pressure>15</pressure>
<totalheat>2789.9</totalheat>
</st>
<st>
<pressure>20</pressure>
<totalheat>2797.2</totalheat>
</st>
<st>
<pressure>25</pressure>
<totalheat>2800.9</totalheat>
</st>
<st>
<pressure>30</pressure>
<totalheat>2802.3</totalheat>
</st>
<st>
<pressure>35</pressure>
<totalheat>2802.0</totalheat>
</st>
<st>
<pressure>40</pressure>
<totalheat>2800.3</totalheat>
</st>
<st>
<pressure>45</pressure>
<totalheat>2797.7</totalheat>
</st>
<st>
<pressure>50</pressure>
<totalheat>2794.2</totalheat>
</st>
<st>
<pressure>55</pressure>
<totalheat>2789.0</totalheat>
</st>
<st>
<pressure>60</pressure>
<totalheat>2785.0</totalheat>
</st>
<st>
<pressure>65</pressure>
<totalheat>2779.0</totalheat>
</st>
<st>
<pressure>70</pressure>
<totalheat>2773.4</totalheat>
</st>
<st>
<pressure>75</pressure>
<totalheat>2766.5</totalheat>
</st>
<st>
<pressure>80</pressure>
<totalheat>2759.9</totalheat>
</st>
<st>
<pressure>85</pressure>
<totalheat>2752.5</totalheat>
</st>
<st>
<pressure>90</pressure>
<totalheat>2744.6</totalheat>
</st>
<st>
<pressure>95</pressure>
<totalheat>2736.5</totalheat>
</st>
<st>
<pressure>100</pressure>
<totalheat>2727.7</totalheat>
</st>
<st>
<pressure>105</pressure>
<totalheat>2718.7</totalheat>
</st>
<st>
<pressure>110</pressure>
<totalheat>2709.3</totalheat>
</st>
<st>
<pressure>115</pressure>
<totalheat>2699.5</totalheat>
</st>
<st>
<pressure>120</pressure>
<totalheat>2698.2</totalheat>
</st>
<st>
<pressure>125</pressure>
<totalheat>2678.4</totalheat>
</st>
<st>
<pressure>130</pressure>
<totalheat>2667.0</totalheat>
</st>
<st>
<pressure>135</pressure>
<totalheat>2655.1</totalheat>
</st>
<st>
<pressure>140</pressure>
<totalheat>2642.4</totalheat>
</st>
<st>
<pressure>145</pressure>
<totalheat>2629.2</totalheat>
</st>
<st>
<pressure>150</pressure>
<totalheat>2615.1</totalheat>
</st>
<st>
<pressure>155</pressure>
<totalheat>2600.4</totalheat>
</st>
<st>
<pressure>160</pressure>
<totalheat>2584.9</totalheat>
</st>
<st>
<pressure>165</pressure>
<totalheat>2568.9</totalheat>
</st>
<st>
<pressure>170</pressure>
<totalheat>2551.6</totalheat>
</st>
<st>
<pressure>175</pressure>
<totalheat>2533.3</totalheat>
</st>
<st>
<pressure>180</pressure>
<totalheat>2513.9</totalheat>
</st>
<st>
<pressure>185</pressure>
<totalheat>2493.0</totalheat>
</st>
<st>
<pressure>190</pressure>
<totalheat>2470.5</totalheat>
</st>
<st>
<pressure>195</pressure>
<totalheat>2445.8</totalheat>
</st>
<st>
<pressure>200</pressure>
<totalheat>2418.2</totalheat>
</st>
<st>
<pressure>205</pressure>
<totalheat>2386.2</totalheat>
</st>
<st>
<pressure>210</pressure>
<totalheat>2347.5</totalheat>
</st>
<st>
<pressure>215</pressure>
<totalheat>2294.6</totalheat>
</st>
<st>
<pressure>220</pressure>
<totalheat>2196.6</totalheat>
</st>
</steamtable>