Changeset 42414
- Timestamp:
- Mar 15, 2023, 11:29:37 AM (3 years ago)
- Location:
- branches/eam_branches/ipp-20230313/ippTools/src
- Files:
-
- 2 edited
-
pztool.c (modified) (6 diffs)
-
pztoolConfig.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20230313/ippTools/src/pztool.c
r41598 r42414 50 50 static bool updatenewexpMode(pxConfig *config); 51 51 52 // XXX EAM : 2021.05.18 : code for updatesummitExp was added but not finished. 53 // XXX static bool updatesummitExpMode(pxConfig *config); 52 static bool updatesummitExpMode(pxConfig *config); 54 53 55 54 // static bool copydoneCompleteExp(pxConfig *config); … … 93 92 MODECASE(PZTOOL_MODE_UPDATEPZEXP, updatepzexpMode); 94 93 MODECASE(PZTOOL_MODE_UPDATENEWEXP, updatenewexpMode); 95 // XXXMODECASE(PZTOOL_MODE_UPDATESUMMITEXP, updatesummitExpMode);94 MODECASE(PZTOOL_MODE_UPDATESUMMITEXP, updatesummitExpMode); 96 95 default: 97 96 psAbort("invalid option (this should not happen)"); … … 810 809 } 811 810 812 813 811 static bool updatecopiedMode(pxConfig *config) 814 812 { … … 939 937 } 940 938 941 # if (0) 942 static bool summitExpSetFault(pxConfig *config, const psS64 summit_id, const int fault) 939 static bool summitExpSetFault(pxConfig *config, const psString exp_name, const psS64 summit_id, const int fault) 943 940 { 944 941 // check that state is a valid string value … … 949 946 } 950 947 951 char *query = "UPDATE summitExp SET fault = %d WHERE summit_id = %ld ";952 if (!p_psDBRunQueryF(config->dbh, query, fault, summit_id )) {953 psError(PS_ERR_UNKNOWN, false, "failed to change state for %lld", (long long) summit_id);948 char *query = "UPDATE summitExp SET fault = %d WHERE summit_id = %ld AND exp_name = '%s'"; 949 if (!p_psDBRunQueryF(config->dbh, query, fault, summit_id, exp_name)) { 950 psError(PS_ERR_UNKNOWN, false, "failed to change state for %s = %lld", exp_name, (long long) summit_id); 954 951 return false; 955 952 } … … 960 957 static bool updatesummitExpMode(pxConfig *config) 961 958 { 962 int fault; 963 959 // require both exp_name and summit_id as a double-check 964 960 PS_ASSERT_PTR_NON_NULL(config, false); 965 961 PXOPT_LOOKUP_S64(summit_id, config->args, "-summit_id", true, false); 966 PXOPT_LOOKUP_S32(state, config->args, "-set_fault",true, false); 967 968 if (!summitExpSetFault(config,summit_id, fault)) { 969 psError(PS_ERR_UNKNOWN, false, "failed to change state for %lld", (long long) summit_id); 970 return false; 962 PXOPT_LOOKUP_STR(exp_name, config->args, "-exp_name", true, false); 963 PXOPT_LOOKUP_S32(fault, config->args, "-set_fault", true, false); 964 965 if (!summitExpSetFault(config, exp_name, summit_id, fault)) { 966 psError(PS_ERR_UNKNOWN, false, "failed to change state for %s = %lld", exp_name, (long long) summit_id); 967 return false; 971 968 } 972 969 return true; 973 970 } 974 # endif975 971 976 972 static bool updatepzexpMode(pxConfig *config) -
branches/eam_branches/ipp-20230313/ippTools/src/pztoolConfig.c
r42254 r42414 171 171 psMetadataAddStr(updatepzexpArgs, PS_LIST_TAIL, "-set_state", 0, "define new state (required)", NULL); 172 172 173 # if (0)174 173 // -updatesummitexp 175 174 psMetadata *updatesummitexpArgs = psMetadataAlloc(); 176 175 psMetadataAddS64(updatesummitexpArgs, PS_LIST_TAIL, "-summit_id", 0, "define summit_id", 0); 177 176 psMetadataAddStr(updatesummitexpArgs, PS_LIST_TAIL, "-exp_name", 0, "search by exposure name (required)", NULL); 178 psMetadataAddStr(updatesummitexpArgs, PS_LIST_TAIL, "-inst", 0, "search by camera (required)", NULL);179 psMetadataAddStr(updatesummitexpArgs, PS_LIST_TAIL, "-telescope", 0, "search by telescope (required)", NULL);180 177 psMetadataAddS32(updatesummitexpArgs, PS_LIST_TAIL, "-set_fault", 0, "define new fault (required)", 0); 181 # endif182 178 183 179 // -updatenewexp
Note:
See TracChangeset
for help on using the changeset viewer.
