Beispiel #1
0
        //----------------------------------------------------------
        public List <string> SetSaveData( )
        {
            List <string> lines = new List <string>();

            if (data == null)
            {
                return(lines);
            }
            //ヘッダー
            lines.Add(D_Header);
            lines.Add("");
            //コメント
            lines.Add(D_Comment);
            if (data.Comment.Count > 0)
            {
                foreach (string s in data.Comment)
                {
                    lines.Add(s);
                }
            }
            lines.Add("");
            //パラメータブロック
            data.ChkTimes();
            lines.Add(D_Param);
            data.ToParams();
            foreach (ard_prms p in data.Params)
            {
                lines.Add(p.Tag + TAB + p.Value);
            }
            lines.Add("");
            //CellName
            lines.Add(D_CellName);
            for (int i = 0; i < data.CellCount; i++)
            {
                string s = i.ToString() + TAB + data.CellCaption(i);
                lines.Add(s);
            }
            lines.Add("");
            //Memo
            lines.Add(D_Memo);
            for (int i = 0; i < data.FrameCount; i++)
            {
                string s = data.Memo(i);
                if (s != string.Empty)
                {
                    s = FrameStr(i + 1) + TAB + s;
                    lines.Add(s);
                }
            }
            lines.Add("");
            //FrameEnabled
            lines.Add(D_FrameEnabled);
            int[] fe = data.getFrameEnabled();
            for (int i = 0; i < fe.Length; i++)
            {
                if (fe[i] < 0)
                {
                    fe[i] = 1;
                }
                else
                {
                    fe[i] = 0;
                }
            }

            lines.Add(FrameStr(1) + TAB + fe[0].ToString());
            for (int i = 1; i < fe.Length; i++)
            {
                if (fe[i - 1] != fe[i])
                {
                    lines.Add(FrameStr(i + 1) + TAB + fe[i].ToString());
                }
            }
            lines.Add("");
            //cellData
            lines.Add(D_CellDataStart);
            for (int i = 0; i < data.CellCount; i++)
            {
                if (data.IsCellData(i))
                {
                    lines.Add(D_Cell + TAB + i.ToString());
                    int c = data.GetCellData(i, 0);
                    lines.Add(FrameStr(1) + TAB + c.ToString());
                    int bef = c;
                    for (int frm = 1; frm < data.FrameCount; frm++)
                    {
                        c = data.GetCellData(i, frm);
                        if (c != bef)
                        {
                            lines.Add(FrameStr(frm + 1) + TAB + c.ToString());
                        }
                        bef = c;
                    }
                    lines.Add(D_CellEnd + TAB + i.ToString());
                }
            }
            lines.Add(D_End);
            return(lines);
        }
Beispiel #2
0
        //******************************************************
        private bool GetData()
        {
            if (chkFps() == false)
            {
                return(false);
            }

            m_FrameCount = 0;
            if (m_IsFrameEnabled == true)
            {
                m_FrameCount = tsd.FrameCountTrue;
            }
            else
            {
                m_FrameCount = tsd.FrameCount;
            }
            m_Sheet3 = (tsd.PageSec == TSPageSec.sec3);

            m_PageFrame  = ((int)tsd.PageSec * (int)tsd.FrameRate);
            m_PageFrameH = m_PageFrame / 2;

            int p = (m_FrameCount / m_PageFrame);

            if ((m_FrameCount % m_PageFrame) > 0)
            {
                p++;
            }
            m_PageCount = p;

            m_LastCount = m_FrameCount % (int)tsd.FrameRate;

            m_CellCount = tsd.CellCount;
            if (m_Sheet3)
            {
                if (m_CellCount > CellCount3)
                {
                    MessageBox.Show("すみません。3秒シートでは、セルレイヤは、" + CellCount3.ToString() + "枚までしか印刷されません。");
                    m_CellCount = CellCount3;
                }
            }
            else
            {
                if (m_CellCount > CellCount)
                {
                    MessageBox.Show("すみません。6秒シートでは、セルレイヤは、" + CellCount.ToString() + "枚までしか印刷されません。");
                    m_CellCount = CellCount;
                }
            }

            Array.Resize(ref m_data, m_CellCount);
            for (int i = 0; i < m_CellCount; i++)
            {
                Array.Resize(ref m_data[i], m_FrameCount);
                int[] cd;
                if (m_IsFrameEnabled == true)
                {
                    cd = tsd.GetCellDataTrue(i);
                }
                else
                {
                    cd = tsd.GetCellData(i);
                }
                for (int j = 0; j < m_FrameCount; j++)
                {
                    m_data[i][j] = cd[j];
                }
            }

            if (m_memo.Length != m_FrameCount)
            {
                Array.Resize(ref m_memo, m_FrameCount);
            }

            GetPrintSize();

            return(true);
        }