示例#1
0
文件: Reader.cs 项目: TommyAGK/Flex
        private void PrintDiagnosticData(string rfid, bool localerror = false)
        {
            var port = _comport;
                        var networkAccess = "Status på nettverk: Tilkobling mislyktes";
                        if (NetworkInterface.GetIsNetworkAvailable())
                            {
                                networkAccess = "Status på nettverk: Tilkobling OK";
                            }

                        string str;
                        if (localerror)
                            {
                                str = String.Format("Flex diagnostikk. finner ikke enhet ved {0}", port);
                                sp.Speak(str, 0);
                            }
                        else
                            {
                                str = String.Format("Flex diagnostikk. Enhet koblet til ved {0}, {1}", port, networkAccess);
                                sp.Speak(str, 0);
                                var dataReader = new XmlDataReader(XmlDataReader.ConfigType.Students, this, Diagnostic);
                                _orgData = new DatabaseManager().GenerateData(rfid, this, Diagnostic);
                                Diagnostic = false;
                            }
                        //var str = String.Format("Flex diagnostic Data. Device at port {0}, access to network {1}", port,networkAccess);
        }
示例#2
0
文件: Program.cs 项目: TommyAGK/Flex
        // ReSharper disable once UnusedParameter.Local
        private static void Main(string[] args)
        {
            //LogThings.PurgeDebugLog(true);
                    //Console.CursorVisible = false;
                    ////LogThings.Report(@"Program.cs", @"Program started");
                    if (args.Length != 0)
                        {
                            if (args[0].ToUpper().Equals(@"-EGG"))
                                {
                                    EasterEgg = true;
                                }
                            if (args[0].ToUpper().Equals(@"-TESTING"))
                                {
                                    Testing = true;
                                    Logging = true;
                                }
                            if (args[0].ToUpper().Equals(@"-HELP"))
                                {
                                    Console.Clear();
                                    DrawHelperDragon();
                                    return;
                                }
                            if (args[0].ToUpper().Equals("-LOGGING"))
                                {
                                    Logging = true;
                                }
                            ////LogThings.Report(@"Program.cs", @"Called with argument: " + args[0]);
                        }
                    SelvSkryt();
                    ////LogThings.Report(@"Program.cs", @"Starting DataReader");
                    DataReader = new XmlDataReader(XmlDataReader.ConfigType.Students, RdReader);
                    DataReaderLang = new XmlDataReader();
                    ////LogThings.Report(@"Program.cs", @"Reading Languages from XML based on DataReader");
                    Langs = DataReaderLang.GetLangs(); // Read all lang words.

                    while (Configure == null)
                        {
                        //LogThings.Report(@"Program.cs", @"Loading config in relation to databases");
                            Configure = DataReader.GetConfig();
                        }
                    //LogThings.Report(@"Program.cs", @"Main loop begins");
                    while (true)
                        {
                            //RdReader.DetectComPort();
                            if (RdReader.GetData() != null)
                                {
                                    break;
                                }

                            Console.ForegroundColor = ConsoleColor.Black; // mehehehe
                            // ReSharper disable once ConditionIsAlwaysTrueOrFalse
                            if (Console.ReadKey().Key == ConsoleKey.Escape)
                                {
                                //LogThings.Report(@"Program.cs", @"Escape captured, ending program");
                                    Console.ResetColor();
                                    return;
                                }
                        }
                    //LogThings.Report(@"Program.cs", @"Reading data from database");
                    Data = Mngr.GetData();
        }