Exemple #1
0
        private void btnScsv_Click(object sender, EventArgs e)
        {
            org.unisens.Unisens u = null;
            try
            {
                UnisensFactory uf = UnisensFactoryBuilder.createFactory();

                u = uf.createUnisens(folderDialogue.SelectedPath);
                var           se  = u.createSignalEntry("signal.csv", new String[] { "A", "B" }, DataType.INT16, 250);
                var           A   = new short[][] { new short[] { 1, 4 }, new short[] { 2, 5 }, new short[] { 3, 6 } };
                CsvFileFormat cff = se.createCsvFileFormat();
                cff.setSeparator(";");
                cff.setDecimalSeparator(".");
                se.setFileFormat(cff);
                se.append(A);
                u.save();
                ShowInfo("Parse file {signal.csv} suceed!");
            }
            catch (Exception ex)
            {
                ShowError(ex.Message);
            }
            finally
            {
                if (u != null)
                {
                    u.closeAll();
                }
            }
        }
Exemple #2
0
        private void btnSbin_Click(object sender, EventArgs e)
        {
            org.unisens.Unisens u = null;
            try
            {
                UnisensFactory uf = UnisensFactoryBuilder.createFactory();

                u = uf.createUnisens(folderDialogue.SelectedPath);
                SignalEntry se = u.createSignalEntry("signal.bin", new String[] { "A", "B" }, DataType.INT16, 250);
                var         A  = new short[][] { new short[] { 1, 4 }, new short[] { 2, 5 }, new short[] { 3, 6 } };
                //se.setFileFormat(se.createXmlFileFormat());
                var B = new short[][] { new short[] { 2, 4 }, new short[] { 3, 5 }, new short[] { 4, 6 } };
                se.append(A);
                se.append(B);
                u.save();
                ShowInfo("Parse file {signal.bin} suceed!");
            }
            catch (Exception ex)
            {
                ShowError(ex.Message);
            }
            finally
            {
                if (u != null)
                {
                    u.closeAll();
                }
            }
        }