Tip: Click lines to highlight, hold ctrl/cmd to multi-select
PsuedoCode (24-Aug @ 17:51)
Syntax Highlighted Code
- QFrame master:
- QLabels [browse level (from stack 'ants')] Ants
- QFrame [from current level] 'body'
- QButton 'close'
- QProgress [global operation status] 'curOp'
- {
- default QFrame: directory
- qframeSwitch(frame)
- {
- body->emptyframe
- reset curOp 0/0
- while (!ready(frame)) ;;
- body->frame
- }
- fileSum(fileId)
- {
- return stored filesum for CurrentFile
- }
- fileSumByName (fileURI)
- {
- return stored filesum for fileURI
- }
- fileIDfromName(fileURI)
- {
- return fileID for fileURI
- }
- }
- QFrame directory
- QLabel [access Errors] 'dirError'
- QLabel [constant text] 'directory'
- QUrlInput [defaults to most recent or dnaskittle.org/master.dir] 'directoryUrl'
- QListBox [directories from settings] 'directoryHistory'
- QButton 'read directory'
- QButton 'load from history'
- QButton 'operate locally'
- {
- initialize curFileID
- read directory (loading)
- update curOp from reply-status
- read directory:
- if success:
- initialize directoryID, repoList, repoHist
- qframeSwitch(repositories)
- else: error -> dirError
- load from history
- initialize repoHist
- qframeSwitch(repositories)
- operatelocally
- local -> true
- qframeSwitch(repositoryDashboard)
- }
- QFrame repositories
- QLabel [access Errors] 'repoError'
- QLabel [constant text] 'repository'
- QUrlInput [defaults to most recent or repository.dnaskittle.org] 'repositoryUrl'
- QListBox [repositories from directory, history (two sections)] 'repositoryHistory'
- QButton 'read repository'
- {
- read repository
- initialize repositoryID, repositoryName
- if autheticated
- qframeSwitch(repositoryDashboard)
- else
- qframeSwitch(authenticate)
- read repository (loading)
- update curOp from reply-status
- }
- QFrame authenticate
- QLabel [authentication Errors] 'authError'
- QLabel 'username' QInput 'username'
- QLabel 'password' QInput 'password'
- QButton 'sign in'
- {
- 'sign in':
- if valid('username','password')
- initialize userID
- authenticated -> true
- qframeSwitch(repositoryDashboard)
- else
- authError->"Invalid username/password"
- }
- QFrame repositoryDashboard
- QLabel [operation errors] 'opError'
- QGroup 'file maintenance'
- QButton 'synchronize with server'
- QButton 'edit file metaData' QCombo 'filename'
- QGroup 'annotation maintenance'
- QButton 'download by group'
- QButton 'upload annotations'
- QButton 'update annotations'
- QButton 'remove annotations'
- QButton 'log off'
- {
- 'download by group':
- qframeSwitch(groups)
- 'log off'
- authenticated -> false
- uninitialize userID
- qframeSwich(repositories)
- }
- QFrame groups
- QLabel [annotation Fetch Errors] 'groupError'
- QLabel [constant text] 'groups'
- QInput [defaults to 'all'(0) (tokenize on ',')] 'groupID'
- QListBox [list repository groups(by userid)] 'groupList'
- QButton 'get annotations'
- {
- 'get annotations':
- initialize groups from groupID
- get annotations by fileSum(curFileID), groups
- if success, count > 1
- initialize annotList
- qframeSwitch(annotations)
- else
- groupError -> "Unable to Fetch Annotations, network Error or no Annotations Found"
- (loading)
- update curOp from reply-status
- }
- QFrame annotations
- QLabel [annotation Fetch Errors] 'annotError'
- QLabel [constant text] 'groups'
- QInput [defaults to 'all'(0) (tokenize on ',')] 'groupID'
- QListBox [list repository groups(by userid)] 'groupList'
- QButton 'get annotations'
- {
- 'get annotations':
- get annotations by curFileID, groups
- if success, count > 1
- initialize annotList
- qframeSwitch(annotations)
- else
- groupError -> "Unable to Fetch Annotations, network Error or no Annotations Found"
- (loading)
- update curOp from reply-status
- }
Plain Code
QFrame master:
QLabels [browse level (from stack 'ants')] Ants
QFrame [from current level] 'body'
QButton 'close'
QProgress [global operation status] 'curOp'
{
default QFrame: directory
qframeSwitch(frame)
{
body->emptyframe
reset curOp 0/0
while (!ready(frame)) ;;
body->frame
}
fileSum(fileId)
{
return stored filesum for CurrentFile
}
fileSumByName (fileURI)
{
return stored filesum for fileURI
}
fileIDfromName(fileURI)
{
return fileID for fileURI
}
}
QFrame directory
QLabel [access Errors] 'dirError'
QLabel [constant text] 'directory'
QUrlInput [defaults to most recent or dnaskittle.org/master.dir] 'directoryUrl'
QListBox [directories from settings] 'directoryHistory'
QButton 'read directory'
QButton 'load from history'
QButton 'operate locally'
{
initialize curFileID
read directory (loading)
update curOp from reply-status
read directory:
if success:
initialize directoryID, repoList, repoHist
qframeSwitch(repositories)
else: error -> dirError
load from history
initialize repoHist
qframeSwitch(repositories)
operatelocally
local -> true
qframeSwitch(repositoryDashboard)
}
QFrame repositories
QLabel [access Errors] 'repoError'
QLabel [constant text] 'repository'
QUrlInput [defaults to most recent or repository.dnaskittle.org] 'repositoryUrl'
QListBox [repositories from directory, history (two sections)] 'repositoryHistory'
QButton 'read repository'
{
read repository
initialize repositoryID, repositoryName
if autheticated
qframeSwitch(repositoryDashboard)
else
qframeSwitch(authenticate)
read repository (loading)
update curOp from reply-status
}
QFrame authenticate
QLabel [authentication Errors] 'authError'
QLabel 'username' QInput 'username'
QLabel 'password' QInput 'password'
QButton 'sign in'
{
'sign in':
if valid('username','password')
initialize userID
authenticated -> true
qframeSwitch(repositoryDashboard)
else
authError->"Invalid username/password"
}
QFrame repositoryDashboard
QLabel [operation errors] 'opError'
QGroup 'file maintenance'
QButton 'synchronize with server'
QButton 'edit file metaData' QCombo 'filename'
QGroup 'annotation maintenance'
QButton 'download by group'
QButton 'upload annotations'
QButton 'update annotations'
QButton 'remove annotations'
QButton 'log off'
{
'download by group':
qframeSwitch(groups)
'log off'
authenticated -> false
uninitialize userID
qframeSwich(repositories)
}
QFrame groups
QLabel [annotation Fetch Errors] 'groupError'
QLabel [constant text] 'groups'
QInput [defaults to 'all'(0) (tokenize on ',')] 'groupID'
QListBox [list repository groups(by userid)] 'groupList'
QButton 'get annotations'
{
'get annotations':
initialize groups from groupID
get annotations by fileSum(curFileID), groups
if success, count > 1
initialize annotList
qframeSwitch(annotations)
else
groupError -> "Unable to Fetch Annotations, network Error or no Annotations Found"
(loading)
update curOp from reply-status
}
QFrame annotations
QLabel [annotation Fetch Errors] 'annotError'
QLabel [constant text] 'groups'
QInput [defaults to 'all'(0) (tokenize on ',')] 'groupID'
QListBox [list repository groups(by userid)] 'groupList'
QButton 'get annotations'
{
'get annotations':
get annotations by curFileID, groups
if success, count > 1
initialize annotList
qframeSwitch(annotations)
else
groupError -> "Unable to Fetch Annotations, network Error or no Annotations Found"
(loading)
update curOp from reply-status
}