fix several bugs

master
IoTcat 5 years ago
parent 45ea8cd786
commit f309e42a34
  1. 3
      lib/ovo.h
  2. 2
      src/main.cpp
  3. 2
      src/park.cpp
  4. 2
      src/park.h

@ -714,6 +714,7 @@ namespace ovo{
if(indexList["_isExist"] == "NO"){ if(indexList["_isExist"] == "NO"){
return o; return o;
} }
indexList.clear("_isExist");
if(indexList["__TABLE_INDEX__" + index] == "undefined"){ if(indexList["__TABLE_INDEX__" + index] == "undefined"){
return o; return o;
} }
@ -741,6 +742,7 @@ namespace ovo{
if(indexList["_isExist"] == "NO"){ if(indexList["_isExist"] == "NO"){
return o; return o;
} }
indexList.clear("_isExist");
d.forEach([&](string index, string val){ d.forEach([&](string index, string val){
@ -763,6 +765,7 @@ namespace ovo{
return o; return o;
} }
indexList.clear("_isExist");
for(auto i : indexList){ for(auto i : indexList){
o.push_back(this->getData(i.first)); o.push_back(this->getData(i.first));

@ -450,6 +450,7 @@ int main(int argc, char const* argv[]) {
cin >> t_Type; cin >> t_Type;
Plot pp = p->getPlot(t_PlotID); Plot pp = p->getPlot(t_PlotID);
cout << pp.showAll();
if (!p->updatePlot(pp, t_Type)) { if (!p->updatePlot(pp, t_Type)) {
cout << endl << "Update Failure!!!" << endl; cout << endl << "Update Failure!!!" << endl;
@ -709,6 +710,7 @@ void manualIni(Park& p) {
cout << "The " << ii << "th hour = "; cout << "The " << ii << "th hour = ";
cin >> fee[ii]; cin >> fee[ii];
} }
feeTable[i] = fee;
} }
p.updateFeeTable(feeTable); p.updateFeeTable(feeTable);

@ -229,7 +229,7 @@ const bool Park::newCar(const string& licenseNum, const string& type,
return false; return false;
} }
if (this->isGoodType(type)) { if (!this->isGoodType(type)) {
msg += "Car " + licenseNum + " Wrong Type!!!"; msg += "Car " + licenseNum + " Wrong Type!!!";
return false; return false;
} }

@ -253,7 +253,7 @@ private:
}; };
inline const bool isGoodType(const string& type) const { inline const bool isGoodType(const string& type) const {
return (bool)(find(this->_types.begin(), this->_types.end(), type) == return (bool)(find(this->_types.begin(), this->_types.end(), type) !=
this->_types.end()); this->_types.end());
}; };
}; };

Loading…
Cancel
Save