Example #1
0
 private void LoadFrame(SignSetHighResolutionGraphicsFrame f)
 {
     cbFrmFrameType.SelectedIndex   = 2;
     tbFrmFrameRev.Text             = f.frameRev.ToString();
     cbFrmColour.SelectedValue      = f.colour.ToString();
     cbFrmConspicuity.SelectedValue = ((ConspicuityDevices)f.conspicuity).ToString();
     LoadGfx(f.pixels);
 }
Example #2
0
 private void SetFrameToCtrller(SignSetHighResolutionGraphicsFrame f, byte frmId, byte frmRev)
 {
     try
     {
         f.frameId  = frmId;
         f.frameRev = frmRev;
         if (cbFrmColour.SelectedIndex < 0 || cbFrmColour.SelectedIndex > 11)
         {
             throw new Exception("Illegal colour");
         }
         if (pixelHeight > 65535 || pixelWidth > 65535)
         {
             throw new Exception("Can't fit in Graphics Frame");
         }
         f.colour  = (FrameColour)Enum.Parse(typeof(FrameColour), cbFrmColour.SelectedValue.ToString());
         f.cd      = (ConspicuityDevices)Enum.Parse(typeof(ConspicuityDevices), cbFrmConspicuity.SelectedValue.ToString());
         f.columns = (ushort)pixelWidth;
         f.rows    = (ushort)pixelHeight;
         f.pixels  = new int[pixelWidth, pixelHeight];
         for (int x = 0; x < pixelWidth; x++)
         {
             for (int y = 0; y < pixelHeight; y++)
             {
                 f.pixels[x, y] = treatedPixels[x, y].R * 0x10000 +
                                  treatedPixels[x, y].G * 0x100 +
                                  treatedPixels[x, y].B;
             }
         }
         RemoteControllerLink ctrl = remoteConctrollerLinks[parameters.ControllerID];
         ControllerReply      rpl;
         lock (ctrl)
         {
             rpl = ctrl.SignSetHighResolutionGraphicsFrame(f);
         }
         if (rpl.status != ControllerReply.Status.SUCCESS)
         {
             throw new Exception(rpl.status.ToString());
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }