private Form1() { InitializeComponent(); Label[] labels = { label1, label2, label3, label4, label5, label6, label7, label8 }; ArrayList labelList = new ArrayList(labels); this.labelManager = new LabelManager(labelList); this.dataLogger = DataLogger.getInstance(this); this.connectionManager = ConnectionManager.getInstance(this); this.dataStorage = DataStorage.getInstance(); // logging rate selection foreach (int i in dataStorage.getLogRates()) { comboBox3.Items.Add(i); } startLogging.Enabled = false; // button9 and button10 control the serial data transfer timeout enable // system starts with serialTiemoutEnable true, and the option to disable it on enableTimeout.Enabled = false; // button10 is enable disableTimeout.Enabled = true; // button9 is disable enableTimeout.Text = ""; refreshData.Enabled = false; startLogging.Enabled = false; // richTextBox1 is where the serial output is displayed. // disable the logging buttons until the files exist wipeLogs.Enabled = false; startLogging.Enabled = false; }
public static ConnectionManager getInstance() { if (instance == null) { instance = new ConnectionManager(); } return instance; }
public static ConnectionManager getInstance(Form1 form1) { if (instance == null) { instance = getInstance(); } instance.setForm(form1); return instance; }
public static DataLogger getInstance(ConnectionManager conn1) { instance = getInstance(); instance.setConnManager(conn1); return instance; }
private void setConnManager(ConnectionManager conn1) { this.connectionManager = conn1; }