1570 {
1571 PMXML_NODE
pn, pr, pt, pe;
1572 char odbpath[256],
data[256],
str[1024],
name[32], op[32];
1575 int i,
j, l,
n,
status, size, index1, index2,
state,
run_number, cont;
1580
1583 return;
1584 }
1585
1586 if (
c->pnseq == NULL) {
1588 mstrlcpy(seq.
error,
"No script loaded",
sizeof(seq.
error));
1591 return;
1592 }
1593
1595 if (!hKeySeq)
1596 return;
1597
1598
1602
1603 pr = mxml_find_node(
c->pnseq,
"RunSequence");
1604 if (!pr) {
1605 seq_error(seq,
c,
"Cannot find <RunSequence> tag in XML file");
1606 return;
1607 }
1608
1609 int last_line = mxml_get_line_number_end(pr);
1610
1611
1615
1617
1619 cm_msg(
MTALK,
"sequencer",
"Sequencer is finished.");
1620
1622 return;
1623 }
1624
1631 return;
1632 }
1633
1634
1636
1639 cm_msg(
MTALK,
"sequencer",
"Sequencer is finished.");
1640
1642 }
1643 return;
1644 }
1645
1646
1649 break;
1652 size = sizeof(seq);
1654
1663 } else {
1665 if (mxml_get_attribute(
pn,
"var")) {
1666 mstrlcpy(
name, mxml_get_attribute(
pn,
"var"),
sizeof(
name));
1667 if (mxml_get_attribute(
pn,
"values")) {
1668 mstrlcpy(
data, mxml_get_attribute(
pn,
"values"),
sizeof(
data));
1671 }
else if (mxml_get_attribute(
pn,
"n")) {
1673 }
1674 sprintf(
str,
"Variables/%s",
name);
1675 size =
value.length() + 1;
1676 if (size < 32)
1677 size = 32;
1679 }
1682 }
1684 return;
1685 }
1686 }
1687
1688
1690 size = sizeof(seq);
1698 return;
1699 }
1700
1701
1703 size = sizeof(seq);
1709 return;
1710 }
1711
1712
1715 size = sizeof(seq);
1719 return;
1720 }
1721
1722
1726 if (mxml_get_attribute(
pn,
"l"))
1728 if (mxml_get_attribute(
pn,
"fn")) {
1729 std::string filename = mxml_get_attribute(
pn,
"fn");
1730
1731
1732 if (filename != std::string(seq.
sfilename)) {
1735 }
1736 }
1737 } else {
1738 if (mxml_get_attribute(
pn,
"l") && (!mxml_get_attribute(
pn,
"lvl") || atoi(mxml_get_attribute(
pn,
"lvl")) == 0))
1740 }
1741 }
1742
1743
1744
1745#if 0
1747 midas::odb o(
"/" +
c->odb_path +
"/Script/Lines");
1750 }
1751#endif
1752
1755
1758 }
1759
1760
1762 if (!mxml_get_attribute(
pn,
"path")) {
1763 seq_error(seq,
c,
"Missing attribute \"path\"");
1764 } else {
1765
1766 std::string s = mxml_get_attribute(
pn,
"path");
1767 if (s.find('$') != std::string::npos)
1769
1771 if (mxml_get_attribute(
pn,
"notify"))
1775 }
1776 }
1777
1778
1780 if (!mxml_get_attribute(
pn,
"path")) {
1781 seq_error(seq,
c,
"Missing attribute \"path\"");
1782 } else {
1783 mstrlcpy(odbpath, seq.
subdir,
sizeof(odbpath));
1784 if (strlen(odbpath) > 0 && odbpath[strlen(odbpath) - 1] != '/')
1785 mstrlcat(odbpath, "/", sizeof(odbpath));
1786 mstrlcat(odbpath, mxml_get_attribute(
pn,
"path"),
sizeof(odbpath));
1787
1788 if (strchr(odbpath, '$')) {
1789 if (strchr(odbpath, '[')) {
1790
1791 std::string s(odbpath);
1792 std::string s1 = s.substr(0, s.find('['));
1793 std::string s2 = s.substr(s.find('['));
1795 s1 += s2;
1796 mstrlcpy(odbpath, s1.c_str(), sizeof(odbpath));
1797 } else {
1798
1799 std::string s(odbpath);
1801 mstrlcpy(odbpath, s.c_str(), sizeof(odbpath));
1802 }
1803 }
1804
1808 if (mxml_get_attribute(
pn,
"notify"))
1809 notify = atoi(mxml_get_attribute(
pn,
"notify"));
1810
1811 index1 = index2 = 0;
1813
1814 if (index1 < -1 || index2 < 0) {
1815 seq_error(seq,
c,
"Negative index not allowed");
1816 return;
1817 }
1818
1819 if (index1 > 1E6 || index2 > 1E6) {
1820 seq_error(seq,
c,
"Index too large for ODB");
1821 return;
1822 }
1823
1825
1827
1829 size = sizeof(seq);
1833 sprintf(
str,
"ODB key \"%s\" not found", odbpath);
1836 sprintf(
str,
"Invalid index %d for ODB key \"%s\"", index1, odbpath);
1838 } else {
1839
1840 sprintf(
str,
"Internal error %d",
status);
1842 return;
1843 }
1844 }
1845 }
1846
1847
1849 if (mxml_get_value(
pn)[0] ==
'/') {
1850
1851
1853 path += "userfiles/sequencer/";
1855 value += std::string(mxml_get_value(
pn)+1);
1856 } else {
1857
1859 path += "userfiles/sequencer/";
1862 if (
value.back() !=
'/')
1865 }
1866
1867 if (
value.find(
'$') != std::string::npos)
1869
1870
1871 if (mxml_get_attribute(
pn,
"path")) {
1872 mstrlcpy(odbpath, seq.
subdir,
sizeof(odbpath));
1873 if (strlen(odbpath) > 0 && odbpath[strlen(odbpath) - 1] != '/')
1874 mstrlcat(odbpath, "/", sizeof(odbpath));
1875 mstrlcat(odbpath, mxml_get_attribute(
pn,
"path"),
sizeof(odbpath));
1876
1877 if (strchr(odbpath, '$')) {
1878 std::string s(odbpath);
1880 mstrlcpy(odbpath, s.c_str(), sizeof(odbpath));
1881 }
1882
1883
1887 return;
1888 } else {
1890 }
1891 } else {
1892
1894 }
1895
1897 size = sizeof(seq);
1902 } else {
1903
1904 seq_error(seq,
c,
"Internal error loading ODB file!");
1905 return;
1906 }
1907 }
1908
1909
1911 if (mxml_get_value(
pn)[0] ==
'/') {
1912
1913
1915 path += "userfiles/sequencer/";
1917 value += std::string(mxml_get_value(
pn)+1);
1918 } else {
1919
1921 path += "userfiles/sequencer/";
1925 size_t pos =
value.find_last_of(
'/');
1926 if (pos != std::string::npos)
1929 }
1930
1931 if (
value.find(
'$') != std::string::npos)
1933
1934
1935 if (mxml_get_attribute(
pn,
"path") && *mxml_get_attribute(
pn,
"path")) {
1936 mstrlcpy(odbpath, seq.
subdir,
sizeof(odbpath));
1937 if (strlen(odbpath) > 0 && odbpath[strlen(odbpath) - 1] != '/')
1938 mstrlcat(odbpath, "/", sizeof(odbpath));
1939 mstrlcat(odbpath, mxml_get_attribute(
pn,
"path"),
sizeof(odbpath));
1940
1941 if (strchr(odbpath, '$')) {
1942 std::string s(odbpath);
1944 mstrlcpy(odbpath, s.c_str(), sizeof(odbpath));
1945 }
1946
1947
1951 return;
1952 } else {
1953 if (strstr(
value.c_str(),
".json") || strstr(
value.c_str(),
".JSON") || strstr(
value.c_str(),
".js") || strstr(
value.c_str(),
".JS"))
1955 else if (strstr(
value.c_str(),
".xml") || strstr(
value.c_str(),
".XML"))
1957 else
1961 return;
1962 }
1963 }
1964 } else {
1965 seq_error(seq,
c,
"No ODB path specified in ODBSAVE command");
1966 return;
1967 }
1968
1970 size = sizeof(seq);
1975 } else {
1976
1977 seq_error(seq,
c,
"Internal error loading ODB file!");
1978 return;
1979 }
1980 }
1981
1982
1984 if (!mxml_get_attribute(
pn,
"path")) {
1985 seq_error(seq,
c,
"Missing attribute \"path\"");
1986 } else {
1987 mstrlcpy(odbpath, seq.
subdir,
sizeof(odbpath));
1988 if (strlen(odbpath) > 0 && odbpath[strlen(odbpath) - 1] != '/')
1989 mstrlcat(odbpath, "/", sizeof(odbpath));
1990 mstrlcat(odbpath, mxml_get_attribute(
pn,
"path"),
sizeof(odbpath));
1991
1992 if (strchr(odbpath, '$')) {
1993 if (strchr(odbpath, '[')) {
1994
1995 std::string s(odbpath);
1996 std::string s1 = s.substr(0, s.find('['));
1997 std::string s2 = s.substr(s.find('['));
1999 s1 += s2;
2000 mstrlcpy(odbpath, s1.c_str(), sizeof(odbpath));
2001 } else {
2002
2003 std::string s(odbpath);
2005 mstrlcpy(odbpath, s.c_str(), sizeof(odbpath));
2006 }
2007 }
2008
2009
2010 index1 = index2 = 0;
2012
2013 mstrlcpy(
name, mxml_get_value(
pn),
sizeof(
name));
2017 return;
2018 } else {
2020 size =
sizeof(
data);
2021
2024 value = *((
int *)
data) > 0 ?
"1" :
"0";
2025 else
2027
2028 sprintf(
str,
"Variables/%s",
name);
2029 size =
value.length() + 1;
2030 if (size < 32)
2031 size = 32;
2033
2034 size = sizeof(seq);
2037 }
2038 }
2039 }
2040
2041
2043 if (!mxml_get_attribute(
pn,
"path")) {
2044 seq_error(seq,
c,
"Missing attribute \"path\"");
2045 }
else if (!mxml_get_attribute(
pn,
"string")) {
2046 seq_error(seq,
c,
"Missing attribute \"string\"");
2047 } else {
2048 mstrlcpy(odbpath, seq.
subdir,
sizeof(odbpath));
2049 if (strlen(odbpath) > 0 && odbpath[strlen(odbpath) - 1] != '/')
2050 mstrlcat(odbpath, "/", sizeof(odbpath));
2051 mstrlcat(odbpath, mxml_get_attribute(
pn,
"path"),
sizeof(odbpath));
2052
2053 if (strchr(odbpath, '$')) {
2054 if (strchr(odbpath, '[')) {
2055
2056 std::string s(odbpath);
2057 std::string s1 = s.substr(0, s.find('['));
2058 std::string s2 = s.substr(s.find('['));
2060 s1 += s2;
2061 mstrlcpy(odbpath, s1.c_str(), sizeof(odbpath));
2062 } else {
2063
2064 std::string s(odbpath);
2066 mstrlcpy(odbpath, s.c_str(), sizeof(odbpath));
2067 }
2068 }
2069
2070 mstrlcpy(
name, mxml_get_value(
pn),
sizeof(
name));
2071
2072 auto s =
eval_var(seq,
c, mxml_get_attribute(
pn,
"string"));
2073 mstrlcpy(
str, s.c_str(),
sizeof(
str));
2074
2078 return;
2079 } else {
2081
2082
2084 size =
sizeof(
data);
2086 if (strcmp((
const char *)
data,
str) == 0)
2087 break;
2088 }
2089
2093 else {
2094 snprintf(
str,
sizeof(
str),
"\"ODBLOOKUP %s\" did not find string \"%s\"", odbpath, s.c_str());
2096 return;
2097 }
2098
2099 snprintf(
str,
sizeof(
str),
"Variables/%s",
name);
2100 size =
value.length() + 1;
2101 if (size < 32)
2102 size = 32;
2104
2105 size = sizeof(seq);
2108 }
2109 }
2110 }
2111
2112
2114 if (!mxml_get_attribute(
pn,
"path")) {
2115 seq_error(seq,
c,
"Missing attribute \"path\"");
2116 } else {
2117 mstrlcpy(odbpath, seq.
subdir,
sizeof(odbpath));
2118 if (strlen(odbpath) > 0 && odbpath[strlen(odbpath) - 1] != '/')
2119 mstrlcat(odbpath, "/", sizeof(odbpath));
2120 mstrlcat(odbpath, mxml_get_attribute(
pn,
"path"),
sizeof(odbpath));
2121
2122 if (strchr(odbpath, '$')) {
2123 if (strchr(odbpath, '[')) {
2124
2125 std::string s(odbpath);
2126 std::string s1 = s.substr(0, s.find('['));
2127 std::string s2 = s.substr(s.find('['));
2129 s1 += s2;
2130 mstrlcpy(odbpath, s1.c_str(), sizeof(odbpath));
2131 } else {
2132
2133 std::string s(odbpath);
2135 mstrlcpy(odbpath, s.c_str(), sizeof(odbpath));
2136 }
2137 }
2138
2139 index1 = index2 = 0;
2141
2143
2147 } else {
2149 size =
sizeof(
data);
2154 sprintf(
str,
"%lg",
d);
2155 size =
sizeof(
data);
2157
2161 if (mxml_get_attribute(
pn,
"notify"))
2162 notify = atoi(mxml_get_attribute(
pn,
"notify"));
2163
2166 }
2167 }
2168 }
2169
2170
2172 mstrlcpy(odbpath, seq.
subdir,
sizeof(odbpath));
2173 if (strlen(odbpath) > 0 && odbpath[strlen(odbpath) - 1] != '/')
2174 mstrlcat(odbpath, "/", sizeof(odbpath));
2175 mstrlcat(odbpath, mxml_get_value(
pn),
sizeof(odbpath));
2176
2177 if (strchr(odbpath, '$')) {
2178 std::string s(odbpath);
2180 mstrlcpy(odbpath, s.c_str(), sizeof(odbpath));
2181 }
2182
2186 } else {
2188 }
2189 }
2190
2191
2193 if (!mxml_get_attribute(
pn,
"path")) {
2194 seq_error(seq,
c,
"Missing attribute \"path\"");
2195 }
else if (!mxml_get_attribute(
pn,
"type")) {
2196 seq_error(seq,
c,
"Missing attribute \"type\"");
2197 } else {
2198 mstrlcpy(odbpath, seq.
subdir,
sizeof(odbpath));
2199 if (strlen(odbpath) > 0 && odbpath[strlen(odbpath) - 1] != '/')
2200 mstrlcat(odbpath, "/", sizeof(odbpath));
2201 mstrlcat(odbpath, mxml_get_attribute(
pn,
"path"),
sizeof(odbpath));
2202
2203 if (strchr(odbpath, '$')) {
2204 std::string s(odbpath);
2206 mstrlcpy(odbpath, s.c_str(), sizeof(odbpath));
2207 }
2208
2209
2210 unsigned int tid;
2211 for (tid = 0; tid <
TID_LAST; tid++) {
2213 break;
2214 }
2215
2217 seq_error(seq,
c,
"Type must be one of UINT8,INT8,UINT16,INT16,UINT32,INT32,BOOL,FLOAT,DOUBLE,STRING");
2218 else {
2219
2226 }
2227 } else {
2229 char dummy[32];
2230 memset(dummy, 0, sizeof(dummy));
2233 }
2234
2237 } else {
2239 if (mxml_get_attribute(
pn,
"size")) {
2240 i = atoi(
eval_var(seq,
c, mxml_get_attribute(
pn,
"size")).c_str());
2243 }
2245 }
2246 }
2247 }
2248 }
2249
2250
2254 }
2255
2256
2258 sprintf(
str,
"%s", mxml_get_value(
pn));
2259
2260 if (mxml_get_attribute(
pn,
"params")) {
2261 mstrlcpy(
data, mxml_get_attribute(
pn,
"params"),
sizeof(
data));
2263 for (
i = 0;
i <
n;
i++) {
2264
2266
2267 mstrlcat(
str,
" ",
sizeof(
str));
2269 }
2270 }
2271
2274 std::string r =
ss_execs(s.c_str());
2275
2276
2278
2280 }
2281
2282
2287 size =
sizeof(
state);
2295 }
2296 }
2297 } else {
2298
2299 size =
sizeof(
state);
2304 }
2305 }
2309 size =
sizeof(
state);
2314
2317 }
2318 }
2319 } else {
2320
2321 size =
sizeof(
state);
2324 size = sizeof(seq);
2326
2328
2331
2336 cm_msg(
MTALK,
"sequencer",
"Sequencer is finished by \"stop after current run\".");
2337 } else {
2338 cm_msg(
MTALK,
"sequencer",
"Sequencer is going to finish by \"stop after current run\". Executing ATEXIT.");
2339 }
2340 } else {
2342 }
2343
2345 }
2346 }
2347 } else {
2349 return;
2350 }
2351 }
2352
2353
2356 n = atoi(
eval_var(seq,
c, mxml_get_value(
pn)).c_str());
2372 }
2374 }
else if (
equal_ustring(mxml_get_attribute(
pn,
"for"),
"ODBValue")) {
2377 if (!mxml_get_attribute(
pn,
"path")) {
2378 seq_error(seq,
c,
"\"path\" must be given for ODB values");
2379 return;
2380 } else {
2381 mstrlcpy(odbpath, mxml_get_attribute(
pn,
"path"),
sizeof(odbpath));
2383
2384 if (strchr(odbpath, '$')) {
2385 if (strchr(odbpath, '[')) {
2386
2387 std::string s(odbpath);
2388 std::string s1 = s.substr(0, s.find('['));
2389 std::string s2 = s.substr(s.find('['));
2391 s1 += s2;
2392 mstrlcpy(odbpath, s1.c_str(), sizeof(odbpath));
2393 } else {
2394
2395 std::string s(odbpath);
2397 mstrlcpy(odbpath, s.c_str(), sizeof(odbpath));
2398 }
2399 }
2400
2401 index1 = index2 = 0;
2406 return;
2407 } else {
2408 if (mxml_get_attribute(
pn,
"op"))
2409 mstrlcpy(op, mxml_get_attribute(
pn,
"op"),
sizeof(op));
2410 else
2411 strcpy(op, "!=");
2413
2415 size =
sizeof(
data);
2418 value = *((
int *)
data) > 0 ?
"1" :
"0";
2419 else
2435 } else {
2437 return;
2438 }
2439
2440
2441
2442
2443
2444
2445 bool timed_out = false;
2446 const char *timeout_attr = mxml_get_attribute(
pn,
"timeout");
2447 if (timeout_attr && timeout_attr[0]) {
2448 float timeout_sec = (float) atof(
eval_var(seq,
c, timeout_attr).c_str());
2449 if (timeout_sec < 0) {
2450 seq_error(seq,
c,
msprintf(
"Invalid WAIT ODBValue timeout \"%s\"", timeout_attr).c_str());
2451 return;
2452 }
2453
2454
2457
2459
2464
2465 timed_out = elapsed_ms > (
DWORD) (1000.0f * timeout_sec);
2466 } else {
2469 }
2470
2471 if (cont || timed_out) {
2472 if (timed_out && !cont) {
2473 cm_msg(
MINFO,
"sequencer",
"WAIT ODBValue timeout after %.1f seconds: %s %s %g not satisfied",
2475 }
2484 }
2485 }
2486 }
2495 } else {
2499 }
2509 }
2510 } else {
2511 seq_error(seq,
c,
msprintf(
"Invalid wait attribute \"%s\"", mxml_get_attribute(
pn,
"for")).c_str());
2512 }
2513
2514
2516 }
2517
2518
2522 break;
2524 seq_error(seq,
c,
"Maximum loop nesting exceeded");
2525 return;
2526 }
2529 if (mxml_get_attribute(
pn,
"l"))
2531 if (mxml_get_attribute(
pn,
"le"))
2534
2535 if (mxml_get_attribute(
pn,
"n")) {
2538 else {
2540 }
2542 }
else if (mxml_get_attribute(
pn,
"values")) {
2543 mstrlcpy(
data, mxml_get_attribute(
pn,
"values"),
sizeof(
data));
2546 } else {
2547 seq_error(seq,
c,
"Missing \"var\" or \"n\" attribute");
2548 return;
2549 }
2550
2551 if (mxml_get_attribute(
pn,
"var")) {
2552 mstrlcpy(
name, mxml_get_attribute(
pn,
"var"),
sizeof(
name));
2553 sprintf(
str,
"Variables/%s",
name);
2554 size =
value.length() + 1;
2555 if (size < 32)
2556 size = 32;
2558 }
2559
2561 }
2562
2563
2565
2566
2570 size = sizeof(seq);
2578 }
2579
2580
2583 break;
2585 seq_error(seq,
c,
"\"Break\" outside any loop");
2586 return;
2587 }
2588
2589
2592 }
2593
2594
2596
2598 seq_error(seq,
c,
"Maximum number of nested if..endif exceeded");
2599 return;
2600 }
2601
2602
2605
2606
2609 pe = mxml_get_node_at_line(
c->pnseq,
j);
2610
2611
2613 j = mxml_get_line_number_end(pe);
2614 continue;
2615 }
2616
2617
2620 break;
2621 }
2622 }
2623
2624 mstrlcpy(
str, mxml_get_attribute(
pn,
"condition"),
sizeof(
str));
2627 seq_error(seq,
c,
"Invalid number in comparison");
2628 return;
2629 }
2630
2635 else
2637
2639 }
2640
2641
2643
2646 return;
2647 }
2649 }
2650
2651
2654 cm_msg(
MTALK,
"sequencer",
"Sequencer is finished.");
2655 return;
2656 }
2657
2658
2660 if (!mxml_get_attribute(
pn,
"line") && !mxml_get_attribute(
pn,
"sline")) {
2662 return;
2663 }
2664 if (mxml_get_attribute(
pn,
"line")) {
2666 }
2667 if (mxml_get_attribute(
pn,
"sline")) {
2668 mstrlcpy(
str,
eval_var(seq,
c, mxml_get_attribute(
pn,
"sline")).c_str(),
sizeof(
str));
2669 for (
i = 0;
i < last_line;
i++) {
2670 pt = mxml_get_node_at_line(
c->pnseq,
i);
2671 if (pt && mxml_get_attribute(pt, "l")) {
2672 l = atoi(mxml_get_attribute(pt, "l"));
2673 if (atoi(
str) == l) {
2675 break;
2676 }
2677 }
2678 }
2679 }
2680 }
2681
2682
2684
2686 }
2687
2688
2690
2692 }
2693
2694
2696
2698 }
2699
2700
2702 if (!mxml_get_attribute(
pn,
"name")) {
2704 return;
2705 }
2706 mstrlcpy(
name, mxml_get_attribute(
pn,
"name"),
sizeof(
name));
2708
2709 if (strchr(
name,
'[')) {
2710
2711 mstrlcpy(
str, strchr(
name,
'[')+1,
sizeof(
str));
2712 if (strchr(
str,
']'))
2713 *strchr(
str,
']') = 0;
2715 *strchr(
name,
'[') = 0;
2716 sprintf(
str,
"Variables/%s",
name);
2721 }
2722 size =
value.length() + 1;
2723 if (size < 32)
2724 size = 32;
2726 } else {
2727 sprintf(
str,
"Variables/%s",
name);
2728 size =
value.length() + 1;
2729 if (size < 32)
2730 size = 32;
2732 }
2733
2734
2738 if (mxml_get_attribute(pr, "var")) {
2741 }
2742 }
2743
2745 }
2746
2747
2749 if (strchr(mxml_get_value(
pn),
'$'))
2751 else
2753 const char *wait_attr = mxml_get_attribute(
pn,
"wait");
2754 bool wait = false;
2755 if (wait_attr)
2756 wait = (atoi(wait_attr) == 1);
2757
2758 if (!wait) {
2759
2763 } else {
2764
2765
2766
2771
2772 return;
2773 } else {
2774
2775
2776
2778
2779 return;
2780 }
2781
2782
2784 }
2785 }
2786
2788 }
2789
2790
2792 if (strchr(mxml_get_value(
pn),
'$'))
2794 else
2796 std::string
type =
"INFO";
2797 if (mxml_get_attribute(
pn,
"type"))
2798 type = std::string(mxml_get_attribute(
pn,
"type"));
2799
2800 if (
type ==
"ERROR")
2802 else if (
type ==
"DEBUG")
2804 else if (
type ==
"LOG")
2806 else if (
type ==
"TALK")
2808 else
2810
2812 }
2813
2814
2816 if (!mxml_get_attribute(
pn,
"name")) {
2818 return;
2819 }
2820 mstrlcpy(
name, mxml_get_attribute(
pn,
"name"),
sizeof(
name));
2822 return;
2823 sprintf(
str,
"Variables/%s",
name);
2824 size = strlen(
data) + 1;
2825 if (size < 32)
2826 size = 32;
2828
2830 }
2831
2832
2835 seq_error(seq,
c,
"Maximum subroutine level exceeded");
2836 return;
2837 } else {
2838
2842
2843
2844 for (
i = 1;
i < mxml_get_line_number_end(mxml_find_node(
c->pnseq,
"RunSequence"));
i++) {
2845 pt = mxml_get_node_at_line(
c->pnseq,
i);
2846 if (pt) {
2848 if (
equal_ustring(mxml_get_attribute(pt,
"name"), mxml_get_attribute(
pn,
"name"))) {
2849
2851
2853
2854 if (mxml_get_value(
pn)) {
2855 char p[256];
2856 if (strchr(mxml_get_value(
pn),
'$'))
2857 mstrlcpy(p,
eval_var(seq,
c, mxml_get_value(
pn)).c_str(),
sizeof(p));
2858 else
2859 mstrlcpy(p, mxml_get_value(
pn),
sizeof(p));
2860
2862 }
2863
2865 break;
2866 }
2867 }
2868 }
2869 }
2870 if (
i == mxml_get_line_number_end(mxml_find_node(
c->pnseq,
"RunSequence"))) {
2871 seq_error(seq,
c,
msprintf(
"Subroutine '%s' not found", mxml_get_attribute(
pn,
"name")).c_str());
2872 }
2873 }
2874 }
2875
2876
2877 else {
2879 }
2880
2881
2883 size = sizeof(seq1);
2892
2893
2894 if (seq.
debug && !skip_step)
2896
2897
2899}
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_get_value(HNDLE hDB, HNDLE hKeyRoot, const char *key_name, void *data, INT *buf_size, DWORD type, BOOL create)
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_value(HNDLE hDB, HNDLE hKeyRoot, const char *key_name, const void *data, INT data_size, INT num_values, 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)
std::string msprintf(const char *format,...)
#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)