using System;
using System.Runtime.InteropServices;
using System.Text;
using Matrox.MatroxImagingLibrary;
namespace MseqProcess
{
class ProcessingHookDataStruct
{
public MIL_ID MilDigitizer;
public MIL_ID MilImageDisp;
public MIL_ID MilSeqContext;
public MIL_INT ProcessedImageCount;
public ProcessingHookOperation ProcessingOperation;
}
class EncodingFrameEndHookDataStruct
{
public MIL_INT EncodedImageCount;
}
class DecodingFrameEndHookDataStruct
{
public MIL_INT DecodedImageCount;
public MIL_ID MilImageDisp;
}
enum ProcessingHookOperation
{
DISPLAY,
ENCODE
}
class Program
{
private const int BUFFERING_SIZE_MAX = 20;
private static readonly string SEQUENCE_FILE = MIL.M_TEMP_DIR + "SeqProcess.mp4";
private static readonly string REMOTE_SEQUENCE_FILE = "remote:
static int Main(string[] args)
{
MIL_ID MilApplication = MIL.M_NULL;
MIL_ID MilRemoteApplication = MIL.M_NULL;
MIL_ID MilSystem = MIL.M_NULL;
MIL_ID MilDigitizer = MIL.M_NULL;
MIL_ID MilDisplay = MIL.M_NULL;
MIL_ID MilImageDisp = MIL.M_NULL;
MIL_ID[] MilGrabBufferList = new MIL_ID[BUFFERING_SIZE_MAX];
MIL_ID MilCompressContext = MIL.M_NULL;
MIL_ID MilDecompressContext = MIL.M_NULL;
MIL_INT LicenseModules = 0;
MIL_INT MilSystemLocation = MIL.M_NULL;
MIL_INT MilGrabBufferListSize;
MIL_INT ProcessFrameCount = 0;
MIL_INT NbFrames = 0;
MIL_INT n = 0;
double EncodingDesiredFrameRate = 0.0;
double ProcessFrameRate = 0.0;
MIL_INT SeqProcessFilePathSize = 0;
StringBuilder SeqProcessFilePath = null;
ProcessingHookDataStruct ProcessingUserHookData = new ProcessingHookDataStruct();
EncodingFrameEndHookDataStruct EncodingFrameEndUserHookData = new EncodingFrameEndHookDataStruct();
DecodingFrameEndHookDataStruct DecodingFrameEndUserHookData = new DecodingFrameEndHookDataStruct();
MIL_INT SeqSystemType = MIL.M_NULL;
MIL.MappAllocDefault(MIL.M_DEFAULT, ref MilApplication, ref MilSystem, ref MilDisplay, ref MilDigitizer, ref MilImageDisp);
MIL.MsysInquire(MilSystem, MIL.M_OWNER_APPLICATION, ref MilRemoteApplication);
MilSystemLocation = MIL.MsysInquire(MilSystem, MIL.M_LOCATION, MIL.M_NULL);
if (MIL.MappInquire(MilRemoteApplication, MIL.M_PLATFORM_OS_TYPE, MIL.M_NULL) != MIL.M_OS_WINDOWS)
{
if (MilSystemLocation == MIL.M_REMOTE)
Console.WriteLine("The Distributed MIL server must run on a Windows system.");
else
Console.WriteLine("This example only works with a Windows system.");
Console.WriteLine("Press <Enter> to end.");
Console.ReadKey();
MIL.MappFreeDefault(MilApplication, MilSystem, MilDisplay, MilDigitizer, MilImageDisp);
return 0;
}
MIL.MappInquire(MilRemoteApplication, MIL.M_LICENSE_MODULES, ref LicenseModules);
if ((LicenseModules & MIL.M_LICENSE_JPEGSTD) != MIL.M_LICENSE_JPEGSTD)
{
Console.WriteLine("Need a Compression/Decompression license to run this example.");
Console.WriteLine("Press <Enter> to end.");
Console.ReadKey();
MIL.MappFreeDefault(MilApplication, MilSystem, MilDisplay, MilDigitizer, MilImageDisp);
return 0;
}
MIL.MappControl(MIL.M_DEFAULT, MIL.M_ERROR, MIL.M_PRINT_DISABLE);
for (MilGrabBufferListSize = 0; MilGrabBufferListSize < BUFFERING_SIZE_MAX; MilGrabBufferListSize++)
{
MIL.MbufAllocColor(MilSystem, MIL.MdigInquire(MilDigitizer, MIL.M_SIZE_BAND, MIL.M_NULL),
MIL.MdigInquire(MilDigitizer, MIL.M_SIZE_X, MIL.M_NULL),
MIL.MdigInquire(MilDigitizer, MIL.M_SIZE_Y, MIL.M_NULL),
8 + MIL.M_UNSIGNED, MIL.M_IMAGE + MIL.M_GRAB + MIL.M_PROC,
ref MilGrabBufferList[MilGrabBufferListSize]);
if (MilGrabBufferList[MilGrabBufferListSize] != MIL.M_NULL)
{
MIL.MbufClear(MilGrabBufferList[MilGrabBufferListSize], 0xFF);
}
else
{
break;
}
}
MIL.MappControl(MIL.M_DEFAULT, MIL.M_ERROR, MIL.M_PRINT_ENABLE);
for (n = 0; n < 2 && MilGrabBufferListSize > 0; n++)
{
MilGrabBufferListSize--;
MIL.MbufFree(MilGrabBufferList[MilGrabBufferListSize]);
}
if (MilGrabBufferListSize == 0)
{
Console.WriteLine("!!! No grab buffers have been allocated. Need to set more Non-Paged Memory. !!!");
MIL.MappFreeDefault(MilApplication, MilSystem, MilDisplay, MilDigitizer, MilImageDisp);
Console.WriteLine("Press <Enter> to end.");
Console.ReadKey();
return 1;
}
ProcessingUserHookData.MilDigitizer = MilDigitizer;
ProcessingUserHookData.MilSeqContext = MIL.M_NULL;
ProcessingUserHookData.MilImageDisp = MilImageDisp;
ProcessingUserHookData.ProcessedImageCount = 0;
ProcessingUserHookData.ProcessingOperation = ProcessingHookOperation.DISPLAY;
GCHandle hUserData = GCHandle.Alloc(ProcessingUserHookData);
MIL_DIG_HOOK_FUNCTION_PTR ProcessingFunctionDelegate = new MIL_DIG_HOOK_FUNCTION_PTR(ProcessingFunction);
MIL.MdigProcess(MilDigitizer, MilGrabBufferList, MilGrabBufferListSize, MIL.M_START, MIL.M_DEFAULT, ProcessingFunctionDelegate, GCHandle.ToIntPtr(hUserData));
Console.Write("\nH.264 IMAGE SEQUENCE COMPRESSION.\n");
Console.Write("---------------------------------\n\n");
Console.Write("Press <Enter> to start compression.\r");
Console.ReadKey();
MIL.MdigProcess(MilDigitizer, MilGrabBufferList, MilGrabBufferListSize, MIL.M_STOP, MIL.M_DEFAULT, ProcessingFunctionDelegate, GCHandle.ToIntPtr(hUserData));
MIL.MdigInquire(MilDigitizer, MIL.M_PROCESS_FRAME_RATE, ref EncodingDesiredFrameRate);
Console.Write("Grabbing frames at {0:0.00} frames/sec.\n", EncodingDesiredFrameRate);
MIL.MseqAlloc(MilSystem, MIL.M_DEFAULT, MIL.M_SEQ_COMPRESS, MIL.M_DEFAULT, MIL.M_DEFAULT, ref MilCompressContext);
MIL.MseqDefine(MilCompressContext, MIL.M_SEQ_OUTPUT(0) + MIL.M_SEQ_DEST(0), MIL.M_FILE,
(MilSystemLocation != MIL.M_REMOTE ? SEQUENCE_FILE : REMOTE_SEQUENCE_FILE),
MIL.M_FILE_FORMAT_MP4);
MIL.MseqControl(MilCompressContext, MIL.M_CONTEXT, MIL.M_STREAM_BIT_RATE_MODE, MIL.M_VARIABLE);
MIL.MseqControl(MilCompressContext, MIL.M_CONTEXT, MIL.M_STREAM_BIT_RATE, 5000);
MIL.MseqControl(MilCompressContext, MIL.M_CONTEXT, MIL.M_STREAM_BIT_RATE_MAX, 5000);
if (EncodingDesiredFrameRate != 0)
MIL.MseqControl(MilCompressContext, MIL.M_CONTEXT, MIL.M_STREAM_FRAME_RATE, EncodingDesiredFrameRate);
MIL.MseqControl(MilCompressContext, MIL.M_CONTEXT, MIL.M_STREAM_FRAME_RATE_MODE, MIL.M_VARIABLE);
MIL.MseqControl(MilCompressContext, MIL.M_CONTEXT, MIL.M_STREAM_QUALITY, 100);
MIL.MseqControl(MilCompressContext, MIL.M_CONTEXT, MIL.M_STREAM_PROFILE, MIL.M_PROFILE_HIGH);
MIL.MseqControl(MilCompressContext, MIL.M_CONTEXT, MIL.M_STREAM_LEVEL, MIL.M_LEVEL_4_2);
MIL.MseqControl(MilCompressContext, MIL.M_CONTEXT, MIL.M_STREAM_GROUP_OF_PICTURE_SIZE, 30);
EncodingFrameEndUserHookData.EncodedImageCount = 0;
GCHandle EncodingFrameEndUserHookDataHandle = GCHandle.Alloc(EncodingFrameEndUserHookData);
MIL_SEQ_HOOK_FUNCTION_PTR FrameEncodingEndFunctionDelegate = new MIL_SEQ_HOOK_FUNCTION_PTR(FrameEncodingEndFunction);
MIL.MseqHookFunction(MilCompressContext, MIL.M_FRAME_END, FrameEncodingEndFunctionDelegate, GCHandle.ToIntPtr(EncodingFrameEndUserHookDataHandle));
MIL.MseqControl(MilCompressContext, MIL.M_CONTEXT, MIL.M_BUFFER_SAMPLE, MilGrabBufferList[0]);
MIL.MappControl(MIL.M_ERROR, MIL.M_PRINT_DISABLE);
MIL.MseqProcess(MilCompressContext, MIL.M_START, MIL.M_ASYNCHRONOUS);
if (CheckMseqProcessError(MilApplication, MilCompressContext))
{
MIL.MseqProcess(MilCompressContext, MIL.M_STOP, MIL.M_NULL);
MIL_INT SourceSizeX = 0;
MIL_INT SourceSizeY = 0;
double SourceFPS = 0;
MIL.MdigInquire(MilDigitizer, MIL.M_SIZE_X, ref SourceSizeX);
MIL.MdigInquire(MilDigitizer, MIL.M_SIZE_Y, ref SourceSizeY);
MIL.MdigInquire(MilDigitizer, MIL.M_PROCESS_FRAME_RATE, ref SourceFPS);
Console.WriteLine("Unable to perform H.264 encoding with the current input source of");
Console.WriteLine("{0} X {1} @ {2:0.00} fps.", SourceSizeX, SourceSizeY, SourceFPS);
Console.WriteLine();
Console.WriteLine("Example parameters are optimized for sources of");
Console.WriteLine("1920 x 1080 @ 60 fps.");
Console.WriteLine();
Console.WriteLine("You can try changing encoding parameters to better match your source.");
Console.WriteLine();
Console.WriteLine("Press <Enter> to end.");
Console.ReadKey();
while (MilGrabBufferListSize > 0)
{
MIL.MbufFree(MilGrabBufferList[--MilGrabBufferListSize]);
MilGrabBufferList[MilGrabBufferListSize] = MIL.M_NULL;
}
MIL.MseqFree(MilCompressContext);
MIL.MappFreeDefault(MilApplication, MilSystem, MilDisplay, MilDigitizer, MilImageDisp);
return 0;
}
MIL.MappControl(MIL.M_ERROR, MIL.M_PRINT_ENABLE);
Console.Write("Live image capture and compression to file using ");
MIL.MseqInquire(MilCompressContext, MIL.M_CONTEXT, MIL.M_CODEC_TYPE, ref SeqSystemType);
if (SeqSystemType == MIL.M_HARDWARE + MIL.M_QSV)
{
Console.WriteLine("Hardware acceleration.");
}
else
{
Console.WriteLine("Software implementation.");
}
ProcessingUserHookData.MilSeqContext = MilCompressContext;
ProcessingUserHookData.ProcessedImageCount = 0;
ProcessingUserHookData.ProcessingOperation = ProcessingHookOperation.ENCODE;
MIL.MdigProcess(MilDigitizer, MilGrabBufferList, MilGrabBufferListSize, MIL.M_START, MIL.M_DEFAULT, ProcessingFunctionDelegate, GCHandle.ToIntPtr(hUserData));
Console.WriteLine("Press <Enter> to stop.\n");
Console.ReadKey();
MIL.MdigProcess(MilDigitizer, MilGrabBufferList, MilGrabBufferListSize, MIL.M_STOP + MIL.M_WAIT, MIL.M_DEFAULT, ProcessingFunctionDelegate, GCHandle.ToIntPtr(hUserData));
hUserData.Free();
MIL.MseqProcess(MilCompressContext, MIL.M_STOP, MIL.M_WAIT);
GC.KeepAlive(FrameEncodingEndFunctionDelegate);
EncodingFrameEndUserHookDataHandle.Free();
MIL.MdigInquire(MilDigitizer, MIL.M_PROCESS_FRAME_COUNT, ref ProcessFrameCount);
MIL.MdigInquire(MilDigitizer, MIL.M_PROCESS_FRAME_RATE, ref ProcessFrameRate);
Console.WriteLine("{0} frames encoded at {1:0.00} frames/sec ({2:0.0} ms/frame).", ProcessFrameCount, ProcessFrameRate, 1000.0 / ProcessFrameRate);
Console.WriteLine();
MIL.MseqInquire(MilCompressContext, MIL.M_SEQ_OUTPUT(0) + MIL.M_SEQ_DEST(0), MIL.M_STREAM_FILE_NAME_SIZE, ref SeqProcessFilePathSize);
SeqProcessFilePath = new StringBuilder((int)SeqProcessFilePathSize);
MIL.MseqInquire(MilCompressContext, MIL.M_SEQ_OUTPUT(0) + MIL.M_SEQ_DEST(0), MIL.M_STREAM_FILE_NAME, SeqProcessFilePath);
Console.WriteLine("The video sequence file was written to:");
Console.WriteLine("{0}.", SeqProcessFilePath.ToString());
Console.WriteLine();
Console.WriteLine("It can be played back using any compatible video player.");
while (MilGrabBufferListSize > 0)
{
MIL.MbufFree(MilGrabBufferList[--MilGrabBufferListSize]);
MilGrabBufferList[MilGrabBufferListSize] = MIL.M_NULL;
}
MIL.MseqFree(MilCompressContext);
Console.WriteLine("Press <Enter> to replay encoded sequence.");
Console.ReadKey();
MIL.MseqAlloc(MilSystem, MIL.M_DEFAULT, MIL.M_SEQ_DECOMPRESS,
MIL.M_DEFAULT, MIL.M_DEFAULT, ref MilDecompressContext);
MIL.MseqDefine(MilDecompressContext, MIL.M_SEQ_INPUT(0), MIL.M_FILE,
(MilSystemLocation != MIL.M_REMOTE ? SEQUENCE_FILE : REMOTE_SEQUENCE_FILE),
MIL.M_FILE_FORMAT_MP4);
double outputFrameRate = 0.0;
MIL.MseqInquire(MilDecompressContext, MIL.M_SEQ_INPUT(0), MIL.M_STREAM_FRAME_RATE, ref outputFrameRate);
Console.WriteLine();
Console.WriteLine("Replaying file at {0:0.00} frames/second.", outputFrameRate);
DecodingFrameEndUserHookData.DecodedImageCount = 0;
DecodingFrameEndUserHookData.MilImageDisp = MilImageDisp;
GCHandle DecodingFrameEndUserHookDataHandle = GCHandle.Alloc(DecodingFrameEndUserHookData);
MIL_SEQ_HOOK_FUNCTION_PTR FrameDecodingEndFunctionDelegate = new MIL_SEQ_HOOK_FUNCTION_PTR(FrameDecodingEndFunction);
MIL.MseqHookFunction(MilDecompressContext, MIL.M_FRAME_END, FrameDecodingEndFunctionDelegate, GCHandle.ToIntPtr(DecodingFrameEndUserHookDataHandle));
MIL.MseqProcess(MilDecompressContext, MIL.M_START, MIL.M_ASYNCHRONOUS);
Console.WriteLine("Press <Enter> to stop.\n");
Console.ReadKey();
MIL.MseqProcess(MilDecompressContext, MIL.M_STOP, MIL.M_NULL);
GC.KeepAlive(FrameDecodingEndFunctionDelegate);
DecodingFrameEndUserHookDataHandle.Free();
MIL.MseqFree(MilDecompressContext);
Console.WriteLine("Press <Enter> to end.");
Console.ReadKey();
MIL.MappFreeDefault(MilApplication, MilSystem, MilDisplay, MilDigitizer, MilImageDisp);
return 0;
}
private const int STRING_LENGTH_MAX = 20;
private const int STRING_POS_X = 20;
private const int STRING_POS_Y = 20;
static MIL_INT ProcessingFunction(MIL_INT HookType, MIL_ID HookId, IntPtr HookDataPtr)
{
if (!IntPtr.Zero.Equals(HookDataPtr))
{
GCHandle hUserData = GCHandle.FromIntPtr(HookDataPtr);
ProcessingHookDataStruct UserHookDataPtr = hUserData.Target as ProcessingHookDataStruct;
MIL_ID ModifiedBufferId = MIL.M_NULL;
string Text;
MIL.MdigGetHookInfo(HookId, MIL.M_MODIFIED_BUFFER + MIL.M_BUFFER_ID, ref ModifiedBufferId);
switch (UserHookDataPtr.ProcessingOperation)
{
case ProcessingHookOperation.DISPLAY:
MIL.MbufCopy(ModifiedBufferId, UserHookDataPtr.MilImageDisp);
break;
case ProcessingHookOperation.ENCODE:
UserHookDataPtr.ProcessedImageCount++;
Console.Write("Processing frame #{0}.\r", UserHookDataPtr.ProcessedImageCount);
Text = string.Format("{0}", UserHookDataPtr.ProcessedImageCount);
MIL.MgraText(MIL.M_DEFAULT, ModifiedBufferId, STRING_POS_X, STRING_POS_Y, Text);
MIL.MseqFeed(UserHookDataPtr.MilSeqContext, ModifiedBufferId, MIL.M_DEFAULT);
MIL.MbufCopy(ModifiedBufferId, UserHookDataPtr.MilImageDisp);
break;
}
}
return 0;
}
static MIL_INT FrameEncodingEndFunction(MIL_INT HookType, MIL_ID HookId, IntPtr HookDataPtr)
{
if (!IntPtr.Zero.Equals(HookDataPtr))
{
GCHandle hUserData = GCHandle.FromIntPtr(HookDataPtr);
EncodingFrameEndHookDataStruct UserHookDataPtr = hUserData.Target as EncodingFrameEndHookDataStruct;
if (HookType == MIL.M_FRAME_END)
{
MIL_ID CompressedBufferId = MIL.M_NULL;
MIL_INT CompressedDataPtr = MIL.M_NULL;
MIL_INT CompressedDataSize = 0;
UserHookDataPtr.EncodedImageCount++;
MIL.MseqGetHookInfo(HookId, MIL.M_MODIFIED_BUFFER + MIL.M_BUFFER_ID, ref CompressedBufferId);
MIL.MbufInquire(CompressedBufferId, MIL.M_HOST_ADDRESS, ref CompressedDataPtr);
MIL.MbufInquire(CompressedBufferId, MIL.M_SIZE_BYTE, ref CompressedDataSize);
}
}
return 0;
}
static MIL_INT FrameDecodingEndFunction(MIL_INT HookType, MIL_ID HookId, IntPtr HookDataPtr)
{
if (!IntPtr.Zero.Equals(HookDataPtr))
{
GCHandle hUserData = GCHandle.FromIntPtr(HookDataPtr);
DecodingFrameEndHookDataStruct UserHookDataPtr = hUserData.Target as DecodingFrameEndHookDataStruct;
if (HookType == MIL.M_FRAME_END)
{
MIL_ID DecompressedBufferId = MIL.M_NULL;
UserHookDataPtr.DecodedImageCount++;
MIL.MseqGetHookInfo(HookId, MIL.M_MODIFIED_BUFFER + MIL.M_BUFFER_ID, ref DecompressedBufferId);
MIL.MbufCopy(DecompressedBufferId, UserHookDataPtr.MilImageDisp);
}
}
return 0;
}
private struct MSEQ_PARAM
{
public MSEQ_PARAM(string controlName, MIL_INT controlType, MIL_INT originalValue, MIL_INT effectiveValue)
{
ControlName = controlName;
ControlType = controlType;
OriginalValue = originalValue;
EffectiveValue = effectiveValue;
}
public string ControlName;
public MIL_INT ControlType;
public MIL_INT OriginalValue;
public MIL_INT EffectiveValue;
}
private static bool CheckMseqProcessError(MIL_ID MilApplication, MIL_ID MilCompressContext)
{
bool IsError = false;
bool IsWarning = false;
MIL_INT MilErrorCode = PrintMilErrorMessage(MilApplication);
if (MilErrorCode != MIL.M_NULL_ERROR)
{
MSEQ_PARAM[] MseqParamList = new MSEQ_PARAM[] {
new MSEQ_PARAM("M_STREAM_BIT_RATE_MODE", MIL.M_STREAM_BIT_RATE_MODE, 0, 0),
new MSEQ_PARAM( "M_STREAM_BIT_RATE", MIL.M_STREAM_BIT_RATE, 0, 0 ),
new MSEQ_PARAM( "M_STREAM_BIT_RATE_MAX", MIL.M_STREAM_BIT_RATE_MAX, 0, 0 ),
new MSEQ_PARAM( "M_STREAM_FRAME_RATE_MODE", MIL.M_STREAM_FRAME_RATE_MODE, 0, 0 ),
new MSEQ_PARAM( "M_STREAM_QUALITY", MIL.M_STREAM_QUALITY, 0, 0 ),
new MSEQ_PARAM( "M_STREAM_PROFILE", MIL.M_STREAM_PROFILE, 0, 0 ),
new MSEQ_PARAM( "M_STREAM_LEVEL", MIL.M_STREAM_LEVEL, 0, 0 ),
new MSEQ_PARAM( "M_STREAM_GROUP_OF_PICTURE_SIZE", MIL.M_STREAM_GROUP_OF_PICTURE_SIZE, 0, 0 )};
MIL_INT NumberOfModifiedParams = 0;
for (MIL_INT ParamIndex = 0; ParamIndex < MseqParamList.Length; ParamIndex++)
{
MIL.MseqInquire(MilCompressContext,
MIL.M_CONTEXT,
MseqParamList[ParamIndex].ControlType,
ref MseqParamList[ParamIndex].OriginalValue);
MIL.MseqInquire(MilCompressContext,
MIL.M_CONTEXT,
MseqParamList[ParamIndex].ControlType | MIL.M_EFFECTIVE_VALUE,
ref MseqParamList[ParamIndex].EffectiveValue);
if (MseqParamList[ParamIndex].OriginalValue != MseqParamList[ParamIndex].EffectiveValue)
{
if (NumberOfModifiedParams == 0)
Console.Write("\nParameter(s) that have been internally modified:\n");
Console.WriteLine("- {0}", MseqParamList[ParamIndex].ControlName);
NumberOfModifiedParams++;
IsWarning = true;
}
}
Console.WriteLine();
if (!IsWarning)
IsError = true;
}
return IsError;
}
private static MIL_INT PrintMilErrorMessage(MIL_ID MilApplication)
{
MIL_INT MilErrorCode;
StringBuilder MilErrorMsg = new StringBuilder(MIL.M_ERROR_MESSAGE_SIZE);
MIL_INT[] MilErrorSubCode = new MIL_INT[3];
StringBuilder[] MilErrorSubMsg = new StringBuilder[3];
for (int i = 0; i < 3; i++)
MilErrorSubMsg[i] = new StringBuilder(MIL.M_ERROR_MESSAGE_SIZE);
MilErrorCode = MIL.MappGetError(MilApplication, MIL.M_CURRENT + MIL.M_MESSAGE, MilErrorMsg);
if (MilErrorCode != MIL.M_NULL_ERROR)
{
MIL_INT subCount = 3;
MIL.MappGetError(MilApplication, MIL.M_CURRENT_SUB_NB, ref subCount);
MilErrorSubCode[0] = MIL.MappGetError(MilApplication,
MIL.M_CURRENT_SUB_1 + MIL.M_MESSAGE,
MilErrorSubMsg[0]);
MilErrorSubCode[1] = MIL.MappGetError(MilApplication,
MIL.M_CURRENT_SUB_2 + MIL.M_MESSAGE,
MilErrorSubMsg[1]);
MilErrorSubCode[2] = MIL.MappGetError(MilApplication,
MIL.M_CURRENT_SUB_3 + MIL.M_MESSAGE,
MilErrorSubMsg[2]);
Console.WriteLine("\nMseqProcess generated a warning or an error:");
Console.WriteLine(" {0}", MilErrorMsg.ToString());
for (int i = 0; i < subCount; i++)
{
if (MilErrorSubCode[i] != 0)
Console.WriteLine(" {0}", MilErrorSubMsg[i]);
}
}
return MilErrorCode;
}
}
}