V 10 1 LANG:1 0 PANEL,-1 -1 969 652 N "_3DFace" 0 E E E E E 1 -1 -1 0 40 140 ""0 1 E " int nElements= 10; //**************************************************************** // list of elements for a recipe // for the moment this is hardcoded here, but later a generic way of doing this must be done dyn_string getElements(){ dyn_string out; // \"dist_18:Wiener/WienerPower0/Channel00.Settings.CurrentLimitSetpoint\" //\"dist_18:Wiener/WienerPower0/Channel00.Settings.OverCurrentCompSetpoint\" out[1]=\"Settings.Voltage\"; out[2]=\"Settings.SupervisionMaxCurrent\"; out[3]=\"Settings.VoltageRiseRate\"; out[4]=\"Settings.VoltageFallRate\"; out[5]=\"Settings.SupervisionMinSenseVoltage\"; out[6]=\"Settings.SupervisionMaxSenseVoltage\"; out[7]=\"Settings.SupervisionMaxTerminalVoltage\"; out[8]=\"Settings.Current\"; out[9]=\"Settings.SupervisionMaxPower\"; out[10]=\"Settings.OnOffChannel\"; return out; } //********************************************************************** // List of the correspondent headers (the same order as the list of elements) dyn_string getHeaders(){ dyn_string out; out[1]=\"Vset\"; out[2]=\"Itrip\"; out[3]=\"VrampUp\"; out[4]=\"VrampDown\"; out[5]=\"MinVsense\"; out[6]=\"MaxVsense\"; out[7]=\"MaxVterm\"; out[8]=\"Ireg\"; out[9]=\"MaxPower\"; out[10]=\"OnOff\"; return out; } //*********************************************************************** // function that acording to a dpe element returns the index int getDpeNumber(string element){ dyn_string mainElem = getElements(); for( int index = 1 ; index <= dynlen(mainElem ) ; index++){ if (element == mainElem[index]) return index; } return -1; } //*************************************************** // function to get values from a recipe and to put them in the table getValuesForTable(string recipe){ dyn_string deviceElements; dyn_mixed settings; dyn_dyn_mixed recipeObject; dyn_string exceptionInfo; bool checkExists=TRUE; dynClear(recipeObject); dyn_string deviceList; TABLE1.deleteAllLines(); // loads the recipe fwConfigurationDB_getRecipeFromCache( recipe, deviceList, \"\", recipeObject, exceptionInfo); if (dynlen(exceptionInfo)) {fwExceptionHandling_display(exceptionInfo);return;}; // selects all elements in the table deviceElements[1]=\"*\"; fwConfigurationDB_extractSettingFromRecipe( recipeObject, deviceElements, settings, exceptionInfo); if (dynlen(exceptionInfo)) {fwExceptionHandling_display(exceptionInfo);return;}; // loops through all available channels while( dynlen(deviceElements) >= 1){ dyn_mixed dpValues; dyn_string dpSettings = getAllOfChannel( deviceElements[1],deviceElements, settings, dpValues); //DebugTN(\"dpSettings\", dpSettings); fillRow( dpSettings, dpValues); } } //***************************************************************** // function to fill one row in the table fillRow(dyn_string dpSettings, dyn_mixed values){ dyn_string line = makeDynString (\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"); for(int index = 1 ; index <= dynlen(dpSettings) ; index++){ string dpe = getElementChannel( dpSettings[index]); int pos = getDpeNumber( dpe); if ( (pos > 0) && (pos < nElements+1)) line[pos+1]=values[index]; } line[1]= getDpChannel(dpSettings[1]); appendLineTable( line); } //**************************************************** // function to append one line in the table appendLineTable(dyn_string values){ TABLE1.appendLine( \"#1\", values[1], \"#2\", values[2], \"#3\", values[3], \"#4\", values[4], \"#5\", values[5], \"#6\", values[6], \"#7\", values[7], \"#8\", values[8], \"#9\", values[9], \"#10\", values[10], \"#11\", values[11]); } //**************************************************************************** // gets all elements of the same channel in a list of string removing them from the input list dyn_string getAllOfChannel( string dp, dyn_string &elements, dyn_mixed &values, dyn_mixed &outValues){ string channel = getDpChannel(dp); dyn_string outElements; dynClear( outValues); // will loop over all elements removing the ones that belong to the same channel int index =1; while (index <= dynlen(elements)){ if (getDpChannel( elements[index])==channel){ dynAppend(outElements, elements[index]); dynRemove(elements,index); dynAppend(outValues, values[index]); dynRemove(values, index); } else{ ++index; } } return outElements; } //*************************************************************** // gets the top datapoint name of a datapoint element string getDpChannel( string dp){ dyn_string out = strsplit(dp,\".\"); return out[1]; } //********************************************************************** // returns the datapoint element of a dapapoint string getElementChannel(string dp){ dyn_string out = strsplit(dp,\".\"); strreplace( dp,out[1]+\".\",\"\"); //DebugTN(\"element\", dp); return dp ; } //************************************************************************** // function to get the values from the table and to generate a recipe object dyn_dyn_mixed getValuesFromTable(){ dyn_mixed line; dyn_string dpes; dyn_mixed values; int n = 0; line = TABLE1.getLineN(n); //DebugTN(\"values\", values); while(dynlen(line)){ // appends all dpes and values in this function getSettingsForRecipe( line, dpes, values); ++n; line = TABLE1.getLineN(n); } dyn_dyn_mixed recipeObject; dyn_string exceptionInfo; bool checkExists=TRUE; dynClear(recipeObject); fwConfigurationDB_makeRecipe(dpes, values, recipeObject,exceptionInfo, checkExists); if (dynlen(exceptionInfo)) {fwExceptionHandling_display(exceptionInfo);return;}; return recipeObject; } //********************************************************************* // to get the datapoint elements of a line in the table getSettingsForRecipe(dyn_mixed line, dyn_string &dpes, dyn_mixed &values){ string dataPoint= line[1]; dyn_string winerElements = getElements(); for ( int n = 1 ; n < dynlen(line); ++n){ //dist_18:Wiener/WienerPower0/Channel00.Settings.OnOffChannel string dpElement = dataPoint + \".\"+ winerElements[n]; dynAppend( dpes, dpElement); dynAppend( values, line[n+1]); } } " 0 2 "CBRef" "1" "EClose" E "" DISPLAY_LAYER, 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 LAYER, 0 1 LANG:1 0 25 0 "TABLE1" "" 1 20 110 E E E 1 E 1 E N "_WindowText" E N "_Window" E E E E 0 0 0 0 0 0 E E E 0 1 LANG:1 0 0 1 LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg 0 "" 18 108 922 542 "main() { dyn_string elements =getHeaders(); this.columnHeader( 0, \"Channel\"); for (int col = 1 ; col <= dynlen (elements); ++col){ this.columnHeader( col , elements[col]); } }" 0 E 1 0 1 11 0 "#1" 32 1 1 "s" 1 LANG:1 6 Device E 1 LANG:1 0 304 "#2" 6 1 1 "s" 1 LANG:1 2 #2 E 1 LANG:1 0 64 "#3" 6 1 1 "s" 1 LANG:1 2 #3 E 1 LANG:1 0 64 "#4" 6 1 1 "s" 1 LANG:1 2 #4 E 1 LANG:1 0 64 "#5" 6 1 1 "s" 1 LANG:1 2 #5 E 1 LANG:1 0 64 "#6" 6 1 1 "s" 1 LANG:1 2 #6 E 1 LANG:1 0 64 "#7" 6 1 1 "s" 1 LANG:1 2 #7 E 1 LANG:1 0 64 "#8" 6 1 1 "s" 1 LANG:1 2 #8 E 1 LANG:1 0 64 "#9" 6 1 1 "s" 1 LANG:1 2 #9 E 1 LANG:1 0 64 "#10" 6 1 1 "s" 1 LANG:1 3 #10 E 1 LANG:1 0 64 "#11" 6 1 1 "s" 1 LANG:1 3 #11 E 1 LANG:1 0 64 14 14 10 10 1 LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg 0 "" 0 1 1 1 7 1 0 13 1 "SaveRecipe" "" 1 690 580 E E E 1 E 1 E N "_ButtonText" E N "_Button" E E E E 1 0 0 0 0 0 E E E 0 1 LANG:1 0 0 1 LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg 0 "" 688 578 802 622 T 1 LANG:1 4 Save "main() { dyn_string exceptionInfo; dyn_dyn_mixed recipeObject = getValuesFromTable(); // string hierarchy =fwDevice_HARDWARE; // string hierarchy =fwDevice_LOGICAL; fwConfigurationDB_storeRecipeInCache( recipeObject,LoadRecipeName.text ,\"\",exceptionInfo); if (dynlen(exceptionInfo)) {fwExceptionHandling_display(exceptionInfo);return;}; // DebugTN( dpes); // // DebugTN( values); }" 0 E E E 13 2 "LoadRecipe" "" 1 580 580 E E E 1 E 1 E N "_ButtonText" E N "_Button" E E E E 3 0 0 0 0 0 E E E 0 1 LANG:1 0 0 1 LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg 0 "" 578 578 692 622 T 1 LANG:1 4 Load "main() { if (strlen(LoadRecipeName.text)){ getValuesForTable(LoadRecipeName.text); } } " 0 E E E 22 4 "LoadRecipeName" "" 1 22 72 E E E 1 E 1 E N "_WindowText" E N "_Window" E E E E 5 0 0 0 0 0 E E E 0 1 LANG:1 0 0 1 LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg 0 "" 20 70 284 104 0 "main() { dyn_string recipeNames; dyn_string exceptionInfo; fwConfigurationDB_getRecipesInCache( recipeNames, exceptionInfo); if (dynlen(exceptionInfo)) {fwExceptionHandling_display(exceptionInfo);return;}; this.items = recipeNames; this.selectedPos=1; }" 0 E E 1 0 2 5 "PRIMITIVE_TEXT1" "" 1 40 10 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E E E 6 0 0 0 0 0 E E E 0 1 LANG:1 0 1 "dashclr"N "_Transparent" E E 0 1 1 2 1 E U 1 E 22 52 352 82 0 2 2 "0s" 0 0 0 64 0 0 22 52 1 1 LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg 0 "" 1 LANG:1 17 Available Recipes 13 7 "SaveAs" "" 1 800 580 E E E 1 E 1 E N "_ButtonText" E N "_Button" E E E E 9 0 0 0 0 0 E E E 0 1 LANG:1 0 0 1 LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg 0 "" 798 578 912 622 T 1 LANG:1 7 Save As "main() { dyn_float df; dyn_string ds; // call this panel to get the name of the new recipe ChildPanelOnCentralModalReturn( \"ask_text.pnl\", \"insert text\", makeDynString(\"$lable: insert new recipe name\" ), df, ds); dyn_string exceptionInfo; // generates the recipe object from the table dyn_dyn_mixed recipeObject = getValuesFromTable(); // if de name is defined saves the new recipe if(dynlen(ds) ) fwConfigurationDB_storeRecipeInCache( recipeObject,ds[1] ,\"\",exceptionInfo); // updates the recipe list combo box if (dynlen(exceptionInfo)) {fwExceptionHandling_display(exceptionInfo);return;}; LoadRecipeName.text= ds[1]; dyn_string recipeNames; fwConfigurationDB_getRecipesInCache( recipeNames, exceptionInfo); if (dynlen(exceptionInfo)) {fwExceptionHandling_display(exceptionInfo);return;}; LoadRecipeName.items = recipeNames; // fwGeneral_openDetailsPanel(\"dist_18:Wiener/WienerPower0/Channel00\", exceptionInfo); }" 0 E E E 13 8 "advancePanel" "" 1 470 580 E E E 1 E 1 E N "_ButtonText" E N "_Button" E E E E 11 0 0 0 0 0 E E E 0 1 LANG:1 0 0 1 LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg 0 "" 468 578 582 622 T 1 LANG:1 24 Framework Advance Panel "main() { string panel = \"fwConfigurationDB/fwConfigurationDB_RecipeAdvanced.pnl\"; ChildPanelOnCentral( panel, panel, makeDynString()); } " 0 E E E 0 LAYER, 1 1 LANG:1 0 0 LAYER, 2 1 LANG:1 0 0 LAYER, 3 1 LANG:1 0 0 LAYER, 4 1 LANG:1 0 0 LAYER, 5 1 LANG:1 0 0 LAYER, 6 1 LANG:1 0 0 LAYER, 7 1 LANG:1 0 0 0