Пример #1
0
        private string  ConstructInstrumentFileName(string sipperFileName)
        {
            String instDataDir = OSservices.AddSlash(PicesSipperVariables.SipperInterfaceDir()) + "InstrumentData";

            if (instDataDir == "")
            {
                instDataDir = OSservices.AddSlash(PicesSipperVariables.SipperInterfaceDir()) + "InstrumentData";
            }
            OSservices.CreateDirectory(instDataDir);

            string instDataRootName = sipperFileName;

            if (instDataRootName == "")
            {
                instDataRootName = "InstrumentData";
            }
            else
            {
                instDataRootName = instDataRootName + "_InstrumentData";
            }

            string instDataFileName = OSservices.AddSlash(instDataDir) + instDataRootName + ".txt";

            return(instDataFileName);
        } /* ConstructInstrumentFileName */
Пример #2
0
        public void  Load()
        {
            string temp = "";

            headerRec = new SipperHeaderRec();

            string sipperInterfaceDir = PicesSipperVariables.SipperInterfaceDir();

            //checking to see if the config file exist and if so load that first
            if (!File.Exists(sipperConfigurationFileName))
            {
                loadedFromConfigFile = false;
            }
            else
            {
                StreamReader Reader = new StreamReader(sipperConfigurationFileName);

                while ((temp = Reader.ReadLine()) != null)
                {
                    ParseConfigTextLine(temp);
                }

                Reader.Close();
                loadedFromConfigFile = true;
            }

            return;
        } /* Load */
Пример #3
0
        public SipperSimulator(String sipperFileName)
        {
            InitializeComponent();

            if (String.IsNullOrEmpty(sipperFileName))
            {
                sipperFileName = "C:\\Pices\\SipperFiles\\WB0813\\WB0813DSH09\\WB0813DSH09_03.spr";
            }

            //ConvertCTDfile ();

            simulatorDir = OSservices.AddSlash(OSservices.AddSlash(PicesSipperVariables.SipperInterfaceDir()) + "Simulator");

            configRec      = new SipperConfigRec();
            currentDataRow = new InstrumentData();

            conversationBuffer   = Queue.Synchronized(new Queue());
            serialPortBuffers    = new SerialPortBuffer[3];
            serialPortBuffers[0] = new SerialPortBuffer(512);
            serialPortBuffers[1] = new SerialPortBuffer(512);
            serialPortBuffers[2] = new SerialPortBuffer(512);

            // SplitFile ();
            // ChkFile ();
            //LoadSipperFile();

            ctdData         = new List <char>();
            ctdDataNextByte = 0;

            pitchRollData        = new ArrayList();
            pitchRollDataNextRow = 0;

            ExtractDataFromSIPPERFile(sipperFileName);

            LoadCameraLines();

            batteryPack  = new BatteryPack();
            sipperCamera = new SipperCamera();

            ctdThread      = new Thread(new ThreadStart(CTDDataInstrument));
            ctdThread.Name = "SipperCtdData";
            ctdThread.Start();

            pitchRollThread      = new Thread(new ThreadStart(PitchRollDataInstrument));
            pitchRollThread.Name = "SipperPitchRollData";
            pitchRollThread.Start();

            batteryPackThread      = new Thread(new ThreadStart(BatteryPackInstrument));
            batteryPackThread.Name = "SipperBatteryData";
            batteryPackThread.Start();

            LoadSipperFilesNames();
        }