コード例 #1
0
ファイル: frmMain.cs プロジェクト: Unisens/unisens4csharp
        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();
                }
            }
        }
コード例 #2
0
ファイル: frmMain.cs プロジェクト: Unisens/unisens4csharp
 private void btnVxml_Click(object sender, EventArgs e)
 {
     org.unisens.Unisens u = null;
     try
     {
         UnisensFactory uf = UnisensFactoryBuilder.createFactory();
         u = uf.createUnisens(folderDialogue.SelectedPath);
         ValuesEntry ve = u.createValuesEntry("values.xml", new String[] { "A", "B" }, DataType.INT16, 250);
         ve.setFileFormat(ve.createXmlFileFormat());
         ve.append(new Value(1320, new short[] { 1, 4 }));
         ve.append(new Value(22968, new short[] { 2, 5 }));
         ve.append(new Value(30232, new short[] { 3, 6 }));
         u.save();
         ShowInfo("Parse file {values.xml} suceed!");
     }
     catch (Exception ex)
     {
         ShowError(ex.Message);
     }
     finally
     {
         if (u != null)
         {
             u.closeAll();
         }
     }
 }
コード例 #3
0
ファイル: frmMain.cs プロジェクト: Unisens/unisens4csharp
        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();
                }
            }
        }
コード例 #4
0
ファイル: frmMain.cs プロジェクト: Unisens/unisens4csharp
        private void btnExml_Click(object sender, EventArgs e)
        {
            org.unisens.Unisens u = null;
            try
            {
                UnisensFactory uf = UnisensFactoryBuilder.createFactory();

                u = uf.createUnisens(folderDialogue.SelectedPath);
                var ee = u.createEventEntry("event.xml", 1000);
                ee.setFileFormat(ee.createXmlFileFormat());
                ee.append(new Event(124, "N", "NORMAL"));
                ee.append(new Event(346, "N", "NORMAL"));
                ee.append(new Event(523, "V", "PVC"));
                u.save();
                ShowInfo("Parse file {event.xml} suceed!");
            }
            catch (Exception ex)
            {
                ShowError(ex.Message);
            }
            finally
            {
                if (u != null)
                {
                    u.closeAll();
                }
            }
        }