Esempio n. 1
0
        public MainForm(bool testMode)
        {
            appTestArg = testMode;

            InitializeComponent();

            deviceList[0].SetNotificationWindowHandle(Handle, false);
            deviceList[0].Test = AppTestArg;
            deviceList[0].Error += new SemtechLib.General.Events.ErrorEventHandler(device_Error);
            deviceList[0].Connected += new EventHandler(device_Connected);
            deviceList[0].Disconected += new EventHandler(device_Disconected);
            deviceList[0].PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(device_PropertyChanged);
            deviceList[0].PacketHandlerStarted += new EventHandler(device_PacketHandlerStarted);
            deviceList[0].PacketHandlerStoped += new EventHandler(device_PacketHandlerStoped);

            deviceList[1].SetNotificationWindowHandle(Handle, false);
            deviceList[1].Test = AppTestArg;
            deviceList[1].Error += new SemtechLib.General.Events.ErrorEventHandler(device_Error);
            deviceList[1].Connected += new EventHandler(device_Connected);
            deviceList[1].Disconected += new EventHandler(device_Disconected);
            deviceList[1].PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(device_PropertyChanged);
            deviceList[1].PacketHandlerStarted += new EventHandler(device_PacketHandlerStarted);
            deviceList[1].PacketHandlerStoped += new EventHandler(device_PacketHandlerStoped);

            toolStripContainer1.BottomToolStripPanel.SuspendLayout();
            toolStripContainer1.TopToolStripPanel.SuspendLayout();
            toolStripContainer1.SuspendLayout();

            deviceViewList[0].Name = "sx1276ViewControl";
            ((Control)deviceViewList[0]).Location = new Point(0, 0);
            ((Control)deviceViewList[0]).Size = new Size(1008, 525);
            deviceViewList[0].Device = deviceList[0];
            deviceViewList[0].Dock = DockStyle.Fill;
            deviceViewList[0].Enabled = false;
            deviceViewList[0].Visible = true;
            deviceViewList[0].TabIndex = 0;
            deviceViewList[0].Error += new SemtechLib.General.Events.ErrorEventHandler(deviceViewControl_Error);
            deviceViewList[0].DocumentationChanged += new DocumentationChangedEventHandler(deviceViewControl_DocumentationChanged);

            deviceViewList[1].Name = "sx1276LoRaViewControl";
            ((Control)deviceViewList[1]).Location = new Point(0, 0);
            ((Control)deviceViewList[1]).Size = new Size(1008, 525);
            deviceViewList[1].Device = deviceList[1];
            deviceViewList[1].Dock = DockStyle.Fill;
            deviceViewList[1].Enabled = false;
            deviceViewList[1].Visible = false;
            deviceViewList[1].TabIndex = 0;
            deviceViewList[1].Error += new SemtechLib.General.Events.ErrorEventHandler(deviceViewControl_Error);
            deviceViewList[1].DocumentationChanged += new DocumentationChangedEventHandler(deviceViewControl_DocumentationChanged);

            toolStripContainer1.ContentPanel.Controls.Add((Control)deviceViewList[0]);
            toolStripContainer1.ContentPanel.Controls.Add((Control)deviceViewList[1]);

            deviceViewControl = deviceViewList[0];

            toolStripContainer1.BottomToolStripPanel.ResumeLayout(false);
            toolStripContainer1.BottomToolStripPanel.PerformLayout();
            toolStripContainer1.TopToolStripPanel.ResumeLayout(false);

            toolStripContainer1.TopToolStripPanel.PerformLayout();

            toolStripContainer1.ResumeLayout(false);

            toolStripContainer1.PerformLayout();

            try
            {
                appSettings = new ApplicationSettings();
            }
            catch (Exception ex)
            {
                SetError(ex.Message);
            }

            if (!appTestArg)
                Text = AssemblyTitle ?? "";
            else
                Text = AssemblyTitle + " - ..::: TEST :::..";
        }
Esempio n. 2
0
		public MainForm(bool testMode)
		{
			appTestArg = testMode;
			InitializeComponent();
			try
			{
				appSettings = new ApplicationSettings();
			}
			catch (Exception ex)
			{
				tsLblStatus.Text = "ERROR: " + ex.Message;
			}
			sx1231.Test = testMode;
			sx1231ViewControl.SX1231 = sx1231;

			if (!appTestArg)
				Text = AssemblyTitle ?? "";
			else
				Text = AssemblyTitle + " - ..::: TEST :::..";
		}
Esempio n. 3
0
 public void SaveConfiguration()
 {
     ApplicationSettings.SaveDocument(this.Document, "ApplicationSettings.xml");
 }
Esempio n. 4
0
 public void ClearSettings()
 {
     this.Document = ApplicationSettings.CreateDocument();
 }
Esempio n. 5
0
 public ApplicationSettings()
 {
     Document = ApplicationSettings.OpenDocument();
 }
Esempio n. 6
0
 public void Dispose()
 {
     ApplicationSettings.SaveDocument(this.Document, "ApplicationSettings.xml");
 }