using System; using Microsoft.SPOT; using System.Text; namespace CPF { class InstrumentHandler { private static object IHLock = new Object(); private static StringBuilder SI = new StringBuilder("Sampling Instruments"); private static StructQueue.qStruct qS = new StructQueue.qStruct(); public static void init() { qS.byteArray = new byte[StructQueue.qRecordWidth]; } public static void sampleInstruments(int stationNum) { //need to actuallly sample the instruments //lock (IHLock) { Program.MessageQueue.Enqueue(UTF8Encoding.UTF8.GetBytes(EngrLogger.getPrefix(SI).ToString())); } Array.Clear(qS.byteArray, 0, qS.byteArray.Length); Array.Copy(UTF8Encoding.UTF8.GetBytes(SI.ToString()), qS.byteArray, SI.Length); qS.timeStamp = DateTime.Now; qS.state = Program.CPFState; qS.qRecordType = StructQueue.QRecordType.Optode; lock (IHLock) { Program.sQueue.Enqueue(qS); } } } }