1713 {
1714 PMXML_NODE
pn, pr, pt, pe;
1715 char odbpath[256],
data[256],
str[1024],
name[32], op[32];
1718 int i,
j, l,
n,
status, size, index1, index2,
state,
run_number, cont;
1723
1726 return;
1727 }
1728
1729 if (
c->pnseq == NULL) {
1731 mstrlcpy(seq.
error,
"No script loaded",
sizeof(seq.
error));
1734 return;
1735 }
1736
1738 if (!hKeySeq)
1739 return;
1740
1741
1745
1746 pr = mxml_find_node(
c->pnseq,
"RunSequence");
1747 if (!pr) {
1748 seq_error(seq,
c,
"Cannot find <RunSequence> tag in XML file");
1749 return;
1750 }
1751
1752 int last_line = mxml_get_line_number_end(pr);
1753
1754
1758
1760
1762 cm_msg(
MTALK,
"sequencer",
"Sequencer is finished.");
1763
1765 return;
1766 }
1767
1774 return;
1775 }
1776
1777
1779
1782 cm_msg(
MTALK,
"sequencer",
"Sequencer is finished.");
1783
1785 }
1786 return;
1787 }
1788
1789
1792 break;
1795 size = sizeof(seq);
1797
1806 } else {
1808 if (mxml_get_attribute(
pn,
"var")) {
1809 mstrlcpy(
name, mxml_get_attribute(
pn,
"var"),
sizeof(
name));
1810 if (mxml_get_attribute(
pn,
"values")) {
1811 mstrlcpy(
data, mxml_get_attribute(
pn,
"values"),
sizeof(
data));
1814 }
else if (mxml_get_attribute(
pn,
"n")) {
1816 }
1817 sprintf(
str,
"Variables/%s",
name);
1818 size =
value.length() + 1;
1819 if (size < 32)
1820 size = 32;
1822 }
1825 }
1827 return;
1828 }
1829 }
1830
1831
1833 size = sizeof(seq);
1841 return;
1842 }
1843
1844
1846 size = sizeof(seq);
1852 return;
1853 }
1854
1855
1858 size = sizeof(seq);
1862 return;
1863 }
1864
1865
1869 if (mxml_get_attribute(
pn,
"l"))
1871 if (mxml_get_attribute(
pn,
"fn")) {
1872 std::string filename = mxml_get_attribute(
pn,
"fn");
1873
1874
1875 if (filename != std::string(seq.
sfilename)) {
1878 }
1879 }
1880 } else {
1881 if (mxml_get_attribute(
pn,
"l") && (!mxml_get_attribute(
pn,
"lvl") || atoi(mxml_get_attribute(
pn,
"lvl")) == 0))
1883 }
1884 }
1885
1886
1887
1888#if 0
1890 midas::odb o(
"/" +
c->odb_path +
"/Script/Lines");
1893 }
1894#endif
1895
1898
1901 }
1902
1903
1905 if (!mxml_get_attribute(
pn,
"path")) {
1906 seq_error(seq,
c,
"Missing attribute \"path\"");
1907 } else {
1908
1909 std::string s = mxml_get_attribute(
pn,
"path");
1910 if (s.find('$') != std::string::npos)
1912
1914 if (mxml_get_attribute(
pn,
"notify"))
1918 }
1919 }
1920
1921
1923 if (!mxml_get_attribute(
pn,
"path")) {
1924 seq_error(seq,
c,
"Missing attribute \"path\"");
1925 } else {
1926 mstrlcpy(odbpath, seq.
subdir,
sizeof(odbpath));
1927 if (strlen(odbpath) > 0 && odbpath[strlen(odbpath) - 1] != '/')
1928 mstrlcat(odbpath, "/", sizeof(odbpath));
1929 mstrlcat(odbpath, mxml_get_attribute(
pn,
"path"),
sizeof(odbpath));
1930
1931 if (strchr(odbpath, '$')) {
1932 if (strchr(odbpath, '[')) {
1933
1934 std::string s(odbpath);
1935 std::string s1 = s.substr(0, s.find('['));
1936 std::string s2 = s.substr(s.find('['));
1938 s1 += s2;
1939 mstrlcpy(odbpath, s1.c_str(), sizeof(odbpath));
1940 } else {
1941
1942 std::string s(odbpath);
1944 mstrlcpy(odbpath, s.c_str(), sizeof(odbpath));
1945 }
1946 }
1947
1951 if (mxml_get_attribute(
pn,
"notify"))
1952 notify = atoi(mxml_get_attribute(
pn,
"notify"));
1953
1954 index1 = index2 = 0;
1956
1957 if (index1 < -1 || index2 < 0) {
1958 seq_error(seq,
c,
"Negative index not allowed");
1959 return;
1960 }
1961
1962 if (index1 > 1E6 || index2 > 1E6) {
1963 seq_error(seq,
c,
"Index too large for ODB");
1964 return;
1965 }
1966
1968
1970
1972 size = sizeof(seq);
1976 sprintf(
str,
"ODB key \"%s\" not found", odbpath);
1979 sprintf(
str,
"Invalid index %d for ODB key \"%s\"", index1, odbpath);
1981 } else {
1982
1983 sprintf(
str,
"Internal error %d",
status);
1985 return;
1986 }
1987 }
1988 }
1989
1990
1992 if (mxml_get_value(
pn)[0] ==
'/') {
1993
1994
1996 path += "userfiles/sequencer/";
1998 value += std::string(mxml_get_value(
pn)+1);
1999 } else {
2000
2002 path += "userfiles/sequencer/";
2005 if (
value.back() !=
'/')
2008 }
2009
2010 if (
value.find(
'$') != std::string::npos)
2012
2013
2014 if (mxml_get_attribute(
pn,
"path")) {
2015 mstrlcpy(odbpath, seq.
subdir,
sizeof(odbpath));
2016 if (strlen(odbpath) > 0 && odbpath[strlen(odbpath) - 1] != '/')
2017 mstrlcat(odbpath, "/", sizeof(odbpath));
2018 mstrlcat(odbpath, mxml_get_attribute(
pn,
"path"),
sizeof(odbpath));
2019
2020 if (strchr(odbpath, '$')) {
2021 std::string s(odbpath);
2023 mstrlcpy(odbpath, s.c_str(), sizeof(odbpath));
2024 }
2025
2026
2030 return;
2031 } else {
2033 }
2034 } else {
2035
2037 }
2038
2040 size = sizeof(seq);
2045 } else {
2046
2047 seq_error(seq,
c,
"Internal error loading ODB file!");
2048 return;
2049 }
2050 }
2051
2052
2054 if (mxml_get_value(
pn)[0] ==
'/') {
2055
2056
2058 path += "userfiles/sequencer/";
2060 value += std::string(mxml_get_value(
pn)+1);
2061 } else {
2062
2064 path += "userfiles/sequencer/";
2068 size_t pos =
value.find_last_of(
'/');
2069 if (pos != std::string::npos)
2072 }
2073
2074 if (
value.find(
'$') != std::string::npos)
2076
2077
2078 if (mxml_get_attribute(
pn,
"path") && *mxml_get_attribute(
pn,
"path")) {
2079 mstrlcpy(odbpath, seq.
subdir,
sizeof(odbpath));
2080 if (strlen(odbpath) > 0 && odbpath[strlen(odbpath) - 1] != '/')
2081 mstrlcat(odbpath, "/", sizeof(odbpath));
2082 mstrlcat(odbpath, mxml_get_attribute(
pn,
"path"),
sizeof(odbpath));
2083
2084 if (strchr(odbpath, '$')) {
2085 std::string s(odbpath);
2087 mstrlcpy(odbpath, s.c_str(), sizeof(odbpath));
2088 }
2089
2090
2094 return;
2095 } else {
2096 if (strstr(
value.c_str(),
".json") || strstr(
value.c_str(),
".JSON") || strstr(
value.c_str(),
".js") || strstr(
value.c_str(),
".JS"))
2098 else if (strstr(
value.c_str(),
".xml") || strstr(
value.c_str(),
".XML"))
2100 else
2104 return;
2105 }
2106 }
2107 } else {
2108 seq_error(seq,
c,
"No ODB path specified in ODBSAVE command");
2109 return;
2110 }
2111
2113 size = sizeof(seq);
2118 } else {
2119
2120 seq_error(seq,
c,
"Internal error loading ODB file!");
2121 return;
2122 }
2123 }
2124
2125
2127 if (!mxml_get_attribute(
pn,
"path")) {
2128 seq_error(seq,
c,
"Missing attribute \"path\"");
2129 } else {
2130 mstrlcpy(odbpath, seq.
subdir,
sizeof(odbpath));
2131 if (strlen(odbpath) > 0 && odbpath[strlen(odbpath) - 1] != '/')
2132 mstrlcat(odbpath, "/", sizeof(odbpath));
2133 mstrlcat(odbpath, mxml_get_attribute(
pn,
"path"),
sizeof(odbpath));
2134
2135 if (strchr(odbpath, '$')) {
2136 if (strchr(odbpath, '[')) {
2137
2138 std::string s(odbpath);
2139 std::string s1 = s.substr(0, s.find('['));
2140 std::string s2 = s.substr(s.find('['));
2142 s1 += s2;
2143 mstrlcpy(odbpath, s1.c_str(), sizeof(odbpath));
2144 } else {
2145
2146 std::string s(odbpath);
2148 mstrlcpy(odbpath, s.c_str(), sizeof(odbpath));
2149 }
2150 }
2151
2152
2153 index1 = index2 = 0;
2155
2156 mstrlcpy(
name, mxml_get_value(
pn),
sizeof(
name));
2160 return;
2161 } else {
2163 size =
sizeof(
data);
2164
2167 value = *((
int *)
data) > 0 ?
"1" :
"0";
2168 else
2170
2171 sprintf(
str,
"Variables/%s",
name);
2172 size =
value.length() + 1;
2173 if (size < 32)
2174 size = 32;
2176
2177 size = sizeof(seq);
2180 }
2181 }
2182 }
2183
2184
2186 if (!mxml_get_attribute(
pn,
"path")) {
2187 seq_error(seq,
c,
"Missing attribute \"path\"");
2188 }
else if (!mxml_get_attribute(
pn,
"string")) {
2189 seq_error(seq,
c,
"Missing attribute \"string\"");
2190 } else {
2191 mstrlcpy(odbpath, seq.
subdir,
sizeof(odbpath));
2192 if (strlen(odbpath) > 0 && odbpath[strlen(odbpath) - 1] != '/')
2193 mstrlcat(odbpath, "/", sizeof(odbpath));
2194 mstrlcat(odbpath, mxml_get_attribute(
pn,
"path"),
sizeof(odbpath));
2195
2196 if (strchr(odbpath, '$')) {
2197 if (strchr(odbpath, '[')) {
2198
2199 std::string s(odbpath);
2200 std::string s1 = s.substr(0, s.find('['));
2201 std::string s2 = s.substr(s.find('['));
2203 s1 += s2;
2204 mstrlcpy(odbpath, s1.c_str(), sizeof(odbpath));
2205 } else {
2206
2207 std::string s(odbpath);
2209 mstrlcpy(odbpath, s.c_str(), sizeof(odbpath));
2210 }
2211 }
2212
2213 mstrlcpy(
name, mxml_get_value(
pn),
sizeof(
name));
2214
2215 auto s =
eval_var(seq,
c, mxml_get_attribute(
pn,
"string"));
2216 mstrlcpy(
str, s.c_str(),
sizeof(
str));
2217
2221 return;
2222 } else {
2224
2225
2227 size =
sizeof(
data);
2229 if (strcmp((
const char *)
data,
str) == 0)
2230 break;
2231 }
2232
2236 else {
2237 snprintf(
str,
sizeof(
str),
"\"ODBLOOKUP %s\" did not find string \"%s\"", odbpath, s.c_str());
2239 return;
2240 }
2241
2242 snprintf(
str,
sizeof(
str),
"Variables/%s",
name);
2243 size =
value.length() + 1;
2244 if (size < 32)
2245 size = 32;
2247
2248 size = sizeof(seq);
2251 }
2252 }
2253 }
2254
2255
2257 if (!mxml_get_attribute(
pn,
"path")) {
2258 seq_error(seq,
c,
"Missing attribute \"path\"");
2259 } else {
2260 mstrlcpy(odbpath, seq.
subdir,
sizeof(odbpath));
2261 if (strlen(odbpath) > 0 && odbpath[strlen(odbpath) - 1] != '/')
2262 mstrlcat(odbpath, "/", sizeof(odbpath));
2263 mstrlcat(odbpath, mxml_get_attribute(
pn,
"path"),
sizeof(odbpath));
2264
2265 if (strchr(odbpath, '$')) {
2266 if (strchr(odbpath, '[')) {
2267
2268 std::string s(odbpath);
2269 std::string s1 = s.substr(0, s.find('['));
2270 std::string s2 = s.substr(s.find('['));
2272 s1 += s2;
2273 mstrlcpy(odbpath, s1.c_str(), sizeof(odbpath));
2274 } else {
2275
2276 std::string s(odbpath);
2278 mstrlcpy(odbpath, s.c_str(), sizeof(odbpath));
2279 }
2280 }
2281
2282 index1 = index2 = 0;
2284
2286
2290 } else {
2292 size =
sizeof(
data);
2297 sprintf(
str,
"%lg",
d);
2298 size =
sizeof(
data);
2300
2304 if (mxml_get_attribute(
pn,
"notify"))
2305 notify = atoi(mxml_get_attribute(
pn,
"notify"));
2306
2309 }
2310 }
2311 }
2312
2313
2315 mstrlcpy(odbpath, seq.
subdir,
sizeof(odbpath));
2316 if (strlen(odbpath) > 0 && odbpath[strlen(odbpath) - 1] != '/')
2317 mstrlcat(odbpath, "/", sizeof(odbpath));
2318 mstrlcat(odbpath, mxml_get_value(
pn),
sizeof(odbpath));
2319
2320 if (strchr(odbpath, '$')) {
2321 std::string s(odbpath);
2323 mstrlcpy(odbpath, s.c_str(), sizeof(odbpath));
2324 }
2325
2329 } else {
2331 }
2332 }
2333
2334
2336 if (!mxml_get_attribute(
pn,
"path")) {
2337 seq_error(seq,
c,
"Missing attribute \"path\"");
2338 }
else if (!mxml_get_attribute(
pn,
"type")) {
2339 seq_error(seq,
c,
"Missing attribute \"type\"");
2340 } else {
2341 mstrlcpy(odbpath, seq.
subdir,
sizeof(odbpath));
2342 if (strlen(odbpath) > 0 && odbpath[strlen(odbpath) - 1] != '/')
2343 mstrlcat(odbpath, "/", sizeof(odbpath));
2344 mstrlcat(odbpath, mxml_get_attribute(
pn,
"path"),
sizeof(odbpath));
2345
2346 if (strchr(odbpath, '$')) {
2347 std::string s(odbpath);
2349 mstrlcpy(odbpath, s.c_str(), sizeof(odbpath));
2350 }
2351
2352
2353 unsigned int tid;
2354 for (tid = 0; tid <
TID_LAST; tid++) {
2356 break;
2357 }
2358
2360 seq_error(seq,
c,
"Type must be one of UINT8,INT8,UINT16,INT16,UINT32,INT32,BOOL,FLOAT,DOUBLE,STRING");
2361 else {
2362
2369 }
2370 } else {
2372 char dummy[32];
2373 memset(dummy, 0, sizeof(dummy));
2376 }
2377
2380 } else {
2382 if (mxml_get_attribute(
pn,
"size")) {
2383 i = atoi(
eval_var(seq,
c, mxml_get_attribute(
pn,
"size")).c_str());
2386 }
2388 }
2389 }
2390 }
2391 }
2392
2393
2397 }
2398
2399
2401 sprintf(
str,
"%s", mxml_get_value(
pn));
2402
2403 if (mxml_get_attribute(
pn,
"params")) {
2404 mstrlcpy(
data, mxml_get_attribute(
pn,
"params"),
sizeof(
data));
2406 for (
i = 0;
i <
n;
i++) {
2407
2409
2410 mstrlcat(
str,
" ",
sizeof(
str));
2412 }
2413 }
2414
2417 std::string r =
ss_execs(s.c_str());
2418
2419
2421
2423 }
2424
2425
2430 size =
sizeof(
state);
2438 }
2439 }
2440 } else {
2441
2442 size =
sizeof(
state);
2447 }
2448 }
2452 size =
sizeof(
state);
2457
2460 }
2461 }
2462 } else {
2463
2464 size =
sizeof(
state);
2467 size = sizeof(seq);
2469
2471
2474
2479 cm_msg(
MTALK,
"sequencer",
"Sequencer is finished by \"stop after current run\".");
2480 } else {
2481 cm_msg(
MTALK,
"sequencer",
"Sequencer is going to finish by \"stop after current run\". Executing ATEXIT.");
2482 }
2483 } else {
2485 }
2486
2488 }
2489 }
2490 } else {
2492 return;
2493 }
2494 }
2495
2496
2499 n = atoi(
eval_var(seq,
c, mxml_get_value(
pn)).c_str());
2515 }
2517 }
else if (
equal_ustring(mxml_get_attribute(
pn,
"for"),
"ODBValue")) {
2520 if (!mxml_get_attribute(
pn,
"path")) {
2521 seq_error(seq,
c,
"\"path\" must be given for ODB values");
2522 return;
2523 } else {
2524 mstrlcpy(odbpath, mxml_get_attribute(
pn,
"path"),
sizeof(odbpath));
2526
2527 if (strchr(odbpath, '$')) {
2528 if (strchr(odbpath, '[')) {
2529
2530 std::string s(odbpath);
2531 std::string s1 = s.substr(0, s.find('['));
2532 std::string s2 = s.substr(s.find('['));
2534 s1 += s2;
2535 mstrlcpy(odbpath, s1.c_str(), sizeof(odbpath));
2536 } else {
2537
2538 std::string s(odbpath);
2540 mstrlcpy(odbpath, s.c_str(), sizeof(odbpath));
2541 }
2542 }
2543
2544 index1 = index2 = 0;
2549 return;
2550 } else {
2551 if (mxml_get_attribute(
pn,
"op"))
2552 mstrlcpy(op, mxml_get_attribute(
pn,
"op"),
sizeof(op));
2553 else
2554 strcpy(op, "!=");
2556
2558 size =
sizeof(
data);
2561 value = *((
int *)
data) > 0 ?
"1" :
"0";
2562 else
2578 } else {
2580 return;
2581 }
2582
2583
2584
2585
2586
2587
2588 bool timed_out = false;
2589 const char *timeout_attr = mxml_get_attribute(
pn,
"timeout");
2590 if (timeout_attr && timeout_attr[0]) {
2591 float timeout_sec = (float) atof(
eval_var(seq,
c, timeout_attr).c_str());
2592 if (timeout_sec < 0) {
2593 seq_error(seq,
c,
msprintf(
"Invalid WAIT ODBValue timeout \"%s\"", timeout_attr).c_str());
2594 return;
2595 }
2596
2597
2600
2602
2607
2608 timed_out = elapsed_ms > (
DWORD) (1000.0f * timeout_sec);
2609 } else {
2612 }
2613
2614 if (cont || timed_out) {
2615 if (mxml_get_attribute(
pn,
"status")) {
2616 const char *status_value = (cont && !timed_out) ? "1" : "0";
2617
2618 mstrlcpy(
name, mxml_get_attribute(
pn,
"status"),
sizeof(
name));
2619 snprintf(
str,
sizeof(
str),
"Variables/%s",
name);
2620 size = strlen(status_value) + 1;
2621 if (size < 32)
2622 size = 32;
2624 }
2625
2626 if (timed_out && !cont) {
2627 cm_msg(
MINFO,
"sequencer",
"WAIT ODBValue timeout after %.1f seconds: %s %s %g not satisfied",
2629 }
2638 }
2639 }
2640 }
2649 } else {
2653 }
2663 }
2664 } else {
2665 seq_error(seq,
c,
msprintf(
"Invalid wait attribute \"%s\"", mxml_get_attribute(
pn,
"for")).c_str());
2666 }
2667
2668
2670 }
2671
2672
2676 break;
2678 seq_error(seq,
c,
"Maximum loop nesting exceeded");
2679 return;
2680 }
2683 if (mxml_get_attribute(
pn,
"l"))
2685 if (mxml_get_attribute(
pn,
"le"))
2688
2689 if (mxml_get_attribute(
pn,
"n")) {
2692 else {
2694 }
2696 }
else if (mxml_get_attribute(
pn,
"values")) {
2697 mstrlcpy(
data, mxml_get_attribute(
pn,
"values"),
sizeof(
data));
2700 } else {
2701 seq_error(seq,
c,
"Missing \"var\" or \"n\" attribute");
2702 return;
2703 }
2704
2705 if (mxml_get_attribute(
pn,
"var")) {
2706 mstrlcpy(
name, mxml_get_attribute(
pn,
"var"),
sizeof(
name));
2707 sprintf(
str,
"Variables/%s",
name);
2708 size =
value.length() + 1;
2709 if (size < 32)
2710 size = 32;
2712 }
2713
2715 }
2716
2717
2719
2720
2724 size = sizeof(seq);
2732 }
2733
2734
2737 break;
2739 seq_error(seq,
c,
"\"Break\" outside any loop");
2740 return;
2741 }
2742
2743
2746 }
2747
2748
2750
2752 seq_error(seq,
c,
"Maximum number of nested if..endif exceeded");
2753 return;
2754 }
2755
2756
2759
2760
2763 pe = mxml_get_node_at_line(
c->pnseq,
j);
2764
2765
2767 j = mxml_get_line_number_end(pe);
2768 continue;
2769 }
2770
2771
2774 break;
2775 }
2776 }
2777
2778 mstrlcpy(
str, mxml_get_attribute(
pn,
"condition"),
sizeof(
str));
2781 seq_error(seq,
c,
"Invalid number in comparison");
2782 return;
2783 }
2784
2789 else
2791
2793 }
2794
2795
2797
2800 return;
2801 }
2803 }
2804
2805
2808 cm_msg(
MTALK,
"sequencer",
"Sequencer is finished.");
2809 return;
2810 }
2811
2812
2814 if (!mxml_get_attribute(
pn,
"line") && !mxml_get_attribute(
pn,
"sline")) {
2816 return;
2817 }
2818 if (mxml_get_attribute(
pn,
"line")) {
2820 }
2821 if (mxml_get_attribute(
pn,
"sline")) {
2822 mstrlcpy(
str,
eval_var(seq,
c, mxml_get_attribute(
pn,
"sline")).c_str(),
sizeof(
str));
2823 for (
i = 0;
i < last_line;
i++) {
2824 pt = mxml_get_node_at_line(
c->pnseq,
i);
2825 if (pt && mxml_get_attribute(pt, "l")) {
2826 l = atoi(mxml_get_attribute(pt, "l"));
2827 if (atoi(
str) == l) {
2829 break;
2830 }
2831 }
2832 }
2833 }
2834 }
2835
2836
2838
2840 }
2841
2842
2844
2846 }
2847
2848
2850
2852 }
2853
2854
2856 if (!mxml_get_attribute(
pn,
"name")) {
2858 return;
2859 }
2860 mstrlcpy(
name, mxml_get_attribute(
pn,
"name"),
sizeof(
name));
2862
2863 if (strchr(
name,
'[')) {
2864
2865 mstrlcpy(
str, strchr(
name,
'[')+1,
sizeof(
str));
2866 if (strchr(
str,
']'))
2867 *strchr(
str,
']') = 0;
2869 *strchr(
name,
'[') = 0;
2870 sprintf(
str,
"Variables/%s",
name);
2875 }
2876 size =
value.length() + 1;
2877 if (size < 32)
2878 size = 32;
2880 } else {
2881 sprintf(
str,
"Variables/%s",
name);
2882 size =
value.length() + 1;
2883 if (size < 32)
2884 size = 32;
2886 }
2887
2888
2892 if (mxml_get_attribute(pr, "var")) {
2895 }
2896 }
2897
2899 }
2900
2901
2903 if (strchr(mxml_get_value(
pn),
'$'))
2905 else
2907 const char *wait_attr = mxml_get_attribute(
pn,
"wait");
2908 bool wait = false;
2909 if (wait_attr)
2910 wait = (atoi(wait_attr) == 1);
2911
2912 if (!wait) {
2913
2917 } else {
2918
2919
2920
2925
2926 return;
2927 } else {
2928
2929
2930
2932
2933 return;
2934 }
2935
2936
2938 }
2939 }
2940
2942 }
2943
2944
2946 if (strchr(mxml_get_value(
pn),
'$'))
2948 else
2950 std::string
type =
"INFO";
2951 if (mxml_get_attribute(
pn,
"type"))
2952 type = std::string(mxml_get_attribute(
pn,
"type"));
2953
2954 if (
type ==
"ERROR")
2956 else if (
type ==
"DEBUG")
2958 else if (
type ==
"LOG")
2960 else if (
type ==
"TALK")
2962 else
2964
2966 }
2967
2968
2970 if (!mxml_get_attribute(
pn,
"name")) {
2972 return;
2973 }
2974 mstrlcpy(
name, mxml_get_attribute(
pn,
"name"),
sizeof(
name));
2976 return;
2977 sprintf(
str,
"Variables/%s",
name);
2978 size = strlen(
data) + 1;
2979 if (size < 32)
2980 size = 32;
2982
2984 }
2985
2986
2989 seq_error(seq,
c,
"Maximum subroutine level exceeded");
2990 return;
2991 } else {
2992
2996
2997
2998 for (
i = 1;
i < mxml_get_line_number_end(mxml_find_node(
c->pnseq,
"RunSequence"));
i++) {
2999 pt = mxml_get_node_at_line(
c->pnseq,
i);
3000 if (pt) {
3002 if (
equal_ustring(mxml_get_attribute(pt,
"name"), mxml_get_attribute(
pn,
"name"))) {
3003
3005
3007
3008 if (mxml_get_value(
pn)) {
3009 char p[256];
3010 if (strchr(mxml_get_value(
pn),
'$'))
3011 mstrlcpy(p,
eval_var(seq,
c, mxml_get_value(
pn)).c_str(),
sizeof(p));
3012 else
3013 mstrlcpy(p, mxml_get_value(
pn),
sizeof(p));
3014
3016 }
3017
3019 break;
3020 }
3021 }
3022 }
3023 }
3024 if (
i == mxml_get_line_number_end(mxml_find_node(
c->pnseq,
"RunSequence"))) {
3025 seq_error(seq,
c,
msprintf(
"Subroutine '%s' not found", mxml_get_attribute(
pn,
"name")).c_str());
3026 }
3027 }
3028 }
3029
3030
3031 else {
3033 }
3034
3035
3037 size = sizeof(seq1);
3046
3047
3048 if (seq.
debug && !skip_step)
3050
3051
3053}
INT cm_transition(INT transition, INT run_number, char *errstr, INT errstr_size, INT async_flag, INT debug_flag)
#define CM_DEFERRED_TRANSITION
std::string ss_execs(const char *cmd)
std::string ss_replace_env_variables(const std::string &inputPath)
INT ss_sleep(INT millisec)
INT cm_msg_retrieve(INT n_message, char *message, INT buf_size)
INT db_get_data_index(HNDLE hDB, HNDLE hKey, void *data, INT *buf_size, INT idx, DWORD type)
INT db_delete_key(HNDLE hDB, HNDLE hKey, BOOL follow_links)
INT db_save_json(HNDLE hDB, HNDLE hKey, const char *filename, int flags)
INT db_save_xml(HNDLE hDB, HNDLE hKey, const char *filename)
INT db_create_key(HNDLE hDB, HNDLE hKey, const char *key_name, DWORD type)
INT db_get_record(HNDLE hDB, HNDLE hKey, void *data, INT *buf_size, INT align)
INT db_save(HNDLE hDB, HNDLE hKey, const char *filename, BOOL bRemote)
INT db_get_key(HNDLE hDB, HNDLE hKey, KEY *key)
INT db_load(HNDLE hDB, HNDLE hKeyRoot, const char *filename, BOOL bRemote)
INT db_set_data_index(HNDLE hDB, HNDLE hKey, const void *data, INT data_size, INT idx, DWORD type)
INT db_delete(HNDLE hDB, HNDLE hKeyRoot, const char *odb_path)
INT db_sprintf(char *string, const void *data, INT data_size, INT idx, DWORD type)
INT db_set_data_index1(HNDLE hDB, HNDLE hKey, const void *data, INT data_size, INT idx, DWORD type, BOOL bNotify)
INT db_sscanf(const char *data_str, void *data, INT *data_size, INT i, DWORD tid)
INT db_set_num_values(HNDLE hDB, HNDLE hKey, INT num_values)
const char * rpc_tid_name(INT id)
void seq_array_index(SEQUENCER &seq, SeqCon *c, char *odbpath, int *index1, int *index2)
int concatenate(SEQUENCER &seq, SeqCon *c, char *result, int size, char *value)
static void seq_start_next(SEQUENCER &seq, SeqCon *c)
int set_all_matching(HNDLE hDB, HNDLE hBaseKey, const char *odbpath, char *value, int index1, int index2, int notify)
int eval_condition(SEQUENCER &seq, SeqCon *c, const char *condition)
#define JSFLAG_FOLLOW_LINKS
#define JSFLAG_OMIT_LAST_WRITTEN
int if_line[SEQ_NEST_LEVEL_IF]
static void pn(const te_expr *n, int depth)