Esempio n. 1
0
        public Form1()
        {
            InitializeComponent();

            mng            = new ManageForms(this);
            mng.SendClick += new ManageForms.SendClickHandler(formOption_Close);

            serial = SerialFactory.CreateSerial(this.serialPort1);
            SetSerialPort();
            baza = new DBConnect(Properties.Settings.Default.stringServer, Properties.Settings.Default.stringUID, Properties.Settings.Default.stringDBPassword, Properties.Settings.Default.stringDatabase);

            btnDisconnectSerial.Enabled = false;
            panelClosedSerial.BackColor = Color.Red;

            serialMutex = new object();


            foreach (timespan tspan in timespans)
            {
                cmbAggregation.Items.Add(tspan);
            }
            cmbAggregation.SelectedIndex = 1;

            appValidated = false;

            sqlToSaveCollection = new List <string>();
            dbCollectionMutex   = new object();

            saverTo = new SaverToDB();

            server = new WinFormServiceApplication.Server();
            server.SendConnectedClient   += new WinFormServiceApplication.Server.SendClientConnectionStatus(ServerConnection_Change);
            server.SenDisconnectedClient += new WinFormServiceApplication.Server.SendClientDisconnectionStatus(Server_DisconnectedClient);
            server.SendLedInfo           += new WinFormServiceApplication.Server.SendLedConfirmation(LightLed);

            phoneClients = new List <PhoneClient>();
            phoneClients.Add(phoneClient1);
            phoneClient1.SenDisconnectedClient += new PhoneClient.SendDisconnectBtnPressed(client1_Disconnect);
            phoneClients.Add(phoneClient2);
            phoneClient2.SenDisconnectedClient += new PhoneClient.SendDisconnectBtnPressed(client2_Disconnect);
            phoneClients.Add(phoneClient3);
            phoneClient3.SenDisconnectedClient += new PhoneClient.SendDisconnectBtnPressed(client3_Disconnect);
            phoneClients.Add(phoneClient4);
            phoneClient4.SenDisconnectedClient += new PhoneClient.SendDisconnectBtnPressed(client4_Disconnect);
            phoneClients.Add(phoneClient5);
            phoneClient5.SenDisconnectedClient += new PhoneClient.SendDisconnectBtnPressed(client5_Disconnect);

            ValidateApp();
        }
Esempio n. 2
0
 public Form1()
 {
     InitializeComponent();
     _manager = new SerialFactory();
 }