//--------------------------------------------------------------------// // M e t h o d // // b t n G e n e r a t e _ C l i c k // //--------------------------------------------------------------------// // // // Called when the 'Generate' button is clicked. // // // //--------------------------------------------------------------------// private void btnGenerate_Click(object sender, RoutedEventArgs e) { BinaryWriter binWriter = null; TargetCore.requestStreamOpen( ref binWriter, ToolCommonData.eToolIds.PrnPrint, ToolCommonData.eToolSubIds.None, ToolCommonData.ePrintLang.Unknown); copyPrnFile(_prnFilename, binWriter); TargetCore.requestStreamWrite(false); }
//--------------------------------------------------------------------// // M e t h o d // // s e n d R e q u e s t // //--------------------------------------------------------------------// // // // Send previously generated request data to target. // // // //--------------------------------------------------------------------// public static void sendRequest(PJLCommands.eCmdIndex cmdIndx) { PJLCommands.eRequestType reqType = PJLCommands.getType(cmdIndx); if ((reqType == PJLCommands.eRequestType.FSDirList) || (reqType == PJLCommands.eRequestType.FSQuery)) { //------------------------------------------------------------// // // // PJL FileSystem query; request types: // // - FSDIRLIST // // - FSQUERY // // Response from printer expected. // // // //------------------------------------------------------------// TargetCore.requestStreamWrite(true); } else if (reqType == PJLCommands.eRequestType.FSUpload) { //------------------------------------------------------------// // // // PJL FileSystem upload to host workstation; request types: // // - FSUPLOAD // // Response from printer expected - write this direct to the // // target file (it could be (much) larger than standard reply // // buffer. // // // //------------------------------------------------------------// TargetCore.requestStreamWrite(true); } else { //------------------------------------------------------------// // // // PJL FileSystem action; request types: // // - FSAPPEND // // - FSDELETE // // - FSDOWNLOAD // // - FSINIT // // - FSMDKIR // // Response from printer not expected. // // // //------------------------------------------------------------// TargetCore.requestStreamWrite(false); } }
//--------------------------------------------------------------------// // M e t h o d // // s e n d R e q u e s t // //--------------------------------------------------------------------// // // // Send generated status readback request data to target. // // // //--------------------------------------------------------------------// public static void sendRequest() { TargetCore.requestStreamWrite(true); }
//--------------------------------------------------------------------// // M e t h o d // // b t n G e n e r a t e _ C l i c k // //--------------------------------------------------------------------// // // // Called when the 'Generate' button is clicked. // // // //--------------------------------------------------------------------// private void btnGenerate_Click(object sender, RoutedEventArgs e) { Int32 result = 0; Boolean bitmapOpen = false; //----------------------------------------------------------------// // // // Get current test metrics. // // Note that the relevant (PDL-specific) stored option values // // SHOULD already be up-to-date, since the fields all have // // associated 'OnChange' actions. ***** Not with WPF ????? ***** // // But we'll save them all anyway, to make sure. // // // //----------------------------------------------------------------// _indxPDL = cbPDL.SelectedIndex; _crntPDL = (ToolCommonData.ePrintLang)_subsetPDLs[_indxPDL]; pdlOptionsStore(); //----------------------------------------------------------------// // // // Generate test print file. // // // //----------------------------------------------------------------// bitmapOpen = ToolImageBitmapCore.bitmapOpen(_bitmapFilename); if (!bitmapOpen) { result = -1; } if (result == 0) { result = ToolImageBitmapCore.readBmpFileHeader(); } if (result == 0) { result = ToolImageBitmapCore.readBmpInfoHeader(); } if (result == 0) { result = ToolImageBitmapCore.readBmpPalette(); } if (result == 0) { BinaryWriter binWriter = null; TargetCore.requestStreamOpen( ref binWriter, ToolCommonData.eToolIds.ImageBitmap, ToolCommonData.eToolSubIds.None, _crntPDL); if (result == 0) { //--------------------------------------------------------// // // // Write test data to output file. // // // //--------------------------------------------------------// if (_crntPDL == ToolCommonData.ePrintLang.PCL) { ToolImageBitmapPCL.generateJob( binWriter, _subsetPaperSizes[_indxPaperSizePCL], _subsetPaperTypes[_indxPaperTypePCL], _subsetOrientations[_indxOrientationPCL], _destPosX, _destPosY, _destScalePercentX, _destScalePercentY, _indxRasterResolutionPCL); } else // if (_crntPDL == (Int32)ToolCommonData.ePrintLang.PCLXL) { ToolImageBitmapPCLXL.generateJob( binWriter, _subsetPaperSizes[_indxPaperSizePCLXL], _subsetPaperTypes[_indxPaperTypePCLXL], _subsetOrientations[_indxOrientationPCLXL], _destPosX, _destPosY, _destScalePercentX, _destScalePercentY); } } if (result == 0) { TargetCore.requestStreamWrite(false); } } if (bitmapOpen) { ToolImageBitmapCore.bitmapClose(); } }