@@ -957,6 +957,162 @@ static Function TestPlotting()
957957 CHECK_EQUAL_WAVES ( wvWin2 Y0, wvY5 )
958958End
959959
960+ static Function TestPlottingWithTablesSubWindows ()
961+
962+ string win, winBaseTable
963+
964+ string sweepBrowser = CreateFakeSweepBrowser_IGNORE ()
965+ DFREF dfr = BSP_GetFolder ( sweepBrowser, MIES_BSP_PANEL_FOLDER)
966+ string winBase = MIES_SF#SF_GetFormulaWinNameTemplate ( sweepBrowser)
967+
968+ string strSimpleTable = "table(1)"
969+ string strSimpleTableWithTable = "table(1)\r with\r table(2)"
970+ string strSimpleTableWithPlot = "table(1)\r with\r 2"
971+ string strSimpleTableVsX = "table(1) vs 2"
972+ string strSimpleTableAndTable = "table(1)\r and\r table(2)"
973+ string strSimpleTableAndPlot = "table(1)\r and\r 2"
974+ string strSimpleTableDataset = "table(dataset(1,2))"
975+
976+ winBaseTable = winBase + "table"
977+
978+ MIES_SF#SF_FormulaPlotter ( sweepBrowser, strSimpleTable)
979+ CHECK_EQUAL_VAR ( WindowExists ( winBaseTable) , 1 )
980+ CHECK_EQUAL_VAR ( WindowExists ( winBaseTable + "#Table0" ) , 1 )
981+ CHECK_EQUAL_VAR ( WindowExists ( winBaseTable + "#Table1" ) , 0 )
982+ CHECK_EQUAL_VAR ( WindowExists ( winBase) , 0 )
983+ WAVE wv = WaveRefIndexed ( winBaseTable + "#Table0" , 0, 3 ) // dimlabel column
984+ CHECK_EQUAL_WAVES ( wv, {{ 1 }} , mode = WAVE_DATA)
985+ WAVE wv = WaveRefIndexed ( winBaseTable + "#Table0" , 1, 3 ) // data column
986+ CHECK_EQUAL_WAVES ( wv, {{ 1 }} , mode = WAVE_DATA)
987+ WAVE /Z wv = WaveRefIndexed ( winBaseTable + "#Table0" , 2, 3 )
988+ CHECK_WAVE ( wv, NULL_WAVE)
989+
990+ MIES_SF#SF_FormulaPlotter ( sweepBrowser, strSimpleTableWithTable)
991+ CHECK_EQUAL_VAR ( WindowExists ( winBaseTable) , 1 )
992+ CHECK_EQUAL_VAR ( WindowExists ( winBaseTable + "#Table0" ) , 1 )
993+ CHECK_EQUAL_VAR ( WindowExists ( winBaseTable + "#Table1" ) , 0 )
994+ CHECK_EQUAL_VAR ( WindowExists ( winBase) , 0 )
995+ WAVE wv = WaveRefIndexed ( winBaseTable + "#Table0" , 0, 3 ) // dimlabel column first table
996+ CHECK_EQUAL_WAVES ( wv, {{ 1 }} , mode = WAVE_DATA)
997+ WAVE wv = WaveRefIndexed ( winBaseTable + "#Table0" , 1, 3 ) // data column first table
998+ CHECK_EQUAL_WAVES ( wv, {{ 1 }} , mode = WAVE_DATA)
999+ WAVE wv = WaveRefIndexed ( winBaseTable + "#Table0" , 2, 3 ) // dimlabel column second table
1000+ CHECK_EQUAL_WAVES ( wv, {{ 2 }} , mode = WAVE_DATA)
1001+ WAVE wv = WaveRefIndexed ( winBaseTable + "#Table0" , 3, 3 ) // data column second table
1002+ CHECK_EQUAL_WAVES ( wv, {{ 2 }} , mode = WAVE_DATA)
1003+ WAVE /Z wv = WaveRefIndexed ( winBaseTable + "#Table0" , 4, 3 )
1004+ CHECK_WAVE ( wv, NULL_WAVE)
1005+
1006+ MIES_SF#SF_FormulaPlotter ( sweepBrowser, strSimpleTableWithPlot)
1007+ CHECK_EQUAL_VAR ( WindowExists ( winBaseTable) , 1 )
1008+ CHECK_EQUAL_VAR ( WindowExists ( winBaseTable + "#Table0" ) , 1 )
1009+ CHECK_EQUAL_VAR ( WindowExists ( winBaseTable + "#Table1" ) , 0 )
1010+ CHECK_EQUAL_VAR ( WindowExists ( winBase) , 1 )
1011+ CHECK_EQUAL_VAR ( WindowExists ( winBase + "#Graph0" ) , 1 )
1012+ CHECK_EQUAL_VAR ( WindowExists ( winBase + "#Graph1" ) , 0 )
1013+
1014+ MIES_SF#SF_FormulaPlotter ( sweepBrowser, strSimpleTableVsX)
1015+ CHECK_EQUAL_VAR ( WindowExists ( winBaseTable) , 1 )
1016+ CHECK_EQUAL_VAR ( WindowExists ( winBaseTable + "#Table0" ) , 1 )
1017+ CHECK_EQUAL_VAR ( WindowExists ( winBaseTable + "#Table1" ) , 0 )
1018+ CHECK_EQUAL_VAR ( WindowExists ( winBase) , 0 )
1019+
1020+ MIES_SF#SF_FormulaPlotter ( sweepBrowser, strSimpleTableAndTable)
1021+ CHECK_EQUAL_VAR ( WindowExists ( winBaseTable) , 1 )
1022+ CHECK_EQUAL_VAR ( WindowExists ( winBaseTable + "#Table0" ) , 1 )
1023+ CHECK_EQUAL_VAR ( WindowExists ( winBaseTable + "#Table1" ) , 1 )
1024+ CHECK_EQUAL_VAR ( WindowExists ( winBaseTable + "#Table2" ) , 0 )
1025+ CHECK_EQUAL_VAR ( WindowExists ( winBase) , 0 )
1026+ WAVE wv = WaveRefIndexed ( winBaseTable + "#Table0" , 0, 3 ) // dimlabel column
1027+ CHECK_EQUAL_WAVES ( wv, {{ 1 }} , mode = WAVE_DATA)
1028+ WAVE wv = WaveRefIndexed ( winBaseTable + "#Table0" , 1, 3 ) // data column
1029+ CHECK_EQUAL_WAVES ( wv, {{ 1 }} , mode = WAVE_DATA)
1030+ WAVE /Z wv = WaveRefIndexed ( winBaseTable + "#Table0" , 2, 3 )
1031+ CHECK_WAVE ( wv, NULL_WAVE)
1032+ WAVE wv = WaveRefIndexed ( winBaseTable + "#Table1" , 0, 3 ) // dimlabel column
1033+ CHECK_EQUAL_WAVES ( wv, {{ 2 }} , mode = WAVE_DATA)
1034+ WAVE wv = WaveRefIndexed ( winBaseTable + "#Table1" , 1, 3 ) // data column
1035+ CHECK_EQUAL_WAVES ( wv, {{ 2 }} , mode = WAVE_DATA)
1036+ WAVE /Z wv = WaveRefIndexed ( winBaseTable + "#Table1" , 2, 3 )
1037+ CHECK_WAVE ( wv, NULL_WAVE)
1038+
1039+ MIES_SF#SF_FormulaPlotter ( sweepBrowser, strSimpleTableAndPlot)
1040+ CHECK_EQUAL_VAR ( WindowExists ( winBaseTable) , 1 )
1041+ CHECK_EQUAL_VAR ( WindowExists ( winBaseTable + "#Table0" ) , 1 )
1042+ CHECK_EQUAL_VAR ( WindowExists ( winBaseTable + "#Table1" ) , 0 )
1043+ CHECK_EQUAL_VAR ( WindowExists ( winBase) , 1 )
1044+ CHECK_EQUAL_VAR ( WindowExists ( winBase + "#Graph0" ) , 0 )
1045+ CHECK_EQUAL_VAR ( WindowExists ( winBase + "#Graph1" ) , 1 )
1046+ CHECK_EQUAL_VAR ( WindowExists ( winBase + "#Graph2" ) , 0 )
1047+
1048+ MIES_SF#SF_FormulaPlotter ( sweepBrowser, strSimpleTableDataset)
1049+ WAVE wv = WaveRefIndexed ( winBaseTable + "#Table0" , 0, 3 ) // dimlabel column
1050+ CHECK_EQUAL_WAVES ( wv, {{ 1 }} , mode = WAVE_DATA)
1051+ WAVE wv = WaveRefIndexed ( winBaseTable + "#Table0" , 1, 3 ) // data column
1052+ CHECK_EQUAL_WAVES ( wv, {{ 1 }} , mode = WAVE_DATA)
1053+ WAVE wv = WaveRefIndexed ( winBaseTable + "#Table0" , 2, 3 ) // dimlabel column
1054+ CHECK_EQUAL_WAVES ( wv, {{ 2 }} , mode = WAVE_DATA)
1055+ WAVE wv = WaveRefIndexed ( winBaseTable + "#Table0" , 3, 3 ) // data column
1056+ CHECK_EQUAL_WAVES ( wv, {{ 2 }} , mode = WAVE_DATA)
1057+ WAVE /Z wv = WaveRefIndexed ( winBaseTable + "#Table0" , 4, 3 )
1058+ CHECK_WAVE ( wv, NULL_WAVE)
1059+ End
1060+
1061+ static Function TestPlottingWithTablesNormal ()
1062+
1063+ string win, winBaseTable
1064+
1065+ string sweepBrowser = CreateFakeSweepBrowser_IGNORE ()
1066+ DFREF dfr = BSP_GetFolder ( sweepBrowser, MIES_BSP_PANEL_FOLDER)
1067+ string winBase = MIES_SF#SF_GetFormulaWinNameTemplate ( sweepBrowser)
1068+
1069+ string strSimpleTable = "table(1)"
1070+ string strSimpleTableWithTable = "table(1)\r with\r table(2)"
1071+ string strSimpleTableWithPlot = "table(1)\r with\r 2"
1072+ string strSimpleTableVsX = "table(1) vs 2"
1073+ string strSimpleTableAndTable = "table(1)\r and\r table(2)"
1074+ string strSimpleTableAndPlot = "table(1)\r and\r 2"
1075+
1076+ winBaseTable = winBase + "table"
1077+
1078+ MIES_SF#SF_FormulaPlotter ( sweepBrowser, strSimpleTable, dmMode = SF_DM_NORMAL)
1079+ CHECK_EQUAL_VAR ( WindowExists ( winBaseTable) , 0 )
1080+ CHECK_EQUAL_VAR ( WindowExists ( winBase) , 0 )
1081+
1082+ CHECK_EQUAL_VAR ( WindowExists ( winBaseTable + "0" ) , 1 )
1083+ CHECK_EQUAL_VAR ( WindowExists ( winBaseTable + "1" ) , 0 )
1084+ CHECK_EQUAL_VAR ( WindowExists ( winBase + "0" ) , 0 )
1085+
1086+ MIES_SF#SF_FormulaPlotter ( sweepBrowser, strSimpleTableWithTable, dmMode = SF_DM_NORMAL)
1087+ CHECK_EQUAL_VAR ( WindowExists ( winBaseTable + "0" ) , 1 )
1088+ CHECK_EQUAL_VAR ( WindowExists ( winBaseTable + "1" ) , 0 )
1089+ CHECK_EQUAL_VAR ( WindowExists ( winBase + "0" ) , 0 )
1090+
1091+ MIES_SF#SF_FormulaPlotter ( sweepBrowser, strSimpleTableWithPlot, dmMode = SF_DM_NORMAL)
1092+ CHECK_EQUAL_VAR ( WindowExists ( winBaseTable + "0" ) , 1 )
1093+ CHECK_EQUAL_VAR ( WindowExists ( winBaseTable + "1" ) , 0 )
1094+ CHECK_EQUAL_VAR ( WindowExists ( winBase + "0" ) , 1 )
1095+ CHECK_EQUAL_VAR ( WindowExists ( winBase + "1" ) , 0 )
1096+
1097+ MIES_SF#SF_FormulaPlotter ( sweepBrowser, strSimpleTableVsX, dmMode = SF_DM_NORMAL)
1098+ CHECK_EQUAL_VAR ( WindowExists ( winBaseTable + "0" ) , 1 )
1099+ CHECK_EQUAL_VAR ( WindowExists ( winBaseTable + "1" ) , 0 )
1100+ CHECK_EQUAL_VAR ( WindowExists ( winBase + "1" ) , 0 )
1101+
1102+ MIES_SF#SF_FormulaPlotter ( sweepBrowser, strSimpleTableAndTable, dmMode = SF_DM_NORMAL)
1103+ CHECK_EQUAL_VAR ( WindowExists ( winBaseTable + "0" ) , 1 )
1104+ CHECK_EQUAL_VAR ( WindowExists ( winBaseTable + "1" ) , 1 )
1105+ CHECK_EQUAL_VAR ( WindowExists ( winBaseTable + "2" ) , 0 )
1106+ CHECK_EQUAL_VAR ( WindowExists ( winBase + "0" ) , 0 )
1107+
1108+ MIES_SF#SF_FormulaPlotter ( sweepBrowser, strSimpleTableAndPlot, dmMode = SF_DM_NORMAL)
1109+ CHECK_EQUAL_VAR ( WindowExists ( winBaseTable + "0" ) , 1 )
1110+ CHECK_EQUAL_VAR ( WindowExists ( winBaseTable + "1" ) , 0 )
1111+ CHECK_EQUAL_VAR ( WindowExists ( winBase + "0" ) , 0 )
1112+ CHECK_EQUAL_VAR ( WindowExists ( winBase + "1" ) , 1 )
1113+ CHECK_EQUAL_VAR ( WindowExists ( winBase + "2" ) , 0 )
1114+ End
1115+
9601116static Function TestSFPreprocessor ()
9611117
9621118 string input, output
0 commit comments