Пример #1
0
        public State()
        {
            currentState = stateNormal;
            commands = new Dictionary<string, processCommand>();

            commands.Add("bad", receivedBad);
            commands.Add("0308", received308);
            commands.Add("0310", received310);
            commands.Add("030b", received30b);
        }
Пример #2
0
        static void Main(string[] args)
        {
            string connectionString = @"Driver={Microsoft Access Driver (*.mdb)};" +
             @"Dbq=C:\documents and settings\erikla\my documents\trunktracking.mdb;Uid=Admin;Pwd=;";

            connection = new OdbcConnection(connectionString);
            connection.Open();

            StreamReader stdin = new StreamReader(Console.OpenStandardInput());
            State state = new State();

            do
            {
                string line = stdin.ReadLine();
                State.currentState.doCommand(line);

            } while (stdin.EndOfStream == false);
            connection.Close();
        }
Пример #3
0
 public virtual void received308(OSW osw)
 {
     //Console.WriteLine("308");
     lastOSW = osw;
     currentState = state308;
 }
Пример #4
0
 public virtual void receivedOther(OSW osw)
 {
     //Console.WriteLine("Other: cmd: {0:X4}, group: {1:X4}", osw.command, osw.group);
     currentState = stateNormal;
 }
Пример #5
0
 public virtual void receivedFrequency(OSW osw)
 {
     //Console.WriteLine("Freq.");
     currentState = stateNormal;
 }
Пример #6
0
 public virtual void receivedBad(OSW osw)
 {
     //Console.WriteLine("Bad");
     currentState = stateBad;
 }
Пример #7
0
 public virtual void received310(OSW osw)
 {
     //Console.WriteLine("***310");
     currentState = stateNormal;
 }