environment_monitoring_app/lib/models/air_collection_data.dart

101 lines
2.5 KiB
Dart

// lib/models/air_collection_data.dart
import 'dart:io';
class AirCollectionData {
String? installationRefID; // Foreign key to link with AirInstallationData
String? initialTemp; // Needed for VSTD calculation
String? weather;
String? finalTemp;
String? powerFailureStatus;
String? remark;
// PM10 Data
String? pm10FlowRate;
String? pm10TotalTime;
String? pm10Pressure;
String? pm10Vstd;
// PM2.5 Data
String? pm25FlowRate;
String? pm25TotalTime;
String? pm25Pressure;
String? pm25Vstd;
// Image files (6 as per the flowchart)
File? imageSiteLeft;
File? imageSiteRight;
File? imageSiteFront;
File? imageSiteBack;
File? imageChart;
File? imageFilterPaper;
// Local paths after saving
String? imageSiteLeftPath;
String? imageSiteRightPath;
String? imageSiteFrontPath;
String? imageSiteBackPath;
String? imageChartPath;
String? imageFilterPaperPath;
// Submission status
String? status;
AirCollectionData({
this.installationRefID,
this.initialTemp,
this.weather,
this.finalTemp,
this.powerFailureStatus,
this.remark,
this.pm10FlowRate,
this.pm10TotalTime,
this.pm10Pressure,
this.pm10Vstd,
this.pm25FlowRate,
this.pm25TotalTime,
this.pm25Pressure,
this.pm25Vstd,
this.imageSiteLeft,
this.imageSiteRight,
this.imageSiteFront,
this.imageSiteBack,
this.imageChart,
this.imageFilterPaper,
this.imageSiteLeftPath,
this.imageSiteRightPath,
this.imageSiteFrontPath,
this.imageSiteBackPath,
this.imageChartPath,
this.imageFilterPaperPath,
this.status,
});
// Method to convert the data to a JSON-like Map
Map<String, dynamic> toJson() {
return {
'installationRefID': installationRefID,
'initialTemp': initialTemp,
'weather': weather,
'finalTemp': finalTemp,
'powerFailureStatus': powerFailureStatus,
'remark': remark,
'pm10FlowRate': pm10FlowRate,
'pm10TotalTime': pm10TotalTime,
'pm10Pressure': pm10Pressure,
'pm10Vstd': pm10Vstd,
'pm25FlowRate': pm25FlowRate,
'pm25TotalTime': pm25TotalTime,
'pm25Pressure': pm25Pressure,
'pm25Vstd': pm25Vstd,
'imageSiteLeftPath': imageSiteLeftPath,
'imageSiteRightPath': imageSiteRightPath,
'imageSiteFrontPath': imageSiteFrontPath,
'imageSiteBackPath': imageSiteBackPath,
'imageChartPath': imageChartPath,
'imageFilterPaperPath': imageFilterPaperPath,
'status': status,
};
}
}