| 644 | |
| 645 | |
| 646 | int |
| 647 | SimulationInformation::neesUpload(const char *username, |
| 648 | const char *passwd, |
| 649 | int projID, |
| 650 | int expID) |
| 651 | { |
| 652 | #ifdef _HTTPS |
| 653 | |
| 654 | // call endTime if not already called |
| 655 | if (strcmp(endTime, " ") == 0) |
| 656 | this->end(); |
| 657 | |
| 658 | int res =0; |
| 659 | int trialID =0; |
| 660 | char *cookie = 0; |
| 661 | |
| 662 | // |
| 663 | // we first need to login |
| 664 | // |
| 665 | |
| 666 | if (username == 0 || passwd== 0) { |
| 667 | opserr << "ERROR: SimulationInformation::neesUpload() could not login to nees central no username or passwd provided\n"; |
| 668 | return -1; |
| 669 | } |
| 670 | |
| 671 | res = neesLogin(username, passwd, &cookie); |
| 672 | if (res != 0) { |
| 673 | if (cookie != 0) |
| 674 | free(cookie); |
| 675 | |
| 676 | opserr << "ERROR: SimulationInformation::neesUpload() - failed to login check username: " << username |
| 677 | << " & password: " << passwd << "\n"; |
| 678 | return -1; |
| 679 | } |
| 680 | |
| 681 | if (cookie != 0) |
| 682 | opserr << "SimulationInformation::neesUpload() - information about cookie: " << cookie << endln; |
| 683 | |
| 684 | // |
| 685 | // we first add trial to the projects experiment |
| 686 | // |
| 687 | |
| 688 | trialID = neesADD_Trial(cookie, projID, expID, title, title, " ", description); |
| 689 | |
| 690 | if (trialID < 0) { |
| 691 | if (cookie != 0) |
| 692 | free(cookie); |
| 693 | |
| 694 | opserr << "SimulationInformation::neesUpload() - failed to create new Trial in project: " |
| 695 | << projID << " experiment: " << expID << "\n"; |
| 696 | |
| 697 | return -2; |
| 698 | } |
| 699 | |
| 700 | // |
| 701 | // we now add the files |
| 702 | // first determine root dir for project in nees central, lowest branch with multiple dir os a file |
| 703 | // |
nothing calls this directly
no test coverage detected