Browse Source

更改MFC的ramp取值,默认单位为slm时不需要变换

shishenghui 5 days ago
parent
commit
e2befc7d16

+ 8 - 6
TIN001-PLC/Jet_Furance_PMC/Jet_Furance_PMC/Jet_Furance_PMC/FurancePMC/IoMFC.cpp

@@ -52,14 +52,16 @@ void IoMFC::initialize()
 		if (op->params.length >= 4) {
 			const char* rampUnit = op->params.get(3);
 			const char* rampTime = op->params.get(1);
-			double fRampTime = atof(rampTime);
-			double ramp = 0;
-			if (GT_ZERO(fRampTime) && strcmp(rampUnit, "time") == 0) {
-				ramp = (device->aoFlow.getDoubleValue() - device->aiFlow.getDoubleValue()) / fRampTime;
+			double ramp = atof(rampTime);
+			if (GT_ZERO(ramp) && strcmp(rampUnit, "time") == 0) {
+				ramp = (device->aoFlow.getDoubleValue() - device->aiFlow.getDoubleValue()) / ramp;
 				device->aoRamp.setDoubleValue(ramp);
 			}
-			else if (GT_ZERO(fRampTime) && strcmp(rampUnit, "%") == 0) {
-				ramp = device->N2Scale/ fRampTime;
+			else if (GT_ZERO(ramp) && strcmp(rampUnit, "%") == 0) {
+				ramp = device->N2Scale/ ramp;
+				device->aoRamp.setDoubleValue(ramp);
+			}
+			else {
 				device->aoRamp.setDoubleValue(ramp);
 			}
 		}