Unverified Commit fca768e0 authored by Andrea Orlati's avatar Andrea Orlati Committed by GitHub
Browse files

Fix issue #719: some minor tweaks in order to make the parsing more robust....

Fix issue #719: some minor tweaks in order to make the parsing more robust. Also the case reported by this issue is included and solved. (#737)
parent c062c97d
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -83,7 +83,8 @@ bool CParser::parse(CBaseSchedule* unit,DWORD& line,IRA::CString& errorMsg)
		IRA::CString inputLine(inLine);
		inputLine.Replace('\r',' ',0);
		inputLine.RTrim();
		if ((inLine[0]!=COMMENT_CHAR) && (inLine[0]!=0) && (strlen(inLine)!=0)) {
		inputLine.LTrim();
		if ((inputLine[0]!=COMMENT_CHAR) && (inputLine[0]!=0) && (inputLine.GetLength()!=0)) {
			if (!unit->parseLine(inputLine,line,errorMsg)) {
				return false;
			}
@@ -167,7 +168,14 @@ bool CBackendList::parseLine(const IRA::CString& line,const DWORD& lnNumber,IRA:
	workLine.RTrim();
	workLine.LTrim();
	if (m_started) { // if the procedure is started
		if (workLine.Find(PROCEDURE_STOP)>=0) { // if the end bracket is found...close the procedure parsing
		if (workLine.Find(PROCEDURE_STOP)>=0) { // if the end bracket is found....
			IRA::CString token;
			int start=0;
			if (IRA::CIRATools::getNextToken(workLine,start,PROCEDURE_STOP,token)) { // if there is a command in the same line of the end proc				
				 // push command before closing the procedure.....
				if (token.GetLength()>0) m_currentRecord->proc.push_back(token);
			}
			//... then close the procedure
			m_backend.push_back(m_currentRecord);
			m_started=false;
			m_currentRecord=NULL;
+5 −3
Original line number Diff line number Diff line
@@ -21,8 +21,7 @@ STD:BACKENDS/TotalPower {
	setSection=12,-1,300.0,-1,-1,0.000025,-1
	setSection=13,-1,300.0,-1,-1,0.000025,-1	
	setAttenuation=1,15
	enable=1,1,1,1,1,1,1,1,1,1,1,1,1,1
}
	enable=1,1,1,1,1,1,1,1,1,1,1,1,1,1}

HIGH:BACKENDS/TotalPower {
	integration=25
@@ -32,3 +31,6 @@ HIGH:BACKENDS/TotalPower {
	setAttenuation=1,9
	enable=1,1,0,0,0,0,0,0,0,0,0,0,0,0
   }
   
LOW:BACKENDS/Sardara {
	integration=25}
 No newline at end of file
+5 −5
Original line number Diff line number Diff line
@@ -83,6 +83,6 @@ SC: 2 mySource HIGH:MANAGEMENT/MBFits
2_2	10:45:16.000	6.0	9	NULL	NULL

#id duration scan PreScan PostScan backend Writer
#SC:	1	dr21	STD::MANAGEMENT/FitsZilla
#1_1	60.0	1	STANDARDPRESCAN	NULL
#1_2	60.0	1	STANDARDPRESCAN	NULL
SC:	3	dr21	LOW::MANAGEMENT/FitsZilla
3_1	11:30:10.000	60.0	1	STANDARDPRESCAN	NULL
3_2	11:36:22.200	60.0	1	STANDARDPRESCAN	NULL