Пример #1
0
        private void copyTableData(TableData srcTd, TableData dstTd, ref PcmFile dstPCM)
        {
            frmTableEditor srcTE = new frmTableEditor();

            srcTE.PCM = PCM;
            srcTE.loadTable(srcTd);
            frmTableEditor dstTE = new frmTableEditor();

            dstTE.PCM = dstPCM;
            dstTE.loadTable(dstTd);

            uint srcAddr = (uint)(srcTd.addrInt + srcTd.Offset);
            int  srcStep = getElementSize(srcTd.DataType);
            uint dstAddr = (uint)(dstTd.addrInt + dstTd.Offset);
            int  dstStep = getElementSize(dstTd.DataType);

            for (int r = 0; r < srcTd.Rows; r++)
            {
                for (int c = 0; c < srcTd.Columns; c++)
                {
                    double cellValue = srcTE.getValue(srcAddr, srcTd);
                    dstTE.SaveValue(dstAddr, r, c, dstTd, cellValue);
                    srcAddr += (uint)srcStep;
                    dstAddr += (uint)dstStep;
                }
            }
            dstTE.saveTable();
            dstPCM = dstTE.PCM;
            srcTE.Dispose();
            dstTE.Dispose();
        }
Пример #2
0
        private void copyTableData(TableData srcTd, TableData dstTd, ref PcmFile dstPCM)
        {
            frmTableEditor srcTE = new frmTableEditor();

            srcTE.prepareTable(PCM, srcTd, null, "A");
            //srcTE.loadTable();
            frmTableEditor dstTE = new frmTableEditor();

            dstTE.prepareTable(dstPCM, dstTd, null, "A");
            //dstTE.loadTable();

            for (int cell = 0; cell < srcTE.compareFiles[0].tableInfos[0].tableCells.Count; cell++)
            {
                TableCell srcTc = srcTE.compareFiles[0].tableInfos[0].tableCells[cell];
                TableCell dstTc = dstTE.compareFiles[0].tableInfos[0].tableCells[cell];
                dstTc.saveValue((double)srcTc.lastValue);
            }

            dstTE.saveTable();
            srcTE.Dispose();
            dstTE.Dispose();
        }