import { Injectable } from '@angular/core';
import { Subject } from 'rxjs';

@Injectable()
export class ReportService {
  invokeEvent: Subject<any> = new Subject(); 
   invokeEventForAcReport:Subject<any>=new Subject();
  invokeEventForDistance:Subject<any>=new Subject();
  invokeEventForDailyLogs:Subject<any>=new Subject();
  invokeEventForDayWiseReport:Subject<any>=new Subject();
  invokeEventForgeofenceReport:Subject<any>=new Subject();
  invokeEventForidleReport:Subject<any>=new Subject();
  invokeEventForignitionReport:Subject<any>=new Subject();
  invokeEventForloadunloadTrip:Subject<any>=new Subject();
  invokeEventFornotificationMaster:Subject<any>=new Subject();
  invokeEventForoverspeedReport:Subject<any>=new Subject();
  invokeEventForpoiReport:Subject<any>=new Subject();
  invokeEventForrouteViolationReport:Subject<any>=new Subject();
  invokeEventForsummaryReport:Subject<any>=new Subject();
  invokeEventForstoppageReport:Subject<any>=new Subject();
  invokeEventForsosReport:Subject<any>=new Subject();
  invokeEventFortripReport:Subject<any>=new Subject();
  invokeEventForworkingHoursReport:Subject<any>=new Subject();
  invokeEventFormaintanceReport:Subject<any>=new Subject();
  invokeEventForSpeedVariationReport:Subject<any>=new Subject();
  invokeEventFortravelPathReportt:Subject<any>=new Subject();
  invokeEventForDataPushReport:Subject<any>=new Subject();
  invokeEventForPerformanceReport:Subject<any>=new Subject();
  addCustomer:Subject<any>=new Subject();
  deviceExcel:Subject<any>=new Subject();
  devicePDF:Subject<any>=new Subject();

  JobCard:Subject<any>=new Subject();

  reportArray = [
    {name : "AC Report",Rstatus : true,Astatus:false,value:"ac_report"},
    {name:"Daily Report",Rstatus:true,Astatus:false,value:"daily_report"},
    {name:"Daily Logs",Rstatus:true,Astatus:false,value:"daily_logs"},
    {name:"Daywise Report",Rstatus:true,Astatus:false,value:"daywise_report"},
    {name:"Distance Report",Rstatus : true,Astatus:false,value:"distance_report"},
    {name : "Driver Performance Report",Rstatus : true,Astatus:false,value:"driver_performance_report"},
    {name : "Geofence Report",Rstatus : true,Astatus:false,value:"geofence_report"},
    {name :"Idle Report",Rstatus : true,Astatus:false,value:"idle_report"},
    {name : "Ignition Report",Rstatus : true,Astatus:false,value:"ignition_report"},
    {name : "Loading Unloading Trip",Rstatus : true,Astatus:false,value:"loading_unloading_trip"},
    {name : "Notification Center",Rstatus : true,Astatus:false,value:"notification_master"},
    {name : "Overspeed Report",Rstatus : true,Astatus:false,value:"overspeed_report"},
    {name : "POI Report",Rstatus : true,Astatus:false,value:"poi_report"},
    {name : "Route Violation Report",Rstatus : true,Astatus:false,value:"route_violation_report"},
    {name:"Speed Variation",Rstatus:true,Astatus:false,value:"speed_variation"},
    {name : "Summary Report",Rstatus : true,Astatus:false,value:"summary_report"},
    {name : "Stoppage Report",Rstatus : true,Astatus:false,value:"stoppage_report"},
    {name : "SOS Report",Rstatus : true,Astatus:false,value:"sos_report"},
    {name:"Trip Report",Rstatus:true,Astatus:false,value:"trip_report"},
    {name : "Travel Path Report",Rstatus : true,Astatus:false,value:"travel_path_report"},
    {name : "Working Hours Reports",Rstatus : true,Astatus:false,value:"working_hours_report"},
    {name : "Maintenance Reports",Rstatus : true,Astatus:false,value:"maintanance_report"},

    // {name :"Fuel Report",Rstatus : true,Astatus:false,value:"fuel_report"},
    // {name:"Fuel Consumption Report",Rstatus:true,Astatus:false,value:"fuel_consumption_report"},
    // 
    // {name : "User Trip Report",Rstatus : true,Astatus:false,value:"user_trip_report"},
    // {name : "Alert Report",Rstatus : true,Astatus:false,value:"alert_report"}  ,
  ];
// ac_report: {Rstatus: false, Astatus: false}
// alert_report: {Rstatus: false, Astatus: false}
// daily_report: {Rstatus: false, Astatus: false}
// daywise_report: {Rstatus: false, Astatus: false}
// distance_report: {Rstatus: false, Astatus: false}
// driver_performance_report: {Rstatus: false, Astatus: false}
// fuel_consumption_report: {Rstatus: false, Astatus: false}
// fuel_report: {Rstatus: false, Astatus: false}
// geofence_report: {Rstatus: false, Astatus: false}
// idle_report: {Rstatus: false, Astatus: false}
// ignition_report: {Rstatus: false, Astatus: false}
// loading_unloading_trip: {Rstatus: false, Astatus: false}
// overspeed_report: {Rstatus: false, Astatus: false}
// poi_report: {Rstatus: false, Astatus: false}
// route_violation_report: {Rstatus: false, Astatus: false}
// sos_report: {Rstatus: false, Astatus: false}
// speed_variation: {Rstatus: false, Astatus: false}
// stoppage_report: {Rstatus: false, Astatus: false}
// summary_report: {Rstatus: false, Astatus: false}
// travel_path_report: {Rstatus: false, Astatus: false}
// trip_report: {Rstatus: false, Astatus: false}
// user_trip_report: {Rstatus: false, Astatus: fals


  constructor() { }
  
  callMethodOfSecondComponent(value) { 
    console.log(value);
    
    this.invokeEvent.next(value)      
  }
  dailyLogs(value){
     console.log(value);
     
    this.invokeEventForDailyLogs.next(value)
  }

  accReport(value){
    this.invokeEventForAcReport.next(value)
  }

  speedVariation(value){
     this.invokeEventForSpeedVariationReport.next(value);

  }
  travelPathReport(value){
     console.log(value)
     this.invokeEventFortravelPathReportt.next(value)
   }

  dayWiseReport(value){
     console.log(value);
     
     this.invokeEventForDayWiseReport.next(value)
  }
  distanceReport(value){
     console.log(value);
     this.invokeEventForDistance.next(value)
  }
  geofenceReport(value){
     console.log(value);
     this.invokeEventForgeofenceReport.next(value)
  }
  idleReport(value){
     this.invokeEventForidleReport.next(value)
  }
   ignitionReport(value){
     this.invokeEventForignitionReport.next(value)
  }
   loadunloadTrip(value){
     this.invokeEventForloadunloadTrip.next(value)
  }
   notificationMaster(value){
      console.log(value);
      
     this.invokeEventFornotificationMaster.next(value)
  }
  overspeedReport(value){
     this.invokeEventForoverspeedReport.next(value)
  }
  poiReport(value){
     this.invokeEventForpoiReport.next(value)
  }
  routeViolationReport(value){
     this.invokeEventForrouteViolationReport.next(value)
  }
   summaryReport(value){
     this.invokeEventForsummaryReport.next(value)
  }
  stoppageReport(value){
     this.invokeEventForstoppageReport.next(value)
  }
  sosReport(value){
     this.invokeEventForsosReport.next(value)
  }
   tripReport(value){
     this.invokeEventFortripReport.next(value)
  }
  workingHoursReport(value){
     this.invokeEventForworkingHoursReport.next(value)
  }
  maintanceReport(value){
     this.invokeEventFormaintanceReport.next(value)
  }
  datapushReport(value){
     this.invokeEventForDataPushReport.next(value)
  }

   performanceReport(value){
     this.invokeEventForPerformanceReport.next(value)
  }

  
addCustomerFunction(value){
   this.addCustomer.next(value)
}
  openEditJobCard(value){
     this.JobCard.next(value)
  }

  downloadDeviceExcel(value){
     this.deviceExcel.next(value);
  }

}
