private async void GetMachines() { FirestoreNetworking networking = new FirestoreNetworking(); List <Machine> machines = await networking.GetMachines(); PopulateOnlineListView(machines); PopulateMchineListView(machines); }
private void GetNextError() { Error NextError = com.GetNextError(); if (NextError != null) { NextError.MachineId = machine.ReferenceId; FirestoreNetworking networking = new FirestoreNetworking(); networking.SaveError(NextError); GetNextError(); } }
private async void UpdateMachine(Object source, ElapsedEventArgs e) { Dictionary <string, string> executionPoint = com.GetExecutionPoint(); ExecutionData executationData = new ExecutionData() { ProgramStatus = com.GetProgramStatus(), ExecutionMode = com.GetExecutionMode(), SelectedProgram = executionPoint["NameSelectedProgram"], ActiveProgram = executionPoint["NameActiveProgram"], BlockNumber = executionPoint["BlockNr"], PalletNumber = string.Format("{0}", com.ReadWord(40)) }; Dictionary <string, string> tool = com.GetTool(); var toolNumber = tool["ToolNr"]; Tool toolData = new Tool() { Number = tool["ToolNr"], Length = tool["ToolLen"], Radius = tool["ToolRad"], Name = DataValueForPath($"\\TABLE\\TOOL\\T\\{toolNumber}\\NAME"), Radius2 = DataValueForPath($"\\TABLE\\TOOL\\T\\{toolNumber}\\R2"), LengthOversize = DataValueForPath($"\\TABLE\\TOOL\\T\\{toolNumber}\\DL"), RadiusOversize = DataValueForPath($"\\TABLE\\TOOL\\T\\{toolNumber}\\DR"), ReplacmentToolNumber = DataValueForPath($"\\TABLE\\TOOL\\T\\{toolNumber}\\RT"), Time = DataValueForPath($"\\TABLE\\TOOL\\T\\{toolNumber}\\TIME2"), CurrentTime = DataValueForPath($"\\TABLE\\TOOL\\T\\{toolNumber}\\CUR.TIME") }; machine.ExecutationData = executationData; machine.Tool = toolData; //Console.WriteLine(com.GetMachineSerialNumber()); if (machine != null) { FirestoreNetworking networking = new FirestoreNetworking(); networking.UpdateMachine(machine); } GetFirstError(); }
private void GetFirstError() { Error NewError = com.GetFirstError(); if (NewError == null) { errorReset = true; } if (NewError != null && errorReset) { errorReset = false; NewError.MachineId = machine.ReferenceId; FirestoreNetworking networking = new FirestoreNetworking(); networking.SaveError(NewError); GetNextError(); } }