public static void outputFunTimer(List <outputForm> objListOut, AdamCNT AdamComponent) { objListOut.Add(new outputForm(AdamComponent.getCnt(), AdamComponent.getSwitchState())); using (var writer = new StreamWriter("TimerOutput.csv")) using (var csv = new CsvWriter(writer)) { csv.WriteRecords(objListOut); } }
private static void OnSignal(Object source, ElapsedEventArgs e) { Console.WriteLine("Entered timer... "); Console.WriteLine("######################"); Console.WriteLine("Count: " + AdamComponent.getCnt()); Console.WriteLine("State: " + AdamComponent.getSwitchState()); Console.WriteLine("######################"); FileIO.outputFunTimer(objListOut, AdamComponent); }
private static void OnSignal(Object source, ElapsedEventArgs e) { AdamComponent.buttonRead(); AdamComponent.counterRead(); Console.WriteLine("Entered timer... "); objListOut.Add(new outputForm(AdamComponent.getCnt(), "OFF")); //napravi geter za cnt using (var writer = new StreamWriter("output2.csv")) using (var csv = new CsvWriter(writer)) { csv.WriteRecords(objListOut); } }