Exemple #1
0
        public void getData(object stateInfo)
        {
            var startTimeSpan = TimeSpan.Zero;
            var periodTimeSpan = TimeSpan.FromMinutes(1);
             
            //SaveData.WriteString(cimdata.getStats(), buildings.getStats(), geninfo.getStats(), vehicle.getAllVehicles(), vehicle.getStats(), inoutSats.doPoll(), traffic.getData(), districts.getData());

            int counter = 0;
            var timer = new System.Threading.Timer((e) =>
            {
                counter = counter + 1;
                vehiclestats vehicle = new vehiclestats();
                DistrictStats districts = new DistrictStats();
                incomeExpenseStats inoutSats = new incomeExpenseStats();
                GenInfo geninfo = new GenInfo();
                CimData cimdata = new CimData();
                BuildingData buildings = new BuildingData();
                TrafficInfo traffic = new TrafficInfo();

                SaveData.WriteString(counter, cimdata.getStats(), buildings.getStats(), geninfo.getStats(), vehicle.getAllVehicles(), vehicle.getStats(), inoutSats.doPoll(), traffic.getData(), districts.getData());

            }, null, startTimeSpan, periodTimeSpan);


        }//end get Data
        public override IResponseFormatter Handle(HttpListenerRequest request)
        {
            CimData cimdata = new CimData();

            return(HtmlResponse(cimdata.getStats()));
        }