Skip to content

Commit

Permalink
[#57] Support for KryoFlux and associated images (Part 10: Track [flu…
Browse files Browse the repository at this point in the history
…x] information preview)
  • Loading branch information
tomas-nestorovic committed Nov 11, 2020
1 parent 79913cd commit 4850d39
Show file tree
Hide file tree
Showing 13 changed files with 387 additions and 28 deletions.
1 change: 1 addition & 0 deletions Main/Main.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@
<ClCompile Include="src\GDOS_FileManager.cpp" />
<ClCompile Include="src\HexaEditor.cpp" />
<ClCompile Include="src\Image_SectorDataSerializer.cpp" />
<ClCompile Include="src\Image_TrackEditor.cpp" />
<ClCompile Include="src\Image_TrackRW.cpp" />
<ClCompile Include="src\IPF.cpp" />
<ClCompile Include="src\KryoFluxBase.cpp" />
Expand Down
3 changes: 3 additions & 0 deletions Main/Main.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,9 @@
<ClCompile Include="src\KryoFluxStreams.cpp">
<Filter>Source Files\Image</Filter>
</ClCompile>
<ClCompile Include="src\Image_TrackEditor.cpp">
<Filter>Source Files\Image</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="res\resource.rc">
Expand Down
1 change: 1 addition & 0 deletions Main/res/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
#define IDR_DOS_PREVIEW_BASE 219
#define IDR_KRYOFLUX_ACCESS 220
#define IDR_CAPS 221
#define IDR_TRACK_EDITOR 222
#define ID_HIDDEN 1018
#define ID_SYSTEM 1019
#define ID_CONNECTED 1020
Expand Down
39 changes: 39 additions & 0 deletions Main/res/resource.rc
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,15 @@ BEGIN
VK_F5, ID_REFRESH, VIRTKEY, NOINVERT
END

IDR_TRACK_EDITOR ACCELERATORS DISCARDABLE
BEGIN
"+", ID_ZOOM_IN, ASCII, NOINVERT
"-", ID_ZOOM_OUT, ASCII, NOINVERT
"0", ID_ZOOM_FIT, VIRTKEY, CONTROL, NOINVERT
VK_ESCAPE, IDCANCEL, VIRTKEY, NOINVERT
END


/////////////////////////////////////////////////////////////////////////////
//
// Menu
Expand Down Expand Up @@ -640,6 +649,19 @@ BEGIN
END
END

IDR_TRACK_EDITOR MENU DISCARDABLE
BEGIN
POPUP "Preview"
BEGIN
MENUITEM "Zoom in\t+", ID_ZOOM_IN
MENUITEM "Zoom out\t�", ID_ZOOM_OUT
MENUITEM "Zoom to fit\tCtrl+0", ID_ZOOM_FIT
MENUITEM SEPARATOR
MENUITEM "Close\tEsc", IDCANCEL
END
END


/////////////////////////////////////////////////////////////////////////////
//
// Bitmap
Expand Down Expand Up @@ -1578,6 +1600,18 @@ BEGIN
LTEXT "Static",ID_DOS,56,78,123,20
END

IDR_TRACK_EDITOR DIALOG DISCARDABLE 0, 0, 442, 149
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION
CAPTION ""
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "OK",IDOK,332,128,50,14,NOT WS_VISIBLE | WS_DISABLED
PUSHBUTTON "Cancel",IDCANCEL,385,128,50,14
LTEXT "",ID_TRACK,0,0,441,117,NOT WS_VISIBLE | WS_BORDER | NOT
WS_GROUP
CONTROL "Slider1",ID_ACCURACY,"msctls_trackbar32",TBS_BOTH |
TBS_NOTICKS | WS_BORDER,0,117,149,17
END

/////////////////////////////////////////////////////////////////////////////
//
Expand Down Expand Up @@ -1859,6 +1893,11 @@ BEGIN
TOPMARGIN, 7
BOTTOMMARGIN, 120
END

IDR_TRACK_EDITOR, DIALOG
BEGIN
BOTTOMMARGIN, 142
END
END
#endif // APSTUDIO_INVOKED

Expand Down
7 changes: 7 additions & 0 deletions Main/src/CapsBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -669,3 +669,10 @@ returnData: *outFdcStatuses++=currRev->fdcStatus;
return ERROR_SUCCESS;
}

std::unique_ptr<CImage::CTrackReader> CCapsBase::GetTrackDescription(TCylinder cyl,THead head) const{
// returns specified Track general description, represented using neutral LogicalTimes; returns Null if such description not available
if (const PCInternalTrack pit=internalTracks[cyl][head])
return std::unique_ptr<CTrackReader>( new CTrackReader(*pit) );
else
return __super::GetTrackDescription(cyl,head);
}
1 change: 1 addition & 0 deletions Main/src/CapsBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
TStdWinError SetMediumTypeAndGeometry(PCFormat pFormat,PCSide sideMap,TSector firstSectorNumber) override;
bool EditSettings(bool initialEditing) override;
TStdWinError Reset() override;
std::unique_ptr<CTrackReader> GetTrackDescription(TCylinder cyl,THead head) const override;
};


Expand Down
5 changes: 5 additions & 0 deletions Main/src/Image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,11 @@
return ERROR_NOT_SUPPORTED; // each Track by default must be explicitly formatted to be sure about its structure (but Images abstracting physical drives can override this setting)
}

std::unique_ptr<CImage::CTrackReader> CImage::GetTrackDescription(TCylinder cyl,THead head) const{
// returns specified Track general description, represented using neutral LogicalTimes; returns Null if such description not available
return nullptr;
}

TStdWinError CImage::SaveTrack(TCylinder cyl,THead head){
// saves the specified Track to the inserted Medium; returns Windows standard i/o error
return ERROR_NOT_SUPPORTED; // individual Track saving is not supported for this kind of Image (OnSaveDocument must be called instead)
Expand Down
1 change: 1 addition & 0 deletions Main/src/Image.h
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@
//TFdcStatus ReadData(WORD nBytesToRead,LPBYTE buffer);
TFdcStatus ReadDataFm(WORD nBytesToRead,LPBYTE buffer);
TFdcStatus ReadDataMfm(WORD nBytesToRead,LPBYTE buffer);
void ShowModal(LPCTSTR caption) const;
};

class CTrackReaderWriter:public CTrackReader{
Expand Down
Loading

0 comments on commit 4850d39

Please sign in to comment.