Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 84 additions & 18 deletions OpenVehicleApp/ovms/Base.lproj/MainStoryboard_iPhone.storyboard

Large diffs are not rendered by default.

Binary file modified OpenVehicleApp/ovms/motortemp_letterbox.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions OpenVehicleApp/ovms/ovmsAppDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@
@property (assign) int car_doors1;
@property (assign) int car_doors2;
@property (assign) int car_doors3;
@property (assign) int car_doors5;
@property (assign) int car_stale_pemtemps;
@property (assign) int car_stale_ambienttemps;

Expand All @@ -225,6 +226,7 @@
@property (assign) int car_speed;
@property (assign) int car_parktime;
@property (assign) int car_ambient_temp;
@property (assign) int car_cabin_temp;
@property (assign) float car_tpms_fr_pressure;
@property (assign) int car_tpms_fr_temp;
@property (assign) float car_tpms_rr_pressure;
Expand Down Expand Up @@ -253,6 +255,8 @@
@property (strong, nonatomic) NSString* car_tpms_rr_pressure_s;
@property (strong, nonatomic) NSString* car_tpms_fl_pressure_s;
@property (strong, nonatomic) NSString* car_tpms_rl_pressure_s;
@property (strong, nonatomic) NSString* car_cabin_temp_s;
@property (strong, nonatomic) NSString* car_hvac_s;
@property (strong, nonatomic) NSString* car_tpms_fr_temp_s;
@property (strong, nonatomic) NSString* car_tpms_rr_temp_s;
@property (strong, nonatomic) NSString* car_tpms_fl_temp_s;
Expand Down Expand Up @@ -318,5 +322,6 @@
- (void)commandDoUSSD:(NSString*)ussd;
- (void)commandDoRequestGPRSData;
- (void)commandDoHomelink:(int)button;
- (void)commandDoClimateControl:(int)button;

@end
29 changes: 28 additions & 1 deletion OpenVehicleApp/ovms/ovmsAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ @implementation ovmsAppDelegate
@synthesize car_doors1;
@synthesize car_doors2;
@synthesize car_doors3;
@synthesize car_doors5;
@synthesize car_stale_pemtemps;
@synthesize car_stale_ambienttemps;
@synthesize car_lockstate;
Expand All @@ -84,6 +85,7 @@ @implementation ovmsAppDelegate
@synthesize car_speed;
@synthesize car_parktime;
@synthesize car_ambient_temp;
@synthesize car_cabin_temp;
@synthesize car_tpms_fr_pressure;
@synthesize car_tpms_fr_temp;
@synthesize car_tpms_rr_pressure;
Expand All @@ -109,6 +111,8 @@ @implementation ovmsAppDelegate
@synthesize car_tpms_rr_pressure_s;
@synthesize car_tpms_fl_pressure_s;
@synthesize car_tpms_rl_pressure_s;
@synthesize car_cabin_temp_s;
@synthesize car_hvac_s;
@synthesize car_tpms_fr_temp_s;
@synthesize car_tpms_rr_temp_s;
@synthesize car_tpms_fl_temp_s;
Expand Down Expand Up @@ -589,6 +593,7 @@ - (void)serverClearState
car_tmotor = 0;
car_tbattery = 0;
car_ambient_temp = -127;
car_cabin_temp = -127;
car_trip = 0;
car_odometer = 0;
car_speed = 0;
Expand Down Expand Up @@ -617,6 +622,7 @@ - (void)serverClearState
car_tpms_rr_pressure_s = @"";
car_tpms_fl_pressure_s = @"";
car_tpms_rl_pressure_s = @"";
car_cabin_temp_s = @"";
car_tpms_fr_temp_s = @"";
car_tpms_rr_temp_s = @"";
car_tpms_fl_temp_s = @"";
Expand Down Expand Up @@ -859,8 +865,23 @@ - (void)handleCommand:(char)code command:(NSString*)cmd
}
if ([lparts count] >= 15)
{
car_aux_battery_voltage = [[lparts objectAtIndex:14] floatValue];
car_aux_battery_voltage = [[lparts objectAtIndex:14] floatValue];
}
if ([lparts count] >= 18)
{
car_doors5 = [[lparts objectAtIndex:17] intValue];
if (car_doors5 & 0x80) // HVAC
car_hvac_s = @"ON";
else
car_hvac_s = @"OFF";
}
if ([lparts count] >= 21)
{
car_cabin_temp = [[lparts objectAtIndex:20] intValue];
}
else
car_cabin_temp = -127;
car_cabin_temp_s = [self convertTemperatureUnits:car_cabin_temp];
}
}
break;
Expand Down Expand Up @@ -1576,6 +1597,12 @@ - (void)commandDoHomelink:(int)button
[self commandIssue:[NSString stringWithFormat:@"24,%d",button]];
}

- (void)commandDoClimateControl:(int)button
{
[JHNotificationManager notificationWithMessage:@"Issuing Climate Control Command..."];
[self commandIssue:[NSString stringWithFormat:@"26,%d",button]];
}

/**
Returns the managed object context for the application.
If the context doesn't already exist, it is created and bound to the persistent store coordinator for the application.
Expand Down
7 changes: 6 additions & 1 deletion OpenVehicleApp/ovms/ovmsBodyViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@
@property (strong, nonatomic) IBOutlet UILabel *m_car_temp_pem_l;
@property (strong, nonatomic) IBOutlet UILabel *m_car_temp_motor_l;
@property (strong, nonatomic) IBOutlet UILabel *m_car_temp_battery_l;
@property (strong, nonatomic) IBOutlet UILabel *m_car_temp_cabin_l;
@property (strong, nonatomic) IBOutlet UILabel *m_car_ambient_temp;
@property (strong, nonatomic) IBOutlet UILabel *m_car_cabin_temp;
@property (strong, nonatomic) IBOutlet UILabel *m_car_hvac_status;
@property (strong, nonatomic) IBOutlet UILabel *m_car_aux_battery;
@property (strong, nonatomic) IBOutlet UIImageView *m_car_weather;
@property (strong, nonatomic) IBOutlet UIImageView *m_car_tpmsboxes;
Expand All @@ -47,8 +50,10 @@
@property (strong, nonatomic) IBOutlet UIButton *m_valet_button;
@property (strong, nonatomic) IBOutlet UIButton *m_wakeup_button;
@property (strong, nonatomic) IBOutlet UIButton *m_homelink_button;
@property (strong, nonatomic) IBOutlet UIButton *m_climatecontrol_button;

- (IBAction)WakeupButton:(id)sender;
- (IBAction)HomelinkButon:(id)sender;
- (IBAction)HomelinkButton:(id)sender;
- (IBAction)ClimateControlButton:(id)sender;

@end
89 changes: 84 additions & 5 deletions OpenVehicleApp/ovms/ovmsBodyViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,17 @@ @implementation ovmsBodyViewController
@synthesize m_car_temp_pem_l;
@synthesize m_car_temp_motor_l;
@synthesize m_car_temp_battery_l;
@synthesize m_car_temp_cabin_l;
@synthesize m_car_ambient_temp;
@synthesize m_car_cabin_temp;
@synthesize m_car_hvac_status;
@synthesize m_car_weather;
@synthesize m_car_tpmsboxes;
@synthesize m_lock_button;
@synthesize m_valet_button;
@synthesize m_wakeup_button;
@synthesize m_homelink_button;
@synthesize m_climatecontrol_button;
@synthesize m_car_aux_battery;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
Expand Down Expand Up @@ -136,8 +140,11 @@ - (void)dealloc
[self setM_car_temp_pem_l:nil];
[self setM_car_temp_motor_l:nil];
[self setM_car_temp_battery_l:nil];
[self setM_car_temp_cabin_l:nil];
[self setM_car_outlineimage:nil];
[self setM_car_ambient_temp:nil];
[self setM_car_cabin_temp:nil];
[self setM_car_hvac_status:nil];
[self setM_car_valetonoff:nil];
[self setM_car_lights:nil];
[self setM_lock_button:nil];
Expand All @@ -147,6 +154,7 @@ - (void)dealloc
[self setM_car_tpmsboxes:nil];
[self setM_homelink_button:nil];
[self setM_car_aux_battery:nil];
[self setM_climatecontrol_button:nil];
}

- (void)viewWillAppear:(BOOL)animated
Expand Down Expand Up @@ -192,13 +200,15 @@ -(void) update
m_valet_button.enabled=YES;
m_wakeup_button.enabled=YES;
m_homelink_button.enabled=YES;
m_climatecontrol_button.enabled=YES;
}
else
{
m_lock_button.enabled=NO;
m_valet_button.enabled=NO;
m_wakeup_button.enabled=NO;
m_homelink_button.enabled=NO;
m_climatecontrol_button.enabled=NO;
}

int car_ambient_weather = [ovmsAppDelegate myRef].car_ambient_weather;
Expand Down Expand Up @@ -311,41 +321,58 @@ -(void) update
m_car_temp_pem.hidden = YES;
m_car_temp_motor.hidden = YES;
m_car_temp_battery.hidden = YES;
m_car_cabin_temp.hidden = YES;
m_car_hvac_status.hidden = YES;
m_car_temp_pem_l.textColor = [UIColor grayColor];
m_car_temp_motor_l.textColor = [UIColor grayColor];
m_car_temp_battery_l.textColor = [UIColor grayColor];
m_car_temp_cabin_l.textColor = [UIColor grayColor];
}
else if (car_stale_pemtemps == 0)
{
// Stale PEM temperatures
m_car_temp_pem.hidden = NO;
m_car_temp_motor.hidden = NO;
m_car_temp_battery.hidden = NO;
m_car_cabin_temp.hidden = NO;
m_car_hvac_status.hidden = NO;
m_car_temp_pem.textColor = [UIColor grayColor];
m_car_temp_pem_l.textColor = [UIColor grayColor];
m_car_temp_motor.textColor = [UIColor grayColor];
m_car_temp_motor_l.textColor = [UIColor grayColor];
m_car_temp_battery.textColor = [UIColor grayColor];
m_car_temp_battery_l.textColor = [UIColor grayColor];
m_car_cabin_temp.textColor = [UIColor grayColor];
m_car_temp_cabin_l.textColor = [UIColor grayColor];
m_car_hvac_status.textColor = [UIColor grayColor];
m_car_temp_pem.text = [ovmsAppDelegate myRef].car_tpem_s;
m_car_temp_motor.text = [ovmsAppDelegate myRef].car_tmotor_s;
m_car_temp_battery.text = [ovmsAppDelegate myRef].car_tbattery_s;
m_car_cabin_temp.text = [ovmsAppDelegate myRef].car_cabin_temp_s;
m_car_hvac_status.text = [ovmsAppDelegate myRef].car_hvac_s;
}
else
{
// OK PEM temperatures
m_car_temp_pem.hidden = NO;
m_car_temp_motor.hidden = NO;
m_car_temp_battery.hidden = NO;
m_car_cabin_temp.hidden = NO;
m_car_hvac_status.hidden = NO;
m_car_temp_pem.textColor = [UIColor whiteColor];
m_car_temp_pem_l.textColor = [UIColor whiteColor];
m_car_temp_motor.textColor = [UIColor whiteColor];
m_car_temp_motor_l.textColor = [UIColor whiteColor];
m_car_temp_battery.textColor = [UIColor whiteColor];
m_car_temp_battery_l.textColor = [UIColor whiteColor];
m_car_cabin_temp.textColor = [UIColor whiteColor];
m_car_temp_cabin_l.textColor = [UIColor whiteColor];
m_car_hvac_status.textColor = [UIColor whiteColor];
m_car_temp_pem.text = [ovmsAppDelegate myRef].car_tpem_s;
m_car_temp_motor.text = [ovmsAppDelegate myRef].car_tmotor_s;
m_car_temp_battery.text = [ovmsAppDelegate myRef].car_tbattery_s;
m_car_cabin_temp.text = [ovmsAppDelegate myRef].car_cabin_temp_s;
m_car_hvac_status.text = [ovmsAppDelegate myRef].car_hvac_s;
}

int car_stale_ambienttemps = [ovmsAppDelegate myRef].car_stale_ambienttemps;
Expand Down Expand Up @@ -406,9 +433,17 @@ -(void) update
}
else
{
m_car_wheel_fr_pressure.text = @"";
m_car_wheel_fr_temp.text = @"";
}
if ([ovmsAppDelegate myRef].car_tpms_fr_pressure > 0)
{
m_car_wheel_fr_pressure.text = [NSString stringWithFormat:@"%0.1f PSI",
[ovmsAppDelegate myRef].car_tpms_fr_pressure];
}
else
{
m_car_wheel_fr_pressure.text = @"";
}

if ([ovmsAppDelegate myRef].car_tpms_rr_temp > 0)
{
Expand All @@ -417,9 +452,17 @@ -(void) update
}
else
{
m_car_wheel_rr_pressure.text = @"";
m_car_wheel_rr_temp.text = @"";
}
if ([ovmsAppDelegate myRef].car_tpms_rr_pressure > 0)
{
m_car_wheel_rr_pressure.text = [NSString stringWithFormat:@"%0.1f PSI",
[ovmsAppDelegate myRef].car_tpms_rr_pressure];
}
else
{
m_car_wheel_rr_pressure.text = @"";
}

if ([ovmsAppDelegate myRef].car_tpms_fl_temp > 0)
{
Expand All @@ -428,9 +471,17 @@ -(void) update
}
else
{
m_car_wheel_fl_pressure.text = @"";
m_car_wheel_fl_temp.text = @"";
}
if ([ovmsAppDelegate myRef].car_tpms_fl_pressure > 0)
{
m_car_wheel_fl_pressure.text = [NSString stringWithFormat:@"%0.1f PSI",
[ovmsAppDelegate myRef].car_tpms_fl_pressure];
}
else
{
m_car_wheel_fl_pressure.text = @"";
}

if ([ovmsAppDelegate myRef].car_tpms_rl_temp > 0)
{
Expand All @@ -439,9 +490,17 @@ -(void) update
}
else
{
m_car_wheel_rl_pressure.text = @"";
m_car_wheel_rl_temp.text = @"";
}
if ([ovmsAppDelegate myRef].car_tpms_rl_pressure > 0)
{
m_car_wheel_rl_pressure.text = [NSString stringWithFormat:@"%0.1f PSI",
[ovmsAppDelegate myRef].car_tpms_rl_pressure];
}
else
{
m_car_wheel_rl_pressure.text = @"";
}

m_car_aux_battery.text = [NSString stringWithFormat:@"%0.1fV",
[ovmsAppDelegate myRef].car_aux_battery_voltage];
Expand Down Expand Up @@ -520,7 +579,19 @@ - (IBAction)WakeupButton:(id)sender
[actionSheet showInView:[self.view window]];
}

- (IBAction)HomelinkButon:(id)sender
- (IBAction)ClimateControlButton:(id)sender
{
// The climate control button has been pressed - let's heat/cool the car
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"Climate Control"
delegate:self
cancelButtonTitle:@"Cancel"
destructiveButtonTitle:nil
otherButtonTitles:@"Stop",@"Start",nil];
[actionSheet showInView:[self.view window]];
}


- (IBAction)HomelinkButton:(id)sender
{
// The homelink button has been pressed - let's ask which one he wants
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"Homelink"
Expand Down Expand Up @@ -548,6 +619,14 @@ - (void)actionSheet:(UIActionSheet *)sender clickedButtonAtIndex:(NSInteger)inde
[[ovmsAppDelegate myRef] commandDoHomelink:button];
}
}
else if ([sender.title isEqualToString:@"Climate Control"])
{
int button = (int)(index - [sender firstOtherButtonIndex]);
if ((button>=0)&&(button<2))
{
[[ovmsAppDelegate myRef] commandDoClimateControl:button];
}
}
}

@end
8 changes: 4 additions & 4 deletions OpenVehicleApp/ovms/ovmsChargerSettingsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ - (void)loadView
- (void)viewDidLoad
{
[super viewDidLoad];
int cl_row = [ovmsAppDelegate myRef].car_chargelimit-10;
int cl_row = [ovmsAppDelegate myRef].car_chargelimit-6;
if (cl_row<0) cl_row = 0;
[m_charger_current selectRow:cl_row inComponent:0 animated:NO];

Expand Down Expand Up @@ -118,7 +118,7 @@ - (IBAction)DoneButton:(id)sender
{
int ncm = (int)m_charger_mode.selectedSegmentIndex;
if (ncm>=2) ncm++;
int ncl = (int)[m_charger_current selectedRowInComponent:0] + 10;
int ncl = (int)[m_charger_current selectedRowInComponent:0] + 6;

[self dismissViewControllerAnimated:YES completion:nil];

Expand Down Expand Up @@ -148,14 +148,14 @@ - (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView

- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component
{
return (70-10)+1;
return (70-6)+1;
}

- (NSString *)pickerView:(UIPickerView *)pickerView
titleForRow:(NSInteger)row
forComponent:(NSInteger)component
{
return [NSString stringWithFormat:@"%d Amps",10+(int)row];
return [NSString stringWithFormat:@"%d Amps",6+(int)row];
}

#pragma mark -
Expand Down