示例#1
0
 private void Link()
 {
     try
     {
         Ret = null;
         MyConfig.TopSlopeMultiplier    = Convert.ToDouble(TopSlopeMultiplier.Text);
         MyConfig.BottomSlopeMultiplier = Convert.ToDouble(BottomSlopeMultiplier.Text);
         MyConfig.TopSlopeDX            = Convert.ToDouble(TopSlopeDX.Text);
         MyConfig.BottomSlopeDX         = Convert.ToDouble(BottomSlopeDX.Text);
         MyConfig.TopSlopeDY            = Convert.ToDouble(TopSlopeDY.Text);
         MyConfig.BottomSlopeDY         = Convert.ToDouble(BottomSlopeDY.Text);
         if (ifl == null || imng == null)
         {
             LoadAssemblyModule();
         }
         System.IO.FileStream f = new System.IO.FileStream(CatalogFile.Text, System.IO.FileMode.Open, System.IO.FileAccess.Read);
         Catalog Cat            = new Catalog(f);
         f.Close();
         Ret = ifl.Link(Cat, CHORUSFormat.Checked ? typeof(SySal.Scanning.Plate.IO.CHORUS.LinkedZone) : typeof(SySal.Scanning.Plate.IO.OPERA.LinkedZone));
         System.IO.FileStream o = new System.IO.FileStream(OutputFile.Text, System.IO.FileMode.Create);
         Ret.Save(o);
         o.Flush();
         o.Close();
     }
     catch (Exception x)
     {
         System.Windows.Forms.MessageBox.Show(x.ToString(), x.Message);
     }
 }
示例#2
0
        static SySal.Tracking.MIPEmulsionTrackInfo[] lzExtractMap(SySal.Scanning.Plate.LinkedZone lz, MapSide side, SySal.BasicTypes.Rectangle r, dMapFilter flt)
        {
            System.Collections.ArrayList ar = new System.Collections.ArrayList();
            int n;

            switch (side)
            {
            case MapSide.Base: n = lz.Length; break;

            case MapSide.Top: n = lz.Top.Length; break;

            case MapSide.Bottom: n = lz.Bottom.Length; break;

            default: throw new Exception("Internal inconsistency: side = " + side + " is not supported.");
            }
            int i;

            for (i = 0; i < n; i++)
            {
                SySal.Tracking.MIPEmulsionTrackInfo info;
                switch (side)
                {
                case MapSide.Base: info = lz[i].Info; break;

                case MapSide.Top: info = lz.Top[i].Info; break;

                case MapSide.Bottom: info = lz.Bottom[i].Info; break;

                default: throw new Exception("Internal inconsistency: side = " + side + " is not supported.");
                }
                if (info.Intercept.X < r.MinX || info.Intercept.X > r.MaxX || info.Intercept.Y < r.MinY || info.Intercept.Y > r.MaxY)
                {
                    continue;
                }
                if (flt == null || flt(info))
                {
                    ar.Add(info);
                }
            }
            return((SySal.Tracking.MIPEmulsionTrackInfo[])ar.ToArray(typeof(SySal.Tracking.MIPEmulsionTrackInfo)));
        }