![]() |
Halyri - Häke
0.9
|
Interaction logic for MainWindow.xaml. User can ask information from mobile client: video and location. Or user can send tutorials. Also user can manage assigments here that are shown in listbox and in map by pushpins. All controls is here in mainwindow. More...
Public Member Functions | |
MainWindow () | |
Initializes components and focuses map. Also connects to server by endpointAddress that is in settings or by default. Then adds eventhandlers and informs user if conenction is not established in case there is some problem. Also starts Pinger that pings server. More... | |
void | InitializeComponent () |
InitializeComponent More... | |
void | InitializeComponent () |
InitializeComponent More... | |
Protected Member Functions | |
override void | OnClosing (System.ComponentModel.CancelEventArgs e) |
Disconnects before closing program. Also if mapwindows or/and settingswindow is open, closes those too. More... | |
Private Member Functions | |
void | mapController_MapWindowClosingEvent () |
Enables MapTopOwnWindowButton when MapWindow is closing. More... | |
void | MapToOwnWindow_Click (object sender, RoutedEventArgs e) |
Clears everything from map and disposes it. Then makes new window and makes the same map to it. Disables button and adds eventhandler for closing window that it can be put back to same place. More... | |
void | CenterMapButton_Click (object sender, RoutedEventArgs e) |
Centers map to what ever listbox Assigment is selected or none if not selected. More... | |
void | connection_AssigmentUpdatedEvent (ObservableCollection< Assignment > newConnections) |
Replaces assignments with a new assignment if there is one already with same guid. If there is not assignment with the guid, adds new assignment to assignments. If location is set, adds pushpin. If locationtype is set to userspecified takes old location from previous assignment and adds its puhspin so it disapear. Also displays textmessages if there is any. More... | |
void | AssignmentsListBox_SelectionChanged (object sender, SelectionChangedEventArgs e) |
If no assignment is selected -> returns. If user is handling a assignment sets assingmentlistbox selection to old one and returns so user cannot change selection while assignment is active. Also centers map when assigmentslistbox selection is changed. If selecteditem has location it enables centermapbutton. Also clears chat and loads selected assignments chat messages. Also clears videoplayer and ekg canvas. More... | |
void | HandleAssigment_Click (object sender, RoutedEventArgs e) |
If there is none selected in assignmentlistbox, shows messagebox that informs user to select one. Switch HandleAssignmentButton and handlleassignmentmennuitem content and click handler to vice versa. State changing happens in own thread so it won't block ui thread. Enables buttons that can now be used. More... | |
void | UnHandleAssignmentButton_Click (object sender, RoutedEventArgs e) |
Switch HandleAssignmentButton content and click handler to vice versa. State changing happens in own thread so it won't block ui thread. Disables buttons that user cannot use when assingment is not active. More... | |
void | GetMobileUserLocationButton_Click (object sender, RoutedEventArgs e) |
Asks connection to show map for mobile client. More... | |
void | GetVideoButton_Click (object sender, RoutedEventArgs e) |
Switch getVideoButton content and click handler and to vice versa. More... | |
void | StopVideoButton_Click (object sender, RoutedEventArgs e) |
Switch getVideoButton content and click handler and to vice versa. More... | |
void | ChangeAssigmentPriority_Click (object sender, RoutedEventArgs e) |
Tries first cast sender to comboboxitem and from its tag cast it to priority and then ask connection to update it. If cast to comboboxitem fails it tries to cast it to menuitem and tries same again. More... | |
void | RequestMeasurementDataFromDevice_Click (object sender, RoutedEventArgs e) |
Requests measurement data from remote device and moves to cancel request state. If ekg expander is collapsed -> expands it. More... | |
void | CancelMeasurementDataFromDevice_Click (object sender, RoutedEventArgs e) |
Request cancel from mobile client and returns to request start mode. More... | |
void | MeasurementDataReceived (object sender, EventArgs e, MeasurementInstrumentDto instrument, byte[] measurementData, int dataSamplesPerSecond) |
Adds points to graph from bytes array and scrolls to end of it. More... | |
void | ChatSendButton_Click (object sender, RoutedEventArgs e) |
Only works if chattextbox is not empty and there is active assignment if not, returns. This just sends message to mobile client and then clears input box. More... | |
void | IncomingPictureHandler (object sender, byte[] image) |
Displays the incoming "video" pictures from the mobile emergency client in the Image named ImageElement defined in the MainWindow.xaml More... | |
void | ChatTextBox_KeyUp (object sender, KeyEventArgs e) |
If key pressed is enter clicks chats send button. More... | |
void | RotateVideoToLeftButton_Click (object sender, RoutedEventArgs e) |
Transforms imageElemnt center point to origo and then rotates it 90 degrees and then transforms it back to same x,y position. More... | |
void | RotateVideoToRightButton_Click (object sender, RoutedEventArgs e) |
Transforms imageElemnt center point to origo and then rotates it -90 degrees and then transforms it back to same x,y position. More... | |
void | SettingsMenuItem_Click (object sender, RoutedEventArgs e) |
Opens settings window. More... | |
void | MeasurementDataExpander_Collapsed (object sender, RoutedEventArgs e) |
Changes expander header to "avaa". More... | |
void | MeasurementDataExpander_Expanded (object sender, RoutedEventArgs e) |
Changes expander header to "piilota". More... | |
void System.Windows.Markup.IComponentConnector. | Connect (int connectionId, object target) |
void System.Windows.Markup.IComponentConnector. | Connect (int connectionId, object target) |
Private Attributes | |
ObservableCollection< Assignment > | assignments = new ObservableCollection<Assignment>() |
Assignment | ownAssignment |
Connection | connection |
AudioVideoTransferManager | audioVideoManager |
bool | assigmentActive = false |
Graph | measurementGraph |
Settings | settings = new Settings() |
int | angle = 0 |
SettingsWindow | settingsWindow |
MapController | mapController = new MapController() |
bool | isVideoPlaying = false |
bool | isMeasurementPlaying = false |
bool | FirstMeasurementPacket = true |
bool | _contentLoaded |
Interaction logic for MainWindow.xaml. User can ask information from mobile client: video and location. Or user can send tutorials. Also user can manage assigments here that are shown in listbox and in map by pushpins. All controls is here in mainwindow.
<author>Atte Söderlund</author>
Hake_WPF.MainWindow.MainWindow | ( | ) |
Initializes components and focuses map. Also connects to server by endpointAddress that is in settings or by default. Then adds eventhandlers and informs user if conenction is not established in case there is some problem. Also starts Pinger that pings server.
|
private |
If no assignment is selected -> returns. If user is handling a assignment sets assingmentlistbox selection to old one and returns so user cannot change selection while assignment is active. Also centers map when assigmentslistbox selection is changed. If selecteditem has location it enables centermapbutton. Also clears chat and loads selected assignments chat messages. Also clears videoplayer and ekg canvas.
|
private |
Request cancel from mobile client and returns to request start mode.
<author>Niko Mononen</author>
|
private |
Centers map to what ever listbox Assigment is selected or none if not selected.
|
private |
Tries first cast sender to comboboxitem and from its tag cast it to priority and then ask connection to update it. If cast to comboboxitem fails it tries to cast it to menuitem and tries same again.
|
private |
Only works if chattextbox is not empty and there is active assignment if not, returns. This just sends message to mobile client and then clears input box.
|
private |
If key pressed is enter clicks chats send button.
|
private |
|
private |
|
private |
Replaces assignments with a new assignment if there is one already with same guid. If there is not assignment with the guid, adds new assignment to assignments. If location is set, adds pushpin. If locationtype is set to userspecified takes old location from previous assignment and adds its puhspin so it disapear. Also displays textmessages if there is any.
newConnections | Observablecollection of new connections |
|
private |
Asks connection to show map for mobile client.
|
private |
Switch getVideoButton content and click handler and to vice versa.
|
private |
If there is none selected in assignmentlistbox, shows messagebox that informs user to select one. Switch HandleAssignmentButton and handlleassignmentmennuitem content and click handler to vice versa. State changing happens in own thread so it won't block ui thread. Enables buttons that can now be used.
|
private |
Displays the incoming "video" pictures from the mobile emergency client in the Image named ImageElement defined in the MainWindow.xaml
<author>Veli-Mikko Puupponen</author>
image | Image of any common format in a byte array |
void Hake_WPF.MainWindow.InitializeComponent | ( | ) |
InitializeComponent
void Hake_WPF.MainWindow.InitializeComponent | ( | ) |
InitializeComponent
|
private |
Enables MapTopOwnWindowButton when MapWindow is closing.
|
private |
Clears everything from map and disposes it. Then makes new window and makes the same map to it. Disables button and adds eventhandler for closing window that it can be put back to same place.
|
private |
Changes expander header to "avaa".
|
private |
Changes expander header to "piilota".
|
private |
Adds points to graph from bytes array and scrolls to end of it.
<author>Niko Mononen</author>
instrument | Where we want measurementdata |
measurementData | The data |
dataSamplesPerSecond | Samples per second |
|
protected |
Disconnects before closing program. Also if mapwindows or/and settingswindow is open, closes those too.
|
private |
Requests measurement data from remote device and moves to cancel request state. If ekg expander is collapsed -> expands it.
<author>Niko Mononen</author>
|
private |
Transforms imageElemnt center point to origo and then rotates it 90 degrees and then transforms it back to same x,y position.
|
private |
Transforms imageElemnt center point to origo and then rotates it -90 degrees and then transforms it back to same x,y position.
|
private |
Opens settings window.
|
private |
Switch getVideoButton content and click handler and to vice versa.
|
private |
Switch HandleAssignmentButton content and click handler to vice versa. State changing happens in own thread so it won't block ui thread. Disables buttons that user cannot use when assingment is not active.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |