Skip to content

Commit

Permalink
Updated README.md to include crossmgr-install.py explanation.
Browse files Browse the repository at this point in the history
  • Loading branch information
esitarski committed Jul 18, 2024
1 parent 0e9913e commit e1870e9
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 33 deletions.
2 changes: 1 addition & 1 deletion CrossMgrImpinj/MainWin.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ def __init__( self, parent, id = wx.ID_ANY, title='', size=(200,200) ):
self.copyToClipboard.Bind( wx.EVT_BUTTON, self.doCopyToClipboard )
bs.Add( self.copyToClipboard, border = 32, flag = wx.LEFT|wx.ALIGN_CENTER_VERTICAL )
self.tStart = datetime.datetime.now()
bs.Add( setFont(bigFont,wx.StaticText(self, label='Last Reset: %s' % self.tStart.strftime('%H:%M:%S'))), border = 10, flag=wx.LEFT|wx.ALIGN_CENTER_VERTICAL )
bs.Add( setFont(bigFont,wx.StaticText(self, label='Last Reset: {}'.format(self.tStart.strftime('%H:%M:%S')))), border=10, flag=wx.LEFT|wx.ALIGN_CENTER_VERTICAL )
self.runningTime = setFont(bigFont,wx.StaticText(self, label='00:00:00' ))
bs.Add( self.runningTime, border = 20, flag=wx.LEFT|wx.ALIGN_CENTER_VERTICAL )
bs.Add( setFont(bigFont,wx.StaticText(self, label=' / ')), flag=wx.ALIGN_CENTER_VERTICAL )
Expand Down
8 changes: 4 additions & 4 deletions CrossMgrVideo/ComputeSpeed.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,13 @@ def __init__(self, parent, getSpeed):
vbs.Add( wx.StaticText(self, label = _('Drag the Green Square so the line is on the Leading Edge of the Front Wheel.')),
flag=wx.ALL, border = border )
self.speed = wx.StaticText( self, label=self.formatSpeed() )
bigFont = wx.Font( (0,32), wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL )
self.speed.SetFont( bigFont )
#bigFont = wx.Font( (0,24), wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL )
#self.speed.SetFont( bigFont )
vbs.Add( self.speed, flag=wx.ALL, border = border )
self.SetSizerAndFit( vbs )

def formatSpeed( self, kmh=0.0, mps=0.0, mph=0.0 ):
return '{:.2f}km/h {:.2f}m/s {:.2f}mph'.format(kmh, mps, mph)
return f'{kmh:.2f}km/h {mps:.2f}m/s {mph:.2f}mph'

def onVerticalLines( self, event=None ):
mps, kmh, mph, pps = self.getSpeed()
Expand All @@ -135,7 +135,7 @@ class ComputeSpeed:
wheelDiameter = 0.678

def __init__( self, parent, size=wx.DefaultSize ):
self.wizard = adv.Wizard( parent, wx.ID_ANY, _('Compute Speed') )
self.wizard = adv.Wizard( parent, wx.ID_ANY, _('Compute Speed'), style=wx.RESIZE_BORDER)
self.wizard.Bind( adv.EVT_WIZARD_PAGE_CHANGING, self.onPageChanging )

self.iPhoto1 = None
Expand Down
24 changes: 13 additions & 11 deletions CrossMgrVideo/MainWin.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,15 @@ def getInfo():
app = AppVerName.split()[0]
uname = platform.uname()
info = {
'{}_AppVersion'.format(app): AppVerName,
'{}_Timestamp'.format(app): datetime.now(),
'{}_User'.format(app): os.path.basename(os.path.expanduser("~")),
'{}_Python'.format(app): sys.version.replace('\n', ' '),
f'{app}_AppVersion': AppVerName,
f'{app}_Timestamp': datetime.now(),
f'{app}_User': os.path.basename(os.path.expanduser("~")),
f'{app}_Python': sys.version.replace('\n', ' '),
}
info.update( {'{}_{}'.format(app, a.capitalize()): getattr(uname, a)
for a in ('system', 'release', 'version', 'machine', 'processor') if getattr(uname, a, '') } )
info.update( {
f'{app}_{a.capitalize()}': getattr(uname, a)
for a in ('system', 'release', 'version', 'machine', 'processor') if getattr(uname, a, '')
} )
return info

