/* CONSTRUCTORS */ public Frack_Fixer(FileUtils fileUtils, int timeout) { this.fileUtils = fileUtils; raida = new RAIDA(timeout); totalValueToBank = 0; totalValueToCounterfeit = 0; totalValueToFractured = 0; }//constructor
} // End print welcome public static bool echoRaida() { RAIDA_Status.resetEcho(); RAIDA raida1 = new RAIDA(5000); Response[] results = raida1.echoAll(5000); int totalReady = 0; //For every RAIDA check its results int longestCountryName = 15; Console.Out.WriteLine(); for (int i = 0; i < 25; i++) { int padding = longestCountryName - countries[i].Length; string strPad = ""; for (int j = 0; j < padding; j++) { strPad += " "; }//end for padding if (!RAIDA_Status.failsEcho[i]) { Console.ForegroundColor = ConsoleColor.Green; Console.Out.Write(countries[i] + strPad); totalReady++; } else { Console.ForegroundColor = ConsoleColor.Red; Console.Out.Write(countries[i] + strPad); } if (i == 4 || i == 9 || i == 14 || i == 19) { Console.WriteLine(); } }//end for Console.ForegroundColor = ConsoleColor.White; Console.Out.WriteLine(""); Console.Out.WriteLine(""); Console.Out.WriteLine(StringHolder.program_echo_1 + totalReady + " out of 25"); //"RAIDA Health: " + totalReady ); Console.Out.WriteLine(); //Check if enough are good if (totalReady < 16)// { Console.ForegroundColor = ConsoleColor.Red; Console.Out.Write(""); Console.Out.Write(StringHolder.program_echo_3); // "Not enough RAIDA servers can be contacted to import new coins."); Console.Out.Write(StringHolder.program_echo_4); // "Is your device connected to the Internet?"); Console.Out.Write(StringHolder.program_echo_5); // "Is a router blocking your connection?"); Console.ForegroundColor = ConsoleColor.White; return(false); } else { Console.ForegroundColor = ConsoleColor.Green; Console.Out.WriteLine(""); Console.Out.WriteLine(StringHolder.program_echo_6);// "The RAIDA is ready for counterfeit detection."); Console.ForegroundColor = ConsoleColor.White; return(true); } //end if enough RAIDA } //End echo
/* CONSTRUCTOR */ public Detector(FileUtils fileUtils, int timeout) { this.raida = new RAIDA(timeout); this.fileUtils = fileUtils; }// end Detect constructor