/// <summary> /// Get the string for log output. /// </summary> /// <param name="obj">Structure that you want to convert to a string</param> /// <returns>String for log output</returns> public static StringBuilder ConvertToLogString(LJV7IF_GET_STRAGE_STATUS_RSP rsp) { StringBuilder sb = new StringBuilder(); sb.AppendLine(string.Format(@" SurfaceCnt : {0}", rsp.dwSurfaceCnt)); sb.AppendLine(string.Format(@" ActiveSurface : {0}", rsp.dwActiveSurface)); return(sb); }
internal static extern int LJV7IF_GetStorageStatus(int lDeviceId, ref LJV7IF_GET_STRAGE_STATUS_REQ pReq, ref LJV7IF_GET_STRAGE_STATUS_RSP pRsp, ref LJV7IF_STORAGE_INFO pStorageInfo);
internal static extern int LJV7IF_GetStorageStatus(int lDeviceId, ref LJV7IF_GET_STRAGE_STATUS_REQ pReq, ref LJV7IF_GET_STRAGE_STATUS_RSP pRsp, ref LJV7IF_STORAGE_INFO pStorageInfo);
/// <summary> /// "GetStorageStatus" button clicked. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnGetStorageStatus_Click(object sender, EventArgs e) { _sendCommand = SendCommand.GetStorageStatus; using (GetStorageStatusForm getStorageStatusForm = new GetStorageStatusForm()) { if (DialogResult.OK == getStorageStatusForm.ShowDialog()) { LJV7IF_GET_STRAGE_STATUS_REQ req = getStorageStatusForm.Req; // @Point // # dwReadArea is the target surface to read. // The target surface to read indicates where in the internal memory usage area to read. // # The method to use in specifying dwReadArea varies depending on how internal memory is allocated. // * Double buffer // 0 indicates the active surface, 1 indicates surface A, and 2 indicates surface B. // * Entire area (overwrite) // Fixed to 1 // * Entire area (do not overwrite) // After a setting modification, data is saved in surfaces 1, 2, 3, and so on in order, and 0 is set as the active surface. // # For details, see "9.2.9.2 Internal memory." LJV7IF_GET_STRAGE_STATUS_RSP rsp = new LJV7IF_GET_STRAGE_STATUS_RSP(); LJV7IF_STORAGE_INFO storageInfo = new LJV7IF_STORAGE_INFO(); int rc = NativeMethods.LJV7IF_GetStorageStatus(_currentDeviceId, ref req, ref rsp, ref storageInfo); // @Point // # Terminology // * Base time … time expressed with 32 bits (<- the time when the setting was changed) // * Accumulated date and time … counter value that indicates the elapsed time, in units of 10 ms, from the base time // # The accumulated date and time are stored in the accumulated data. // # The accumulated time of read data is calculated as shown below. // Accumulated time = "base time (stBaseTime of LJV7IF_GET_STORAGE_RSP)" + "accumulated date and time × 10 ms" AddLogResult(rc, Resources.SID_GET_STORAGE_STATUS); if (rc == (int)Rc.Ok) { // Response data display AddLog(Utility.ConvertToLogString(rsp).ToString()); AddLog(Utility.ConvertToLogString(storageInfo).ToString()); } } } }
/// <summary> /// Get the string for log output. /// </summary> /// <param name="obj">Structure that you want to convert to a string</param> /// <returns>String for log output</returns> public static StringBuilder ConvertToLogString(LJV7IF_GET_STRAGE_STATUS_RSP rsp) { StringBuilder sb = new StringBuilder(); sb.AppendLine(string.Format(@" SurfaceCnt : {0}", rsp.dwSurfaceCnt)); sb.AppendLine(string.Format(@" ActiveSurface : {0}", rsp.dwActiveSurface)); return sb; }