#include "checkPercentDone.h"
#include "stringformat.h"
#include "SzlFileLoader.h"
#include "zoneUtil.h"
namespace tecplot { namespace ___3933 { ___372 ___485( SzPltWriteOperation_e szPltWriteOperation, ___37& ___36, ___4352 ___4336, ___4636 zone) { REQUIRE(VALID_ENUM(szPltWriteOperation, SzPltWriteOperation_e)); ___4352  const ___2843 = ___36.___890(); ___4636 const ___2846 = ___36.___891(); REQUIRE(___4336<___2843); REQUIRE(zone<___2846); ___372 const isOrderedZone = ___4641(___36, zone); ___372 const isSzlZone = isOrderedZone ? ___4642(___36, zone) : ___4644(___36, zone); int const determineSubzonesWork = (isSzlZone && !isOrderedZone ? 1 : 0); int const writeConnectivityWork = (isOrderedZone ? 0 : 1); int const calcSzMinMaxWork = (isSzlZone ? 1 : 0); int const writeFieldDataWork = 1; int completedWork = 0; int currentWork = 0; std::string status; if ( szPltWriteOperation ==  SzPltWriteOperation_DetermineSubzones) { ___478(!isOrderedZone); ___478(isSzlZone); ___478(___4336==0); status = "Determining subzones for zone " + ___4187(uint64_t(zone)+1) + "..."; completedWork = 0; currentWork = determineSubzonesWork; } else if ( szPltWriteOperation == SzPltWriteOperation_WriteConnectivity ) { ___478(!isOrderedZone); ___478(___4336==0); status = "Writing connectivity for zone " + ___4187(uint64_t(zone)+1) + "..."; if ( isSzlZone ) completedWork = determineSubzonesWork; else completedWork = determineSubzonesWork + writeConnectivityWork + calcSzMinMaxWork; currentWork = writeConnectivityWork; } else if ( szPltWriteOperation == SzPltWriteOperation_CalcSubzoneMinMax ) { ___478(isSzlZone); status = "Calculating subzone min-maxes for zone " + ___4187(uint64_t(zone)+1) + " variable " + ___4187(uint64_t(___4336)+1) + "..."; completedWork = determineSubzonesWork + writeConnectivityWork; currentWork = calcSzMinMaxWork; } else { ___478(szPltWriteOperation == SzPltWriteOperation_WriteFieldData); status = "Writing field data for zone " + ___4187(uint64_t(zone)+1) + " variable " + ___4187(uint64_t(___4336)+1) + "..."; if ( isSzlZone ) completedWork = determineSubzonesWork + writeConnectivityWork + calcSzMinMaxWork; else completedWork = 0; currentWork = writeFieldDataWork; } int const totalPerVarWork = determineSubzonesWork + writeConnectivityWork + calcSzMinMaxWork + writeFieldDataWork; ___478(completedWork+currentWork <= totalPerVarWork); int const percentDone = ( (100*completedWork*___2843 + 100*currentWork*___4336)/totalPerVarWork + 100*zone*___2843)/(___2843*___2846); ___478(0<=percentDone && percentDone<=100); ___36.___3778(status.c_str()); ___372 isInterrupted = ___36.___3769(percentDone); REQUIRE(VALID_BOOLEAN(isInterrupted)); return isInterrupted; } }}