import Resolutions
Expand Down Expand Up @@ -135,10 +137,10 @@ def __init__( self, parent, usb=0, fps=30, width=imageWidth, height=imageHeight,

pfgs.Add( wx.StaticText(self, label='Camera USB'+':'), flag=wx.ALIGN_CENTRE_VERTICAL|wx.ALIGN_RIGHT )
hs = wx.BoxSizer( wx.HORIZONTAL )
self.usb = wx.Choice( self, choices=['{}'.format(i) for i in range(CamServer.CameraUsbMax)] )
self.usb = wx.Choice( self, choices=[f'{i}' for i in range(CamServer.CameraUsbMax)] )
self.usb.SetSelection( usb )
hs.Add( self.usb )
hs.Add( wx.StaticText(self, label='cameras detected on {}'.format(availableCameraUsb)), flag=wx.ALIGN_CENTRE_VERTICAL|wx.LEFT, border=8 )
hs.Add( wx.StaticText(self, label=f'cameras detected on {availableCameraUsb}'), flag=wx.ALIGN_CENTRE_VERTICAL|wx.LEFT, border=8 )
pfgs.Add( hs )

pfgs.Add( wx.StaticText(self, label='Camera Resolution'+':'), flag=wx.ALIGN_CENTRE_VERTICAL|wx.ALIGN_RIGHT )
Expand Down Expand Up @@ -481,8 +483,8 @@ def __init__( self, parent, id = wx.ID_ANY, title='', size=(1000,800) ):
self.logo = Utils.GetPngBitmap('CrossMgrHeader.png')
headerSizer.Add( wx.StaticBitmap(self, wx.ID_ANY, self.logo) )

self.title = wx.StaticText(self, label='CrossMgr Video\nVersion {}'.format(AppVerName.split()[1]), style=wx.ALIGN_RIGHT )
self.title.SetFont( wx.Font( (0,28), wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL ) )
self.title = wx.StaticText(self, label='CrossMgr Video\nVersion {}'.format(AppVerName.split()[1].replace('-private','\nprivate')), style=wx.ALIGN_RIGHT )
self.title.SetFont( wx.Font( (0,26), wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL ) )
headerSizer.Add( self.title, flag=wx.ALL, border=10 )

clock = Clock( self, size=(90,90) )
Expand Down Expand Up @@ -600,7 +602,7 @@ def __init__( self, parent, id = wx.ID_ANY, title='', size=(1000,800) ):
self.dateSelect.Bind( wx.EVT_BUTTON, self.onDateSelect )

hsDate.Add( wx.StaticText(self, label='Filter by Bib'), flag=wx.ALIGN_CENTER_VERTICAL|wx.LEFT, border=12 )
self.bib = wx.lib.intctrl.IntCtrl( self, style=wx.TE_PROCESS_ENTER, size=(64,-1), min=1, allow_none=True, value=None )
self.bib = wx.lib.intctrl.IntCtrl( self, style=wx.TE_PROCESS_ENTER, size=(64,-1), min=0, allow_none=True, value=None )
self.bib.Bind( wx.EVT_TEXT_ENTER, self.onQueryBibChanged )
hsDate.Add( self.bib, flag=wx.LEFT, border=2 )

Expand Down
68 changes: 51 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ The minimum system requires are as follows:

### Windows

- Windows 10 x64 (32 bit systems are not supported)
- Windows 11 x64
- 4G RAM
- 10G HD space

Expand All @@ -41,12 +41,18 @@ The minimum system requires are as follows:
- 4G RAM
- 10G HD space

### Linux

- ubuntu (and flavors), centos, debian, fedora, rocky
- 4G RAM
- 10G HD space

## User Installation

As a user, you can install the CrossManager applications on Windows, Mac OSX, and Linux. Only x86 64 bit platforms are supported. The Windows and MacOSX versions are available as binary releases.
See the Releases tab in the github repo for binaries.

You can still run on Linux too, but you have to run from the source code.
You can still run on Linux too, but you have to use the install script (more on that later).

### Windows Installation

Expand Down Expand Up @@ -76,27 +82,55 @@ This is only required the first time you run it. MacOSX will also ask a few ques

CrossMgrImpinj, TagReadWriter, CrossMgrAlien, CrossMgrVideo, SeriesMgr, PointsRaceMgr and SprintMgr follow the same install process.

#### Debugging the Mac Apps
## Installation with the CrossMgr Install Script

Because MacOSX has added a lot of security to the system, some weird problems can occur that prevent the application from starting.
Windows and Mac have become increasingly difficult to deal with due to virus checkers incorrectly flagging CrossMgr installs as containing a virus.
And, it is difficult to create a standard install for Linux due to all its flavors and variants.

First, and foremost, because the apps are not signed, you must CTRL-CLICK the icon, and select Open from the pop up menu, and then click Open on the dialog box to start the application the first time
Additionally, MacOSX will prompt the user for permissions to access the network, documents folder, etc...
Sometimes, the splash screens for the application will cover this dialog box up, or it could end up behind the application.
Unless you select ALLOW, the application can't work. For example, CrossMgr requires network access to run.
Additionally, sometimes the application just won't start. Typically, it's icon will start to flash, and then nothing.
To see why and what is happening, run the application from the command line from the app's MacOS directory. For example, for CrossMgr:
To address this problem, there is now a cross-platform install which solves many of these problems.

```bash
cd /Applications/CrossMgr.app/Content/MacOS
./CrossMgr
```
To clear the air about viruses, all CrossMgr installs are submitted to [VirusTotal](https://www.virustotal.com/gui/home/upload). VirusTotal runs 70 virus checkers and logs the result in a public database.
Regardless, Windows and Mac virus checkers often flag CrossMgr installs as suspicious (this stops sometimes after a sufficient number of installs).
The Mac's GateKeeper is the worst offender as it falsely claims that the .dmg file is damaged and should be deleted. Yikes!

<rant>
I get that Microsoft and Apple want all installs from their online store, but these policies don't serve the open-source community well where there isn't enough money to pay the fees.
Posting to the Apple online store also requires a submitting and approval process for every version (costly, with delays).
Microsoft has (winget)[https://winget.run/], but it isn't available for Mac or Linux.
And overall, I don't have the time to maintain and test separate release mechanisms for each platform.
</rant>

To install from the script:

1. Make sure you have an internet connection.
1. On Windows and Mac only, install Python onto your maching from (here)[https://www.python.org/] if you don't currently have it. If presented with an option to add Python to your PATH, choose Yes. You only need to install Python once. Python is the computer language CrossMgr is written in. Skip this step on Linux as Python is already installed.
1. Download (crossmgr-install.py)[https://github.com/esitarski/CrossMgr/blob/master/crossmgr-install.py] and save it into a folder on your machine. You only need to do this once.
1. Open a terminal and "cd" to the directory you downloaded crossmgr-install.py
1. In the terminal, enter: __python3 crossmgr-install.py install__
1. Wait a few minutes while the install pulls the latest release from github, updates the Python env, and creates the desktop shortcuts. You can now launch the CrossMgr apps from the desktop shortcuts.
1. To use the shortcuts on Linux, right-click on them and select "Allow Launching". You only need to do this once.
1. You can associate file types with CrossMgr apps on Windows. For example, to launch CrossMgr when you double-click on .cmn files, click on a .cmn file, then set __~/CrossMgr-master/bin/CrossMgr.ps1__ as the app to use to open it (~ is your home directory). Similar for Mac, but the app name ends in .sh.

After the install completes, there is an __Update CrossMgr__ shortcut on your desktop.
This is all you need to run to update CrossMgr going forward - you don't have to spend time finding the latest CrossMgr release.

None of the CrossMgr apps require an internet connection to run.

The script also supports __uninstall__ and __restore__ commands which allow you to remove all CrossMgr apps, or to revert back to the last version you installed, respectively.

There are a number of application in the CrossMgr suite, but as you work more races, you need many of them, especially CrossMgr (mass start and TT), SeriesMgr (for series) CrossMgr Impinj (for RFID), TagReadWrite (to make RFID tags)
and CallupSeedingMgr (if you have callups for high-level events for MTB and CX).

In addition to being faster and more convenient, the script requires much less disk space as each app reuses the Python runtime, rather than bundling in each .exe or .dmg file.

Python is set up to dump logs to stdout which usually indicates the problem. Sometimes, the problem of starting the application will just go away.
If you are running with a .exe (Windows) or .dmg (Mac) install, you should uninstall all the apps first before switching to the script method.

### Linux Installation
I investigated a number of ways to solve this problem (containers, python setup, nuitka as well as the existing solution).
However, nuitka takes an hour to compile, downloading an .exe or .dmg is out anuyway, containers are at least as complicated to install as Python, and python setup does not deal with resource and data files well (not to mention shortcuts, etc.).

Follow the instructions for building CrossMgr on your system. Check the wxPython web page for specific instructions for how to install it on your distro.
This solution requires the extra step to install Python, but on the whole, I think this effort is worth it.
Perhaps there will be a better way to solve this in the future (for example, on Windows, install it automatically with winget).
Suggestions are welcome.

## Building Cross Manager (for developers)

Expand Down

0 comments on commit e1870e9

Please sign in to comment.