home *** CD-ROM | disk | FTP | other *** search
- <html>
- <head>
- <STYLE>
- body{
- font-size : medium;
- }
- td {
- font-size : medium;
- }
- </STYLE>
- </head>
-
- <body bgcolor="silver" text="maroon">
-
- $MENUITEMS$
- <h1><div align="center">$WORKNODENAME$</div></h1><!--<form method="POST" action="http://">-->
- <br>
- <h1><div align="center">Outputs</div></h1>
-
- <P> </P>
- <form method="post" name="configureOutputs" action="CALLBACKID-ConfigureOutputs">
- <h1><div align="center">Embedded Flash Signals</div></h1>
- <table border="0" width="600">
- <tr><th align="left">
- Output Signal Name:</th>
- <th align="left"><input name="Output_EmbeddedName" size="40" value=""></th></tr>
- <tr><th colspan="2"></th></tr>
- <tr><th align="left">
- Flash Embedded Button ID:</th>
- <th align="left"><input name="Output_ButtonID" size="40" value=""></th></tr>
- <tr><th align="left">
- Release GUI?:</th>
- <th align="left">
- <input type="radio" name="Output_EmbeddedReleaseGUI" value="YES" checked> Yes
- <input type="radio" name="Output_EmbeddedReleaseGUI" value="NO"> No</th></tr>
- </table>
- <input type="button" name="Output_EmbeddedADD" value="Add" style="HEIGHT: 24px; WIDTH: 55px" onClick="Add(1);">
- <input type="button" name="Output_EmbeddedOption" value="Clear" style="HEIGHT: 24px; WIDTH: 55px" onClick="HandleOption(1);">
- <br><br>
- Current Outputs:<br>
- <SELECT id="Output_EmbeddedSelect" name="Output_EmbeddedSelect" size=2 style="HEIGHT: 134px; WIDTH: 293px">
- </SELECT>
- <input type="hidden" name="OutputEmbeddedRepository" >
- <br>
- <input type="button" name="Output_EmbeddedREMOVE" value="Remove" onClick="Remove(1);">
- <input type="button" name="Output_EmbeddedEDIT" value="Edit" style="HEIGHT: 24px; WIDTH: 63px" onClick="Edit(1);">
- <br>
- <P>$MENUITEMS$
- </P>
-
- <hr>
- <table>
- <tr><th align="right">
- <input type="hidden" name="saveState" value="0">
- <input type="button" name="save" value="Save" style="HEIGHT: 28px; WIDTH: 72px" onClick="return SubmitForSave();">
- </form></th>
- <th align="left"><form method="post" name="cancel_config" action="CALLBACKID-CancelConfigure"><INPUT name=cancel type=submit value=Cancel style="HEIGHT: 28px; WIDTH: 72px">
- </form>
- </th></tr>
- </table>
- <hr>
-
- <BR>
-
- <A href="ConfigHelp.html#Display" target=_blank>Click here for help</A> |
- <A href="FlashDoc.html" target=_blank>Click here for flash guidelines</A>
- <P> </P>
- </body>
- </HTML>
-
-
- <SCRIPT LANGUAGE="JavaScript">
- //There is ALOT of dead code in here...ignore it...damn it
-
- //Object Variables
- var Signals = new Array();
- var BtnNames = new Array();
- var ReleaseGUI = new Array();
- var Selects = new Array();
- var Repositories = new Array();
- var Adds = new Array();
- var Options = new Array();
-
- //Locally Used Variables
- var strCurrentlyEditing = new Array();
- var nCurrentlyEditing = new Array();
-
- //Imported Values: Need to be set by WorkNode code
- var nCancelRelGUI = 0;
- var nHelpRelGUI = 1;
- var nUseCancel = 0;
- var nUseHelp = 0;
- var strRepository = new Array();
-
- strRepository[0] = "";
- strRepository[1] = "";
- strCurrentlyEditing[0] = "";
- strCurrentlyEditing[1] = "";
- nCurrentlyEditing[0] = -1;
- nCurrentlyEditing[1] = -1;
-
- InitInputs();
-
- /*VARS*/
-
- /*ENDVARS*/
-
- //SetBinaryRB(nCancelRelGUI, document.forms[0].Cancel_Rel_GUI);
- //SetBinaryRB(nHelpRelGUI, document.forms[0].Help_Rel_GUI);
-
- //SetGUIRBS(document.forms[0].Cancel_Rel_GUI);
- //SetGUIRBS(document.forms[0].Help_Rel_GUI);
-
- //document.forms[0].UseCancel.checked = nUseCancel;
- //document.forms[0].UseHelp.checked = nUseHelp;
-
- //SetCBVals();
-
- for (x = 1; x < 2; x++)
- {
- Repositories[x].value = strRepository[x];
- PopulateSelectBox(strRepository[x], Selects[x]);
- }
-
- function InitInputs()
- {
- //Signals[0] = document.forms[0].Output_Name;
- Signals[1] = document.forms[0].Output_EmbeddedName;
- //BtnNames[0] = document.forms[0].Output_DisplayName;
- BtnNames[1] = document.forms[0].Output_ButtonID;
- //ReleaseGUI[0] = document.forms[0].Output_ReleaseGUI;
- ReleaseGUI[1] = document.forms[0].Output_EmbeddedReleaseGUI;
- //Selects[0] = document.forms[0].Output_Select;
- Selects[1] = document.forms[0].Output_EmbeddedSelect;
- //Repositories[0] = document.forms[0].OutputRepository;
- Repositories[1] = document.forms[0].OutputEmbeddedRepository;
- //Adds[0] = document.forms[0].Output_ADD;
- Adds[1] = document.forms[0].Output_EmbeddedADD;
- //Options[0] = document.forms[0].Output_Option;
- Options[1] = document.forms[0].Output_EmbeddedOption;
- }
-
- //Now begins the HACK
- function SetGUIRBS(rb)
- {
- if (rb[0].checked)
- {
- rb[0].value = "CheckThis";
- rb[1].value = "";
- }
- else
- {
- rb[0].value = "";
- rb[1].value = "CheckThis";
- }
- }
-
- function SetCBVals()
- {
- if (document.forms[0].UseCancel.checked)
- {
- document.forms[0].UseCancel.value = "CheckThis";
- }
- else
- {
- document.forms[0].UseCancel.value = "";
- }
- if (document.forms[0].UseHelp.checked)
- {
- document.forms[0].UseHelp.value = "CheckThis";
- }
- else
- {
- document.forms[0].UseHelp.value = "";
- }
- }
-
-
- function SetBinaryRB(nValue, rbControl)
- {
- if (nValue != 1)
- {
- nValue = 0;
- }
- rbControl[nValue].checked = true;
- }
-
- function Add(nField)
- {
- var strInstanceName;
- var strDisplayName;
- var bReleaseGUI;
-
- strInstanceName = Signals[nField].value;
- strDisplayName = BtnNames[nField].value;
- bReleaseGUI = ReleaseGUI[nField][0].checked;
-
- if (IsValidInstance(strInstanceName, nField))
- {
- if (bReleaseGUI)
- {
- UpdateRepository(strInstanceName, strDisplayName, "YES", nField);
- }
- else
- {
- UpdateRepository(strInstanceName, strDisplayName, "NO", nField);
- }
-
- Signals[nField].value = "";
- BtnNames[nField].value = "";
- ReleaseGUI[nField][0].checked = true;
- }
- }
-
- function Remove(nField)
- {
- var nIndex = Selects[nField].selectedIndex;
- var strArray;
- var strTemp;
- var strOutputRepository;
- var nLength;
-
- strOutputRepository = new String(Repositories[nField].value.toString());
- nLength = strOutputRepository.length - 2;
- strTemp = strOutputRepository.substring(0, nLength); //knock off trailing delimeters
- strArray = strTemp.split(";~");
-
- if (strArray.length == 1)
- {
- strOutputRepository = "";
- }
- else
- {
- strArray = RemoveArrayElement(strArray, nIndex);
- strOutputRepository = strArray.join(";~") + ";~";
- HandleOption(nField);
- }
-
- Repositories[nField].value = strOutputRepository;
-
- //DEBUGGING CODE
- //document.forms[0].Dict_Entry.value = strOutputRepository;
- //document.forms[0].Output_Name.value = "BAH";
-
- Selects[nField].options[nIndex] = null;
- }
-
- function UpdateRepository(strNewName, strNewDisplayName, strNewRelGUI, nField)
- {
- var strRepository;
-
- if (nCurrentlyEditing[nField] > -1)
- {
- var strArray;
- var strTemp;
- var nLength;
- var strNewValPair;
-
- strNewValPair = strNewName + "=" + strNewDisplayName + "=" + strNewRelGUI;
- strRepository = new String(Repositories[nField].value.toString());
- nLength = strRepository.length - 2;
- strTemp = strRepository.substring(0, nLength); //knock off trailing delimeters
- strArray = strRepository.split(";~");
- strArray[nCurrentlyEditing[nField]] = strNewValPair;
- strRepository = strArray.join(";~");
-
- Repositories[nField].value = strRepository;
- Selects[nField].options[nCurrentlyEditing[nField]].text = strNewName;
-
- Adds[nField].value = "Add";
- Options[nField].value = "Clear";
- nCurrentlyEditing[nField] = -1;
- strCurrentlyEditing[nField] = "";
- }
- else
- {
- var opOption = new Option;
-
- strRepository = Repositories[nField].value + strNewName + "=" + strNewDisplayName + "=" + strNewRelGUI + ";~";
- Repositories[nField].value = strRepository;
-
- opOption.text = strNewName;
- Selects[nField].options[Selects[nField].options.length] = opOption;
- }
- }
-
- function Edit(nField)
- {
- var nIndex = Selects[nField].selectedIndex;
- var strArray;
- var strTemp;
- var strRepository;
- var nLength;
- var strStringToEdit;
-
- strRepository = new String(Repositories[nField].value.toString());
- nLength = strRepository.length - 2;
- strTemp = strRepository.substring(0, nLength); //knock off trailing delimeters
- strArray = strRepository.split(";~");
-
- strStringToEdit = strArray[nIndex];
- strArray = strStringToEdit.split("=");
- nCurrentlyEditing[nField] = nIndex;
-
- Adds[nField].value = "Update";
- Options[nField].value = "Cancel";
- Signals[nField].value = strArray[0];
- BtnNames[nField].value = strArray[1];
- strCurrentlyEditing[nField] = strArray[0];
- if (strArray[2] == "YES")
- {
- ReleaseGUI[nField][0].checked = true;
- }
- else
- {
- ReleaseGUI[nField][1].checked = true;
- }
- }
-
- function HandleOption(nField)
- {
- if (nCurrentlyEditing[nField] > -1)
- {
- nCurrentlyEditing[nField] = -1;
- strCurrentlyEditing[nField] = "";
- Options[nField].value = "Clear";
- Adds[nField].value = "Add";
- }
- Signals[nField].value = "";
- BtnNames[nField].value = "";
- ReleaseGUI[nField][0].checked = true;
- }
-
- function RemoveArrayElement(strArray, nIndex)
- {
- var tempArray = new Array();
- var nCounter;
- var nArrCounter;
- var nLength;
-
- nArrCounter = 0;
- nLength = strArray.length;
- nCounter = 0;
- while (nCounter < nLength)
- {
- if ((strArray[nCounter].length != 0) && (nCounter != nIndex))
- {
- tempArray[nArrCounter] = strArray[nCounter];
- nArrCounter = nArrCounter + 1;
- }
- nCounter = nCounter + 1;
- }
-
- return tempArray;
- }
-
-
- function PopulateSelectBox(strValues, selectBox)
- {
- var strArray;
- var strTemp;
- var nLength;
- var strStringToAdd;
- var nCounter=0;
- var aTempArray;
- var tempOption;
-
- if (strValues == "")
- {
- return;
- }
- nLength = strValues.length - 2;
- strTemp = strValues.substring(0, nLength); //knock off trailing delimeters
- strArray = strTemp.split(";~");
- nLength = strArray.length;
-
- while (nCounter < nLength)
- {
- tempOption = new Option();
- aTempArray = strArray[nCounter].split("=");
- tempOption.text = aTempArray[0];
- selectBox.options[selectBox.length] = tempOption;
- nCounter = nCounter + 1;
- }
- }
-
- function IsValidInstance(strInstance, nField)
- {
- var nLength;
- var nCounter = 0;
-
- if ((strInstance == "help") || (strInstance == "cancel"))
- {
- var strError = "";
-
- strError = "Signal '" + String(strInstance) + "' is reserved. Please choose a different signal name.";
- window.alert(strError);
- return false;
- }
-
- nLength = Selects[nField].length;
- while (nCounter < nLength)
- {
- if ((strInstance == Selects[nField].options[nCounter].text) && (strInstance != strCurrentlyEditing[nField]))
- {
- window.alert("Duplicate Signal already exists.");
- return false;
- }
- nCounter++;
- }
-
- return true;
- }
-
- </SCRIPT>
-
- <SCRIPT LANGUAGE="VBScript">
- Function SubmitForSave()
- document.forms(0).saveState.value = "1"
- if (VerifyData()) then
- if (document.forms(0).onSubmit()) then
- document.forms(0).submit()
- end if
- end if
- End Function
-
- 'Here for potential future use
- Function VerifyData()
- dim bReturn
- bReturn = True
-
- 'Enter verification code here
-
- VerifyData = bReturn
- end function
-
- </SCRIPT>