Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:jnweiger
syscomp-cgr
CGR101V114-suse.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File CGR101V114-suse.patch of Package syscomp-cgr
--- CGR101V114/updateCheck.tcl.orig 2010-05-12 11:26:52.000000000 +0200 +++ CGR101V114/updateCheck.tcl 2010-08-26 15:28:18.000000000 +0200 @@ -94,9 +94,10 @@ proc updateCheck::updateCheck {inform} { } proc updateCheck::readSettings {} { + global cfg_dir #See if there are preferences saved - if [catch {open update.cfg r} fileId] { + if [catch {open "$cfg_dir/update.cfg" r} fileId] { puts "No update preferences found" } else { if {[gets $fileId line] >= 0} { @@ -110,8 +111,9 @@ proc updateCheck::readSettings {} { } proc updateCheck::saveSettings {} { + global cfg_dir - set fileId [open update.cfg w] + set fileId [open "$cfg_dir/update.cfg" w] puts $fileId $updateCheck::updateCheckEnable close $fileId --- CGR101V114/Changes.txt.orig 2010-05-12 17:03:04.000000000 +0200 +++ CGR101V114/Changes.txt 2010-08-26 15:05:26.000000000 +0200 @@ -104,4 +104,4 @@ Version 1.01 - September 15,2008 Version 1.0 - September 3, 2008 ------------------------------- --Initial public release \ No newline at end of file +-Initial public release --- CGR101V114/main.tcl.orig 2010-05-14 13:58:48.000000000 +0200 +++ CGR101V114/main.tcl 2010-09-02 15:28:27.000000000 +0200 @@ -24,8 +24,17 @@ set softwareVersion "1.14" #---=== Global Variables ===--- +set doc_dir "/usr/share/doc/packages/syscomp-cgr" +set cfg_dir "$env(HOME)/.syscomp-cgr" +exec mkdir -p $cfg_dir + +set saved_cwd [pwd] +set dirname [file dirname [info script]] +# so that our source commands work here and now. +cd $dirname + #Folder Location for GUI Images -set images "./Images" +set images "$dirname/Images" #GUI Operational Mode set opMode "CircuitGear" @@ -37,8 +46,8 @@ set debugLevel 0 set osType $tcl_platform(platform) if {$osType == "unix"} { if {[exec uname] == "Darwin"} {set osType "Darwin"} -} - +} + #Img package required for screen captures package require Img @@ -75,6 +84,7 @@ proc showAbout {} { } proc showManual {} { + global doc_dir set scriptPath [file dirname [info script]] @@ -87,7 +97,7 @@ proc showManual {} { eval exec [auto_execok start] \"\" [list "circuit-gear-manual.pdf"] } } else { - eval exec see [list "circuit-gear-manual.pdf"] + eval exec xdg-open [list "$doc_dir/circuit-gear-manual.pdf"] } @@ -95,6 +105,7 @@ proc showManual {} { } proc showChangeLog {} { + global doc_dir #Make sure the change log isn't already open if {[winfo exists .changeLog]} { @@ -107,7 +118,7 @@ proc showChangeLog {} { toplevel .changeLog wm title .changeLog "CGR-101 Change Log" - set fileId [open "Changes.txt" r] + set fileId [open "$doc_dir/Changes.txt" r] set changeData [read $fileId] close $fileId @@ -302,7 +313,7 @@ source cursors.tcl source capture.tcl source automeasure.tcl -if [catch {open port.cfg r+} fileId] { +if [catch {open "$cfg_dir/port.cfg" r+} fileId] { if {$osType == "windows"} { set usbSerial::serialPort "com4:" } else { @@ -353,3 +364,5 @@ source math.tcl source updateCheck.tcl source wavemaker.tcl +# so that saved files are where the user expects them +cd $saved_cwd --- CGR101V114/wavemaker.tcl.orig 2010-05-12 11:39:38.000000000 +0200 +++ CGR101V114/wavemaker.tcl 2010-08-26 16:03:16.000000000 +0200 @@ -1,3 +1,4 @@ +# Not standalone. To be sourced in main.tcl #!/usr/bin/wish # wavemaker - an aid to preparing files for user waveforms @@ -1118,8 +1119,8 @@ proc waveMaker::endWatch { } { # but the operating system was unrecognized. proc waveMaker::unknownOS { } { global osType - set msg "The manual can be found as manual.pdf" - append msg " in the same directory as this program." + set msg "The manual can be found as waveMakerManual.pdf" + append msg " in $doc_dir or the same directory as this program." append msg " The program couldn't open it for you" append msg " because your operating system" append msg " is reported as '$osType', which the" @@ -1157,6 +1158,7 @@ proc waveMaker::showWaveMaker {} { variable c variable mb variable m + global doc_dir if {![winfo exists .waveMaker]} { @@ -1263,11 +1265,11 @@ proc waveMaker::showWaveMaker {} { # We look for an application that can open and display a pdf file. # We'll take the first available one in the list. set found false - foreach app [list xpdf evince acroread] { + foreach app [list xdg-open xpdf evince acroread] { if { ! [catch {exec which $app}]} { $m add command \ -label "Manual (PDF)" \ - -command [list exec $app waveMakerManual.pdf &] + -command [list exec $app "$doc_dir/waveMakerManual.pdf" &] set found true break } --- CGR101V114/capture.tcl.orig 2008-06-05 16:20:50.000000000 +0200 +++ CGR101V114/capture.tcl 2010-08-26 14:50:32.000000000 +0200 @@ -82,6 +82,8 @@ proc capture::windowToFile {win} { set img [capture::captureWindow $win] set types {{"Image Files" {.jpg}}} set name [wm title $win] + # linux users don't like whitespace in filenames + set name [regsub -all {\s+} [wm title $win] {_} ] set initFile "$name.jpg" set filename [tk_getSaveFile \ --- CGR101V114/calibration.tcl.orig 2010-02-14 14:51:22.000000000 +0100 +++ CGR101V114/calibration.tcl 2010-08-26 15:29:18.000000000 +0200 @@ -178,8 +178,9 @@ proc cal::restoreDefaults {} { #file that is used to configure the vertical scaling each time the program #is started. proc cal::saveCalibration {} { + global cfg_dir - set configFile [open calibration.cfg w] + set configFile [open "$cfg_dir/calibration.cfg" w] puts $configFile $scope::stepSizeAHigh puts $configFile $scope::stepSizeALow puts $configFile $scope::stepSizeBHigh @@ -192,8 +193,10 @@ proc cal::saveCalibration {} { } proc cal::readConfig {} { + global cfg_dir + #Attempt to read a vertical calibration file on startup - if [catch {open calibration.cfg r+} configFile] { + if [catch {open "$cfg_dir/calibration.cfg" r+} configFile] { puts "Unable to open custom calibration file, using defaults." set cal::scaleAHigh $scope::stepSizeAHigh set cal::scaleALow $scope::stepSizeALow @@ -222,4 +225,4 @@ proc cal::readConfig {} { } } -cal::readConfig \ No newline at end of file +cal::readConfig --- CGR101V114/waveform.tcl.orig 2009-11-03 12:07:56.000000000 +0100 +++ CGR101V114/waveform.tcl 2010-09-07 23:06:06.000000000 +0200 @@ -338,17 +338,17 @@ proc ::wave::openWaveform {} { # This procedure takes the waveform data stored in "fileName" and sends it to the # instrument. proc ::wave::programWaveform {fileName} { - + global dirname puts "Programming $fileName" #Attempt to open the input file - if [catch {open $fileName r} channel] { + if [catch {open "$dirname/$fileName" r} channel] { tk_messageBox \ - -message "Cannot open $fileName" \ + -message "Cannot open $fileName: $channel" \ -default ok \ -icon error \ -title "File Error" - puts stderr "Cannot open $fileName" + puts stderr "Cannot open $dirname/$fileName: $channel" } else { set wavePath [getWavePath] @@ -535,4 +535,4 @@ proc ::wave::enableNoise {} { ::wave::updateDisplay $plotData -} \ No newline at end of file +} --- CGR101V114/usbSerial.tcl.orig 2010-05-12 11:41:54.000000000 +0200 +++ CGR101V114/usbSerial.tcl 2010-08-26 15:15:17.000000000 +0200 @@ -382,7 +382,8 @@ proc ::usbSerial::sendCommand {command} #from, and stored to, a file called port.cfg. proc ::usbSerial::serialSettings {} { global osType \ - otherPort + otherPort \ + cfg_dir #Create a new window toplevel .serial @@ -504,7 +505,7 @@ proc ::usbSerial::serialSettings {} { button .serial.saveExit \ -text "Save and Exit" \ -command { - set fileId [open port.cfg w] + set fileId [open "$cfg_dir/port.cfg" w] if { $usbSerial::serialPort == "other"} { puts $fileId $otherPort set usbSerial::serialPort $otherPort @@ -519,7 +520,7 @@ proc ::usbSerial::serialSettings {} { #Attempt to open and read the configuration file. If the #file does not exist, default values are used. - if [catch {open port.cfg r+} fileId] { + if [catch {open "$cfg_dir/port.cfg" r+} fileId] { if { $osType == "windows" } { set usbSerial::serialPort com4 } else { @@ -677,4 +678,4 @@ proc usbSerial::autodetect {} { #Autodetection failed. -} \ No newline at end of file +}
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor