| 924 | } |
| 925 | |
| 926 | static void map_job_constraints(color_ostream &out) |
| 927 | { |
| 928 | melt_active = false; |
| 929 | |
| 930 | for (size_t i = 0; i < constraints.size(); i++) |
| 931 | { |
| 932 | constraints[i]->jobs.clear(); |
| 933 | constraints[i]->is_active = false; |
| 934 | } |
| 935 | |
| 936 | auto L = Lua::Core::State; |
| 937 | Lua::StackUnwinder frame(L); |
| 938 | |
| 939 | bool ok = Lua::PushModulePublic(out, L, "plugins.workflow", "doEnumJobOutputs"); |
| 940 | if (!ok) |
| 941 | out.printerr("The workflow lua module is not available.\n"); |
| 942 | |
| 943 | for (TKnownJobs::const_iterator it = known_jobs.begin(); it != known_jobs.end(); ++it) |
| 944 | { |
| 945 | ProtectedJob *pj = it->second; |
| 946 | |
| 947 | pj->constraints.clear(); |
| 948 | |
| 949 | if (!ok || !pj->isLive()) |
| 950 | continue; |
| 951 | |
| 952 | if (!melt_active && pj->actual_job->job_type == job_type::MeltMetalObject) |
| 953 | melt_active = pj->isResumed(); |
| 954 | |
| 955 | // Call the lua module |
| 956 | lua_pushvalue(L, -1); |
| 957 | lua_pushlightuserdata(L, pj); |
| 958 | lua_pushcclosure(L, cbEnumJobOutputs, 1); |
| 959 | Lua::PushDFObject(L, pj->job_copy); |
| 960 | |
| 961 | Lua::SafeCall(out, L, 2, 0); |
| 962 | } |
| 963 | } |
| 964 | |
| 965 | /****************************** |
| 966 | * ITEM-CONSTRAINT MAPPING * |
no test coverage detected